FastLED 3.10.8
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 564 of file pixel_controller.h.

566 {
567#ifdef FL_IS_AVR
568 // Don't do RGBW conversion for AVR, just set the W pixel to black.
569 fl::u8 out[4] = {
570 // Get the pixels in native order.
574 0,
575 };
576 EOrderW w_placement = rgbw.w_placement;
577 // Apply w-component insertion.
579 w_placement, out[0], out[1], out[2],
580 0, // Pre-ordered RGB data with a 0 white component.
582#else
583 const fl::u8 b0_index = RGB_BYTE0(RGB_ORDER); // Needed to re-order RGB back into led native order.
586 // Source-order RGB after white extraction, then the wire reorder.
587 CRGB rgb;
588 fl::u8 w = 0;
589 loadAndScaleRGBWUnordered(rgbw, &rgb.r, &rgb.g, &rgb.b, &w);
590 // Now finish the ordering so that the output is in the native led order for all of RGBW.
592 rgbw.w_placement,
593 rgb.raw[b0_index], // in-place re-ordering for the RGB data.
594 rgb.raw[b1_index],
595 rgb.raw[b2_index],
596 w, // The white component is not ordered in this call.
597 b0_out, b1_out, b2_out, b3_out); // RGBW data now in total native led order.
598#endif
599 }
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) FL_NO_EXCEPT
Definition rgbw.cpp.hpp:679
#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 void loadAndScaleRGBWUnordered(const Rgbw &rgbw, fl::u8 *r_out, fl::u8 *g_out, fl::u8 *b_out, fl::u8 *w_out) FL_NO_EXCEPT
loadAndScaleRGBW before its wire reorder: RGB in source order plus W.
FASTLED_FORCE_INLINE fl::u8 loadAndScale1() FL_NO_EXCEPT
non-template alias of loadAndScale<1>()
FASTLED_FORCE_INLINE fl::u8 loadAndScale2() FL_NO_EXCEPT
non-template alias of loadAndScale<2>()
FASTLED_FORCE_INLINE fl::u8 loadAndScale0() FL_NO_EXCEPT
non-template alias of loadAndScale<0>()
Pixel controller class.

References FASTLED_FORCE_INLINE, FL_NO_EXCEPT, loadAndScale0(), loadAndScale1(), loadAndScale2(), loadAndScaleRGBWUnordered(), RGB_BYTE0, RGB_BYTE1, RGB_BYTE2, RGB_ORDER, rgbw, and fl::rgbw_partial_reorder().

+ Here is the call graph for this function: