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

◆ loadAndScaleRGBW()

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

Definition at line 591 of file pixel_controller.h.

592 {
593#ifdef FL_IS_AVR
594 // Don't do RGBW conversion for AVR, just set the W pixel to black.
595 fl::u8 out[4] = {
596 // Get the pixels in native order.
600 0,
601 };
602 EOrderW w_placement = rgbw.w_placement;
603 // Apply w-component insertion.
605 w_placement, out[0], out[1], out[2],
606 0, // Pre-ordered RGB data with a 0 white component.
608#else
609 const fl::u8 b0_index = RGB_BYTE0(RGB_ORDER); // Needed to re-order RGB back into led native order.
612 // Get the naive RGB data order in r,g,b order.
613 CRGB rgb(mData[0], mData[1], mData[2]);
614 fl::u8 w = 0;
615 fl::rgb_2_rgbw(rgbw.rgbw_mode,
616 rgbw.white_color_temp,
617 rgb.r, rgb.g, rgb.b, // Input colors
618 mColorAdjustment.premixed.r, mColorAdjustment.premixed.g, mColorAdjustment.premixed.b, // How these colors are scaled for color balance.
619 &rgb.r, &rgb.g, &rgb.b, &w);
620 // Now finish the ordering so that the output is in the native led order for all of RGBW.
622 rgbw.w_placement,
623 rgb.raw[b0_index], // in-place re-ordering for the RGB data.
624 rgb.raw[b1_index],
625 rgb.raw[b2_index],
626 w, // The white component is not ordered in this call.
627 b0_out, b1_out, b2_out, b3_out); // RGBW data now in total native led order.
628#endif
629 }
void rgbw_partial_reorder(EOrderW w_placement, u8 b0, u8 b1, u8 b2, u8 w, u8 *out_b0, u8 *out_b1, u8 *out_b2, u8 *out_b3)
Definition rgbw.cpp.hpp:540
FASTLED_FORCE_INLINE void rgb_2_rgbw(RGBW_MODE mode, u16 w_color_temperature, u8 r, u8 g, u8 b, u8 r_scale, u8 g_scale, u8 b_scale, u8 *out_r, u8 *out_g, u8 *out_b, u8 *out_w) FL_NOEXCEPT
Converts RGB to RGBW using one of the functions.
Definition rgbw.h:317
#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 fl::u8 loadAndScale1()
FASTLED_FORCE_INLINE fl::u8 loadAndScale0()
FASTLED_FORCE_INLINE fl::u8 loadAndScale2()
ColorAdjustment mColorAdjustment
const fl::u8 * mData
pointer to the underlying LED data
Pixel controller class.

References FASTLED_FORCE_INLINE, loadAndScale0(), loadAndScale1(), loadAndScale2(), mColorAdjustment, mData, fl::rgb_2_rgbw(), RGB_BYTE0, RGB_BYTE1, RGB_BYTE2, RGB_ORDER, 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: