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

◆ lerp15by16()

LIB8STATIC int16_t lerp15by16 ( int16_t a,
int16_t b,
fract16 frac )

Linear interpolation between two signed 15-bit values, with 8-bit fraction.

Definition at line 523 of file lib8tion.h.

524{
525 int16_t result;
526 if( b > a) {
527 uint16_t delta = b - a;
528 uint16_t scaled = scale16( delta, frac);
529 result = a + scaled;
530 } else {
531 uint16_t delta = a - b;
532 uint16_t scaled = scale16( delta, frac);
533 result = a - scaled;
534 }
535 return result;
536}
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:540

References LIB8STATIC, and scale16().

+ Here is the call graph for this function: