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

◆ easeInCubic8()

u8 fl::easeInCubic8 ( u8 i)

8-bit cubic ease-in function Takes an input value 0-255 and returns an eased value 0-255 More pronounced acceleration than quadratic

Definition at line 117 of file ease.cpp.hpp.

117 {
118 // Simple cubic ease-in: i³ scaled to 8-bit range
119 // y = i³ / MAX²
120 constexpr u16 MAX = 0xFF;
121 constexpr u32 DENOM = (u32)MAX * MAX;
122 constexpr u32 ROUND = DENOM >> 1;
123
124 u32 ii = i;
125 u32 cube = ii * ii * ii; // i³
126 u32 num = cube + ROUND;
127 return u8(num / DENOM);
128}
unsigned char u8
Definition stdint.h:131

References FL_NO_EXCEPT.

Referenced by ease8(), and ease8().

+ Here is the caller graph for this function: