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

311{
312 uint16_t result;
313 if( b > a ) {
314 uint16_t delta = b - a;
315 uint16_t scaled = scale16(delta, frac);
316 result = a + scaled;
317 } else {
318 uint16_t delta = a - b;
319 uint16_t scaled = scale16( delta, frac);
320 result = a - scaled;
321 }
322 return result;
323}
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:551

References LIB8STATIC, and scale16().

Referenced by CRGB::lerp16().

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