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

◆ ease16InOutQuad()

LIB8STATIC uint16_t ease16InOutQuad ( uint16_t i)

Definition at line 461 of file lib8tion.h.

462{
463 // This is the legacy version, there is a slightly more accurate version in fl/ease.cpp
464 // with fl::easeInOutQuad16. However the difference is minimal.
465 //
466 // 16-bit quadratic ease-in / ease-out function
467 uint16_t j = i;
468 if (j & 0x8000) {
469 j = 65535 - j;
470 }
471 uint16_t jj = scale16(j, j);
472 uint16_t jj2 = jj << 1;
473 if (i & 0x8000) {
474 jj2 = 65535 - jj2;
475 }
476 return jj2;
477}
LIB8STATIC uint16_t scale16(uint16_t i, fract16 scale)
Scale a 16-bit unsigned value by an 16-bit value, which is treated as the numerator of a fraction who...
Definition scale8.h:551

References LIB8STATIC, and scale16().

+ Here is the call graph for this function: