FastLED 3.10.6
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 ( const Rgbw & rgbw,
fl::u8 * b0_out,
fl::u8 * b1_out,
fl::u8 * b2_out,
fl::u8 * b3_out )
inline

Definition at line 563 of file pixel_controller.h.

565 {
566#ifdef FL_IS_AVR
567 // Don't do RGBW conversion for AVR, just set the W pixel to black.
568 fl::u8 out[4] = {
569 // Get the pixels in native order.
573 0,
574 };
575 EOrderW w_placement = rgbw.w_placement;
576 // Apply w-component insertion.
578 w_placement, out[0], out[1], out[2],
579 0, // Pre-ordered RGB data with a 0 white component.
581#else
582 const fl::u8 b0_index = RGB_BYTE0(RGB_ORDER); // Needed to re-order RGB back into led native order.
585 // Source-order RGB after white extraction, then the wire reorder.
586 CRGB rgb;
587 fl::u8 w = 0;
588 loadAndScaleRGBWUnordered(rgbw, &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 }
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:678
#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()
non-template alias of loadAndScale<1>()
FASTLED_FORCE_INLINE fl::u8 loadAndScale0()
non-template alias of loadAndScale<0>()
FASTLED_FORCE_INLINE fl::u8 loadAndScale2()
non-template alias of loadAndScale<2>()
FASTLED_FORCE_INLINE void loadAndScaleRGBWUnordered(const Rgbw &rgbw, fl::u8 *r_out, fl::u8 *g_out, fl::u8 *b_out, fl::u8 *w_out)
loadAndScaleRGBW before its wire reorder: RGB in source order plus W.
Pixel controller class.

References FASTLED_FORCE_INLINE, loadAndScale0(), loadAndScale1(), loadAndScale2(), loadAndScaleRGBWUnordered(), 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: