FastLED 3.10.8
Loading...
Searching...
No Matches

◆ lerp15by8()

LIB8STATIC fl::i16 lerp15by8 ( fl::i16 a,
fl::i16 b,
fract8 frac )

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

Definition at line 415 of file lib8tion.h.

416 {
417 fl::i16 result;
418 if( b > a) {
419 fl::u16 delta = b - a;
420 fl::u16 scaled = scale16by8( delta, frac);
421 result = a + scaled;
422 } else {
423 fl::u16 delta = a - b;
424 fl::u16 scaled = scale16by8( delta, frac);
425 result = a - scaled;
426 }
427 return result;
428}
expected< T, E > result
Alias for expected (Rust-style naming)
Definition result.h:31

References FL_NO_EXCEPT, and LIB8STATIC.