35template <
typename Fixed>
37 return Fixed(g).raw();
41template <u32 GammaRaw>
struct GammaEval;
42template <
typename Fn, fl::size N>
struct ProgmemLUT;
63 return (v & 0xFFFF0000u) ?
hb_step(v >> 16, r + 16)
64 : (v & 0x0000FF00u) ?
hb_step(v >> 8, r + 8)
65 : (v & 0x000000F0u) ?
hb_step(v >> 4, r + 4)
66 : (v & 0x0000000Cu) ?
hb_step(v >> 2, r + 2)
67 : (v & 0x00000002u) ? r + 1
72 return v == 0 ? -1 :
hb_step(v, 0);
89 return (
static_cast<i64>(-1788416LL) *
t) >>
FRAC;
104 return static_cast<i32
>(
111 return val == 0 ?
static_cast<i32
>(0x80000000)
120 return (214016ULL * fr) >>
FRAC;
137 return (
x >>
FRAC) >= 8 ? 0xFFFFFFFFu
147 return ((pos_val >>
FRAC) + 1) >= 32 ? 0
150 >> ((pos_val >>
FRAC) + 1)
162 return base_raw == 0 ? 0
163 : exp_raw == 0 ?
SCALE
166 (
static_cast<i64>(exp_raw) *
175 return x == 0 ?
static_cast<u8>(0)
176 :
x == 255 ?
static_cast<u8>(255)
179 static_cast<u32
>((
static_cast<u64>(
x) <<
FRAC) / 255),
190 return x == 0 ?
static_cast<u16
>(0)
191 :
x == 255 ?
static_cast<u16
>(65535)
194 static_cast<u32
>((
static_cast<u64>(
x) <<
FRAC) / 255),
208template <u32 GammaRaw>
217template <u32 GammaRaw>
228template <
typename T, fl::size N>
233template <
typename Fn, fl::size... Is>
236 return {{ Fn()(
static_cast<u8>(Is))... }};
239template <
typename Fn, fl::size... Is>
240constexpr LutArray<u16,
sizeof...(Is)>
242 return {{ Fn()(
static_cast<u8>(Is))... }};
249template <
typename Fn, fl::size N>
258template <
typename Fn, fl::size N>
266template <
typename Fn, fl::size N>
279template <
typename Fn, fl::size N>
#define FL_ALIGN_PROGMEM(N)
Force N-byte alignment for platforms with unaligned access or cache-line optimization.
#define FL_PGM_READ_BYTE_NEAR(x)
Read a byte (8-bit) from PROGMEM memory.
#define FL_PGM_READ_WORD_NEAR(x)
Read a word (16-bit) from PROGMEM memory.
#define FL_PROGMEM
PROGMEM keyword for storage.
Wrapper definitions to allow seamless use of PROGMEM in environments that have it.
constexpr u16 eval16(u8 x, u32 gamma_raw) FL_NOEXCEPT
constexpr u32 pow_fp(u32 base_raw, u32 exp_raw) FL_NOEXCEPT
constexpr i64 log2_h1(i64 t) FL_NOEXCEPT
constexpr i32 log2_fp(u32 val) FL_NOEXCEPT
constexpr u64 exp2_h3(u64 fr) FL_NOEXCEPT
constexpr u32 exp2_pos(u32 x) FL_NOEXCEPT
constexpr int highest_bit(u32 v) FL_NOEXCEPT
constexpr u64 exp2_h0(u64 fr) FL_NOEXCEPT
constexpr u32 exp2_fp(i32 x) FL_NOEXCEPT
constexpr u32 log2_t(u32 val, int msb) FL_NOEXCEPT
constexpr u64 exp2_frac(u64 fr) FL_NOEXCEPT
constexpr i64 log2_h3(i64 t) FL_NOEXCEPT
constexpr i64 log2_h0(i64 t) FL_NOEXCEPT
constexpr u64 exp2_h2(u64 fr) FL_NOEXCEPT
constexpr u64 exp2_h1(u64 fr) FL_NOEXCEPT
constexpr i32 log2_with_msb(u32 val, int msb) FL_NOEXCEPT
constexpr u8 eval(u8 x, u32 gamma_raw) FL_NOEXCEPT
constexpr u32 exp2_neg(u32 pos_val) FL_NOEXCEPT
constexpr int hb_step(u32 v, int r) FL_NOEXCEPT
constexpr i64 log2_h2(i64 t) FL_NOEXCEPT
constexpr LutArray< u16, sizeof...(Is)> make_lut_u16(fl::index_sequence< Is... >) FL_NOEXCEPT
constexpr LutArray< u8, sizeof...(Is)> make_lut_u8(fl::index_sequence< Is... >) FL_NOEXCEPT
Compile-time linker keep-alive hook for a single fl::Bus.
typename make_index_sequence_impl< N >::type make_index_sequence
const detail::LutArray< u8, N > ProgmemLUT< Fn, N >::kData
ProgmemLUT< GammaEval< gamma< u8x24 >(2.8f)>, 256 > Gamma28LUT
ProgmemLUT16< GammaEval16< gamma< u8x24 >(2.2f)>, 256 > Gamma22LUT16
ProgmemLUT16< GammaEval16< G >, 256 > GammaTable16_256
constexpr u32 gamma(float g) FL_NOEXCEPT
typename make_index_sequence_impl< N >::type make_index_sequence
ProgmemLUT< GammaEval< G >, 256 > GammaTable256
ProgmemLUT16< GammaEval16< gamma< u8x24 >(2.8f)>, 256 > Gamma28LUT16
ProgmemLUT< GammaEval< gamma< u8x24 >(2.2f)>, 256 > Gamma22LUT
Base definition for an LED controller.
constexpr u16 operator()(u8 x) const FL_NOEXCEPT
constexpr u8 operator()(u8 x) const FL_NOEXCEPT
static const detail::LutArray< u16, N > kData
static u16 read(u8 index) FL_NOEXCEPT
static const u16 * data() FL_NOEXCEPT
static u8 read(u8 index) FL_NOEXCEPT
static const detail::LutArray< u8, N > kData