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

◆ easeOutQuad16()

u16 fl::easeOutQuad16 ( u16 i)

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

Definition at line 228 of file ease.cpp.

228 {
229 // ease-out quadratic: 1 - (1-t)²
230 // For 16-bit: y = MAX - (MAX-i)² / MAX
231 constexpr u32 MAX = 0xFFFF; // 65535
232 constexpr u32 ROUND = MAX >> 1; // for rounding
233
234 fl::u64 d = MAX - i; // (MAX - i)
235 fl::u64 num = d * d + ROUND; // (MAX-i)² + rounding
236 return u16(MAX - (num / MAX));
237}
#define MAX(a, b)
Definition math_macros.h:37

References MAX.

Referenced by ease16(), and ease16().

+ Here is the caller graph for this function: