FastLED 3.9.15
Loading...
Searching...
No Matches

◆ easeOutCubic16()

u16 fl::easeOutCubic16 ( u16 i)

16-bit cubic ease-out function Takes an input value 0-65535 and returns an eased value 0-65535

Definition at line 252 of file ease.cpp.

252 {
253 // ease-out cubic: 1 - (1-t)³
254 // For 16-bit: y = MAX - (MAX-i)³ / MAX²
255 constexpr u32 MAX = 0xFFFF; // 65535
256 constexpr fl::u64 DENOM = (fl::u64)MAX * MAX; // 65535²
257 constexpr fl::u64 ROUND = DENOM >> 1; // for rounding
258
259 fl::u64 d = MAX - i; // (MAX - i)
260 fl::u64 cube = d * d * d; // (MAX-i)³
261 fl::u64 num = cube + ROUND;
262 return u16(MAX - (num / DENOM));
263}
#define MAX(a, b)
Definition math_macros.h:37

References MAX.

Referenced by ease16(), and ease16().

+ Here is the caller graph for this function: