FastLED 3.9.15
Loading...
Searching...
No Matches
Integer Mapping Functions

Detailed Description

Maps a scalar from one integer size to another.

For example, a value representing 40% as an 8-bit unsigned integer would be 102 / 255. Using map8_to_16(uint8_t) to convert that to a 16-bit unsigned integer would give you 26,214 / 65,535, exactly 40% through the larger range.

+ Collaboration diagram for Integer Mapping Functions:

Functions

LIB8STATIC_ALWAYS_INLINE uint8_t map16_to_8 (uint16_t x)
 
LIB8STATIC_ALWAYS_INLINE uint16_t map8_to_16 (uint8_t x)
 
LIB8STATIC_ALWAYS_INLINE uint32_t map8_to_32 (uint8_t x)