FastLED 3.9.15
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 107 of file ease.cpp.

107 {
108 // Simple cubic ease-in: i³ scaled to 8-bit range
109 // y = i³ / MAX²
110 constexpr u16 MAX = 0xFF;
111 constexpr u32 DENOM = (u32)MAX * MAX;
112 constexpr u32 ROUND = DENOM >> 1;
113
114 u32 ii = i;
115 u32 cube = ii * ii * ii; // i³
116 u32 num = cube + ROUND;
117 return u8(num / DENOM);
118}
#define MAX(a, b)
Definition math_macros.h:37
unsigned char u8
Definition int.h:17

References MAX.

Referenced by ease8(), and ease8().

+ Here is the caller graph for this function: