FastLED 3.9.15
Loading...
Searching...
No Matches

◆ loadAndScale_WS2816_HD()

template<EOrder RGB_ORDER, int LANES = 1, uint32_t MASK = 0xFFFFFFFF>
FASTLED_FORCE_INLINE void PixelController< RGB_ORDER, LANES, MASK >::loadAndScale_WS2816_HD ( uint16_t * s0_out,
uint16_t * s1_out,
uint16_t * s2_out )
inline

Definition at line 521 of file pixel_controller.h.

521 {
522 // Note that the WS2816 has a 4 bit gamma correction built in. To improve things this algorithm may
523 // change in the future with a partial gamma correction that is completed by the chipset gamma
524 // correction.
528 if (r16 || g16 || b16) {
529 #if FASTLED_HD_COLOR_MIXING
532 #else
533 uint8_t brightness = 255;
534 CRGB scale = mColorAdjustment.premixed;
535 #endif
536 if (scale[0] != 255) {
537 r16 = scale16by8(r16, scale[0]);
538 }
539 if (scale[1] != 255) {
540 g16 = scale16by8(g16, scale[1]);
541 }
542 if (scale[2] != 255) {
543 b16 = scale16by8(b16, scale[2]);
544 }
545 if (brightness != 255) {
549 }
550 }
551 uint16_t rgb16[3] = {r16, g16, b16};
558 }
LIB8STATIC_ALWAYS_INLINE uint16_t scale16by8(uint16_t i, fract8 scale)
Scale a 16-bit unsigned value by an 8-bit value, which is treated as the numerator of a fraction whos...
Definition scale8.h:468
LIB8STATIC_ALWAYS_INLINE uint16_t map8_to_16(uint8_t x)
Definition intmap.h:25
#define RGB_BYTE2(RO)
Gets the color channel for byte 2.
#define RGB_BYTE1(RO)
Gets the color channel for byte 1.
#define RGB_BYTE0(RO)
Gets the color channel for byte 0.
static FASTLED_FORCE_INLINE uint8_t scale(PixelController &pc, uint8_t b)
Scale a value using the per-channel scale data.
const uint8_t * mData
pointer to the underlying LED data
ColorAdjustment mColorAdjustment
Pixel controller class.

References brightness, FASTLED_FORCE_INLINE, map8_to_16(), mColorAdjustment, mData, RGB_BYTE0, RGB_BYTE1, RGB_BYTE2, scale(), and scale16by8().

Referenced by WS2816Controller< DATA_PIN, RGB_ORDER >::showPixels().

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