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 454 of file lib8tion.h.

455{
456 uint16_t result;
457 if( b > a ) {
458 uint16_t delta = b - a;
459 uint16_t scaled = scale16(delta, frac);
460 result = a + scaled;
461 } else {
462 uint16_t delta = a - b;
463 uint16_t scaled = scale16( delta, frac);
464 result = a - scaled;
465 }
466 return result;
467}
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:546

References LIB8STATIC, and scale16().

Referenced by CRGB::lerp16().

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