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

237 {
238 // ease-out quadratic: 1 - (1-t)²
239 // For 16-bit: y = MAX - (MAX-i)² / MAX
240 constexpr u32 MAX = 0xFFFF; // 65535
241 constexpr u32 ROUND = MAX >> 1; // for rounding
242
243 fl::u64 d = MAX - i; // (MAX - i)
244 fl::u64 num = d * d + ROUND; // (MAX-i)² + rounding
245 return u16(MAX - (num / MAX));
246}
#define MAX(a, b)
Definition coder.h:60
fl::u64 u64
Definition s16x16x4.h:221

References MAX.

Referenced by ease16(), and ease16().

+ Here is the caller graph for this function: