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 116 of file ease.cpp.hpp.

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

References MAX.

Referenced by ease8(), and ease8().

+ Here is the caller graph for this function: