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

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