MCPcopy Create free account
hub / github.com/FastLED/FastLED / lpd8806Encode

Function lpd8806Encode

src/fl/chipsets/encoders/encoder_utils.h:60–63  ·  view source on GitHub ↗

@brief Apply LPD8806 encoding to a single color byte @param value 8-bit color value (0-255) @return 7-bit color with MSB set (0x80-0xFF) @note LPD8806 uses 7-bit color depth with MSB always set

Source from the content-addressed store, hash-verified

58/// @return 7-bit color with MSB set (0x80-0xFF)
59/// @note LPD8806 uses 7-bit color depth with MSB always set
60inline u8 lpd8806Encode(u8 value) FL_NOEXCEPT {
61 // LPD8806 requires MSB set on each byte, and uses 7-bit color depth
62 return 0x80 | ((value >> 1) | ((value && (value < 254)) & 0x01));
63}
64
65/// @brief Convert 8-bit color to HD108 16-bit gamma-corrected value (gamma 2.8)
66/// @param value 8-bit color value (0-255)

Callers 2

encodeLPD8806Function · 0.85
lpd8806.hppFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected