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

573 {
574#ifdef __AVR__
575 // Don't do RGBW conversion for AVR, just set the W pixel to black.
576 uint8_t out[4] = {
577 // Get the pixels in native order.
581 0,
582 };
583 EOrderW w_placement = rgbw.w_placement;
584 // Apply w-component insertion.
586 w_placement, out[0], out[1], out[2],
587 0, // Pre-ordered RGB data with a 0 white component.
589#else
590 const uint8_t b0_index = RGB_BYTE0(RGB_ORDER); // Needed to re-order RGB back into led native order.
593 // Get the naive RGB data order in r,g,b order.
594 CRGB rgb(mData[0], mData[1], mData[2]);
595 uint8_t w = 0;
596 fl::rgb_2_rgbw(rgbw.rgbw_mode,
597 rgbw.white_color_temp,
598 rgb.r, rgb.g, rgb.b, // Input colors
599 mColorAdjustment.premixed.r, mColorAdjustment.premixed.g, mColorAdjustment.premixed.b, // How these colors are scaled for color balance.
600 &rgb.r, &rgb.g, &rgb.b, &w);
601 // Now finish the ordering so that the output is in the native led order for all of RGBW.
603 rgbw.w_placement,
604 rgb.raw[b0_index], // in-place re-ordering for the RGB data.
605 rgb.raw[b1_index],
606 rgb.raw[b2_index],
607 w, // The white component is not ordered in this call.
608 b0_out, b1_out, b2_out, b3_out); // RGBW data now in total native led order.
609#endif
610 }
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:149
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:134
#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.
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, fl::rgb_2_rgbw(), RGB_BYTE0, RGB_BYTE1, RGB_BYTE2, rgbw, and fl::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: