FastLED 3.10.8
Loading...
Searching...
No Matches

◆ fade()

FASTLED_FORCE_INLINE fl::i32 fl::perlin_q16::fade ( fl::i32 t,
const fl::i32 * table )
staticprivate

Definition at line 71 of file perlin_q16.cpp.hpp.

71 {
72 fl::u32 idx = static_cast<fl::u32>(t) >> 8; // Q16 → 8-bit index
73 fl::i32 frac = t & 0xFF;
74 fl::i32 a = table[idx];
75 fl::i32 b = table[idx + 1];
76 // Lerp in Q16: frac is 8 bits, expand to 16 for precision
77 return a + static_cast<fl::i32>(
78 (static_cast<fl::i32>(frac << 8) * (b - a)) >> 16);
79}

References FASTLED_FORCE_INLINE, fl::FL_NO_EXCEPT, and fl::t.