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

◆ loadAndScaleRGBW()

template<EOrder RGB_ORDER, int LANES = 1, uint32_t MASK = 0xFFFFFFFF>
FASTLED_FORCE_INLINE void PixelController< RGB_ORDER, LANES, MASK >::loadAndScaleRGBW ( Rgbw rgbw,
uint8_t * b0_out,
uint8_t * b1_out,
uint8_t * b2_out,
uint8_t * b3_out )
inline

Definition at line 560 of file pixel_controller.h.

561 {
562#ifdef __AVR__
563 // Don't do RGBW conversion for AVR, just set the W pixel to black.
564 uint8_t out[4] = {
565 // Get the pixels in native order.
569 0,
570 };
571 EOrderW w_placement = rgbw.w_placement;
572 // Apply w-component insertion.
574 w_placement, out[0], out[1], out[2],
575 0, // Pre-ordered RGB data with a 0 white component.
577#else
578 const uint8_t b0_index = RGB_BYTE0(RGB_ORDER); // Needed to re-order RGB back into led native order.
581 // Get the naive RGB data order in r,g,b order.
582 CRGB rgb(mData[0], mData[1], mData[2]);
583 uint8_t w = 0;
584 rgb_2_rgbw(rgbw.rgbw_mode,
585 rgbw.white_color_temp,
586 rgb.r, rgb.g, rgb.b, // Input colors
587 mColorAdjustment.premixed.r, mColorAdjustment.premixed.g, mColorAdjustment.premixed.b, // How these colors are scaled for color balance.
588 &rgb.r, &rgb.g, &rgb.b, &w);
589 // Now finish the ordering so that the output is in the native led order for all of RGBW.
591 rgbw.w_placement,
592 rgb.raw[b0_index], // in-place re-ordering for the RGB data.
593 rgb.raw[b1_index],
594 rgb.raw[b2_index],
595 w, // The white component is not ordered in this call.
596 b0_out, b1_out, b2_out, b3_out); // RGBW data now in total native led order.
597#endif
598 }
#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.
void rgbw_partial_reorder(EOrderW w_placement, uint8_t b0, uint8_t b1, uint8_t b2, uint8_t w, uint8_t *out_b0, uint8_t *out_b1, uint8_t *out_b2, uint8_t *out_b3)
Definition rgbw.cpp:133
FASTLED_FORCE_INLINE void rgb_2_rgbw(RGBW_MODE mode, uint16_t w_color_temperature, uint8_t r, uint8_t g, uint8_t b, uint8_t r_scale, uint8_t g_scale, uint8_t b_scale, uint8_t *out_r, uint8_t *out_g, uint8_t *out_b, uint8_t *out_w)
Converts RGB to RGBW using one of the functions.
Definition rgbw.h:150
FASTLED_FORCE_INLINE uint8_t loadAndScale0()
non-template alias of loadAndScale<0>()
const uint8_t * mData
pointer to the underlying LED data
ColorAdjustment mColorAdjustment
FASTLED_FORCE_INLINE uint8_t loadAndScale1()
non-template alias of loadAndScale<1>()
FASTLED_FORCE_INLINE uint8_t loadAndScale2()
non-template alias of loadAndScale<2>()
Pixel controller class.

References FASTLED_FORCE_INLINE, loadAndScale0(), loadAndScale1(), loadAndScale2(), mColorAdjustment, mData, rgb_2_rgbw(), RGB_BYTE0, RGB_BYTE1, RGB_BYTE2, rgbw, and rgbw_partial_reorder().

Referenced by RGBWEmulatedController< CONTROLLER, RGB_ORDER >::showPixels().

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