16template<
class T,
int F,
int I>
class qfx {
21 qfx(
float fx) {
i = fx;
f = (fx-
i) * (1<<F); }
23 qfx(uint8_t _i, uint8_t _f) {
i=_i;
f=_f; }
33#if defined(FASTLED_ARM) | defined(FASTLED_RISCV) | defined(FASTLED_APOLLO3)
39template<
class T,
int F,
int I>
static uint32_t
operator*(uint32_t v,
qfx<T,F,I> & q) {
return q * v; }
40template<
class T,
int F,
int I>
static uint16_t
operator*(uint16_t v,
qfx<T,F,I> & q) {
return q * v; }
43#if defined(FASTLED_ARM) | defined(FASTLED_RISCV) | defined(FASTLED_APOLLO3)
44template<
class T,
int F,
int I>
static int operator*(
int v,
qfx<T,F,I> & q) {
return q * v; }
qfx(uint8_t _i, uint8_t _f)
Constructor, storing a fractional int directly.
int16_t operator*(int16_t v)
Multiply the fractional int by a value.
uint16_t operator*(uint16_t v)
Multiply the fractional int by a value.
uint32_t operator*(uint32_t v)
Multiply the fractional int by a value.
qfx(float fx)
Constructor, storing a float as a fractional int.
int32_t operator*(int32_t v)
Multiply the fractional int by a value.
Template class for representing fractional ints.
qfx< uint8_t, 4, 4 > q44
A 4.4 integer (4 bits integer, 4 bits fraction)
qfx< uint8_t, 6, 2 > q62
A 6.2 integer (6 bits integer, 2 bits fraction)
qfx< uint16_t, 12, 4 > q124
A 12.4 integer (12 bits integer, 4 bits fraction)
qfx< uint16_t, 8, 8 > q88
A 8.8 integer (8 bits integer, 8 bits fraction)
static uint32_t operator*(uint32_t v, qfx< T, F, I > &q)
#define FASTLED_NAMESPACE_END
Implements the FastLED namespace macros.