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

◆ lerp15by16()

LIB8STATIC fl::i16 lerp15by16 ( fl::i16 a,
fl::i16 b,
fract16 frac )

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

Definition at line 432 of file lib8tion.h.

433 {
434 fl::i16 result;
435 if( b > a) {
436 fl::u16 delta = b - a;
437 fl::u16 scaled = scale16( delta, frac);
438 result = a + scaled;
439 } else {
440 fl::u16 delta = a - b;
441 fl::u16 scaled = scale16( delta, frac);
442 result = a - scaled;
443 }
444 return result;
445}
expected< T, E > result
Alias for expected (Rust-style naming)
Definition result.h:31

References FL_NO_EXCEPT, and LIB8STATIC.