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

◆ easeInCubic16()

u16 fl::easeInCubic16 ( u16 i)

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

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

249 {
250 // Simple cubic ease-in: i³ scaled to 16-bit range
251 // y = i³ / MAX²
252 constexpr u32 MAX = 0xFFFF; // 65535
253 constexpr fl::u64 DENOM = (fl::u64)MAX * MAX; // 65535²
254 constexpr fl::u64 ROUND = DENOM >> 1; // for rounding
255
256 fl::u64 ii = i;
257 fl::u64 cube = ii * ii * ii; // i³
258 fl::u64 num = cube + ROUND;
259 return u16(num / DENOM);
260}
fl::u64 u64
Definition s16x16x4.h:221

References FL_NO_EXCEPT.

Referenced by ease16(), and ease16().

+ Here is the caller graph for this function: