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

◆ lerp16by16()

LIB8STATIC uint16_t lerp16by16 ( uint16_t a,
uint16_t b,
fract16 frac )

Linear interpolation between two unsigned 16-bit values, with 16-bit fraction.

Definition at line 472 of file lib8tion.h.

473{
474 uint16_t result;
475 if( b > a ) {
476 uint16_t delta = b - a;
477 uint16_t scaled = scale16(delta, frac);
478 result = a + scaled;
479 } else {
480 uint16_t delta = a - b;
481 uint16_t scaled = scale16( delta, frac);
482 result = a - scaled;
483 }
484 return result;
485}
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().

Referenced by CRGB::lerp16().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: