|
FastLED 3.9.15
|
Fast linear interpolation functions, such as could be used for Perlin noise, etc.
A note on the structure of the lerp functions: The cases for b>a and b<=a are handled separately for speed. Without knowing the relative order of a and b, the value (a-b) might be overflow the width of a or b, and have to be promoted to a wider, slower type. To avoid that, we separate the two cases, and are able to do all the math in the same width as the arguments, which is much faster and smaller on AVR.
Collaboration diagram for Linear Interpolation:Functions | |
| LIB8STATIC fl::i16 | lerp15by16 (fl::i16 a, fl::i16 b, fract16 frac) |
| Linear interpolation between two signed 15-bit values, with 8-bit fraction. | |
| LIB8STATIC fl::i16 | lerp15by8 (fl::i16 a, fl::i16 b, fract8 frac) |
| Linear interpolation between two signed 15-bit values, with 8-bit fraction. | |
| LIB8STATIC fl::u16 | lerp16by16 (fl::u16 a, fl::u16 b, fract16 frac) |
| Linear interpolation between two unsigned 16-bit values, with 16-bit fraction. | |
| LIB8STATIC fl::u16 | lerp16by8 (fl::u16 a, fl::u16 b, fract8 frac) |
| Linear interpolation between two unsigned 16-bit values, with 8-bit fraction. | |
| LIB8STATIC fl::u8 | lerp8by8 (fl::u8 a, fl::u8 b, fract8 frac) |
| Linear interpolation between two unsigned 8-bit values, with 8-bit fraction. | |
| LIB8STATIC fl::u8 | map8 (fl::u8 in, fl::u8 rangeStart, fl::u8 rangeEnd) |
| Map from one full-range 8-bit value into a narrower range of 8-bit values, possibly a range of hues. | |