FastLED 3.9.15
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 431 of file lib8tion.h.

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

References LIB8STATIC.