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

◆ ease16InOutQuad()

LIB8STATIC fl::u16 ease16InOutQuad ( fl::u16 i)

Definition at line 531 of file lib8tion.h.

532{
533 // This is the legacy version, there is a slightly more accurate version in fl/ease.cpp
534 // with fl::easeInOutQuad16. However the difference is minimal.
535 //
536 // 16-bit quadratic ease-in / ease-out function
537 fl::u16 j = i;
538 if (j & 0x8000) {
539 j = 65535 - j;
540 }
541 fl::u16 jj = scale16(j, j);
542 fl::u16 jj2 = jj << 1;
543 if (i & 0x8000) {
544 jj2 = 65535 - jj2;
545 }
546 return jj2;
547}

References LIB8STATIC.