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

◆ loadAndScaleRGBWW()

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

Load + scale a single pixel to 5-channel RGBWW (issue #2558).

Mirrors loadAndScaleRGBW: applies the per-channel premix scale, dispatches to rgb_2_rgbww for the colorimetric solve, then routes the five output bytes through rgbww_partial_reorder for the wire-order placement.

Definition at line 635 of file pixel_controller.h.

638 {
639#ifdef FL_IS_AVR
640 // AVR: float colorimetric math is too expensive on the 8-bit core;
641 // the strip will get RGB-only output with both white channels black.
642 // Surface this with a FL_WARN_ONCE so the silent dropout is visible
643 // when debugging — a user configuring RGBWW on an AVR target almost
644 // certainly didn't expect their warm/cool W channels to be inert.
645 FL_WARN_ONCE("RGBWW colorimetric is not supported on AVR — the warm "
646 "and cool white channels will be black. Use an ESP32 / "
647 "Teensy / RP2040 target for full RGBWW support.");
652 rgbww.w_placement,
653 r_pre, g_pre, b_pre,
654 0, 0,
656#else
660 CRGB rgb(mData[0], mData[1], mData[2]);
661 fl::u8 ww = 0;
662 fl::u8 wc = 0;
664 rgb.r, rgb.g, rgb.b,
665 mColorAdjustment.premixed.r,
666 mColorAdjustment.premixed.g,
667 mColorAdjustment.premixed.b,
668 &rgb.r, &rgb.g, &rgb.b, &ww, &wc);
670 rgbww.w_placement,
671 rgb.raw[b0_index],
672 rgb.raw[b1_index],
673 rgb.raw[b2_index],
674 ww, wc,
676#endif
677 }
#define FL_WARN_ONCE(X)
Definition log.h:278
FASTLED_FORCE_INLINE void rgb_2_rgbww(const Rgbww &cfg, fl::u8 r, fl::u8 g, fl::u8 b, fl::u8 r_scale, fl::u8 g_scale, fl::u8 b_scale, fl::u8 *out_r, fl::u8 *out_g, fl::u8 *out_b, fl::u8 *out_ww, fl::u8 *out_wc) FL_NOEXCEPT
Definition rgbww.h:173
void rgbww_partial_reorder(EOrderWW ww_placement, u8 b0, u8 b1, u8 b2, u8 ww, u8 wc, u8 *out_b0, u8 *out_b1, u8 *out_b2, u8 *out_b3, u8 *out_b4) FL_NOEXCEPT
Dispatch RGB->RGBWW for a given mode.
#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, FL_WARN_ONCE, loadAndScale0(), loadAndScale1(), loadAndScale2(), mColorAdjustment, mData, fl::rgb_2_rgbww(), RGB_BYTE0, RGB_BYTE1, RGB_BYTE2, RGB_ORDER, fl::rgbww_partial_reorder(), and fl::Rgbww::w_placement.

+ Here is the call graph for this function: