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 533 of file pixel_controller.h.

533 {
534 // Note that the WS2816 has a 4 bit gamma correction built in. To improve things this algorithm may
535 // change in the future with a partial gamma correction that is completed by the chipset gamma
536 // correction.
540 if (r16 || g16 || b16) {
541 #if FASTLED_HD_COLOR_MIXING
544 #else
545 uint8_t brightness = 255;
546 CRGB scale = mColorAdjustment.premixed;
547 #endif
548 if (scale[0] != 255) {
549 r16 = scale16by8(r16, scale[0]);
550 }
551 if (scale[1] != 255) {
552 g16 = scale16by8(g16, scale[1]);
553 }
554 if (scale[2] != 255) {
555 b16 = scale16by8(b16, scale[2]);
556 }
557 if (brightness != 255) {
561 }
562 }
563 uint16_t rgb16[3] = {r16, g16, b16};
570 }
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:478
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: