10#pragma GCC diagnostic push
11#pragma GCC diagnostic ignored "-Wfloat-equal"
31 const bool has_rotation = (
rotation != 0.0f);
35 float cos_theta = cosf(radians);
36 float sin_theta = sinf(radians);
37 float x_rotated =
x * cos_theta -
y * sin_theta;
38 float y_rotated =
x * sin_theta +
y * cos_theta;
39 return vec2f(x_rotated, y_rotated);
51 uint32_t numer =
static_cast<uint32_t
>(max_value) << 16;
53 uint32_t scale32 = numer / 0xFFFF;
72 uint32_t numer =
static_cast<uint32_t
>(max.
x - min.
x) << 16;
74 uint32_t scale32 = numer / 0xFFFF;
80 uint32_t numer =
static_cast<uint32_t
>(max.
y - min.
y) << 16;
82 uint32_t scale32 = numer / 0xFFFF;
97 constexpr int32_t MID = 0x7FFF;
100 int32_t
x = int32_t(out.
x) - MID;
101 int32_t
y = int32_t(out.
y) - MID;
108 int32_t xr = (
x * c -
y * s) >> 15;
109 int32_t yr = (
x * s +
y * c) >> 15;
118 uint32_t tx = uint32_t(out.
x) *
scale_x;
122 uint32_t ty = uint32_t(out.
y) *
scale_y;
161#pragma GCC diagnostic pop
unsigned int xy(unsigned int x, unsigned int y)
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.
Implements a simple red square effect for 2D LED grids.
Fast, efficient 8-bit trigonometry functions specifically designed for high-performance LED programmi...