32 const bool has_rotation = (
rotation != 0.0f);
36 float cos_theta = cosf(radians);
37 float sin_theta = sinf(radians);
38 float x_rotated =
x * cos_theta -
y * sin_theta;
39 float y_rotated =
x * sin_theta +
y * cos_theta;
40 return vec2f(x_rotated, y_rotated);
52 u32 numer =
static_cast<u32
>(max_value) << 16;
54 u32 scale32 = numer / 0xFFFF;
66 const vec2<alpha16> &max,
alpha16 rotation) {
73 u32 numer =
static_cast<u32
>(max.x - min.x) << 16;
75 u32 scale32 = numer / 0xFFFF;
81 u32 numer =
static_cast<u32
>(max.y - min.y) << 16;
83 u32 scale32 = numer / 0xFFFF;
94 vec2<alpha16> out =
xy;
98 constexpr i32 MID = 0x7FFF;
101 i32
x = i32(out.x) - MID;
102 i32
y = i32(out.y) - MID;
109 i32 xr = (
x * c -
y * s) >> 15;
110 i32 yr = (
x * s +
y * c) >> 15;
uint32_t scale_y[NUM_LAYERS]
uint32_t scale_x[NUM_LAYERS]
unsigned int xy(unsigned int x, unsigned int y)
#define FL_DISABLE_WARNING(warning)
#define FL_DISABLE_WARNING_PUSH
#define FL_DISABLE_WARNING_POP
LIB8STATIC uint16_t scale16(uint16_t i, fract16 scale)
Scale a 16-bit unsigned value by an 16-bit value, which is treated as the numerator of a fraction who...
LIB8STATIC int16_t cos16(uint16_t theta)
Fast 16-bit approximation of cos(x).
#define sin16
Platform-independent alias of the fast sin implementation.
LIB8STATIC_ALWAYS_INLINE uint16_t map32_to_16(uint32_t x)
Defines integer mapping functions.
Fast, efficient 8-bit trigonometry functions specifically designed for high-performance LED programmi...