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

◆ showPixels()

template<typename CONTROLLER, EOrder RGB_ORDER = GRB>
virtual void RGBWEmulatedController< CONTROLLER, RGB_ORDER >::showPixels ( PixelController< RGB_ORDER, LANES, MASK > & pixels)
inlineoverridevirtual

Main rendering function that converts RGB to RGBW and shows pixels.

This function:

  1. Converts each RGB pixel to RGBW format based on the configured conversion mode
  2. Packs the RGBW data into a format the RGB controller can transmit
  3. Temporarily bypasses color correction/temperature on the base controller
  4. Sends the packed data to the physical LED strip
    Parameters
    pixelsThe pixel controller containing RGB data to be converted

Implements CPixelLEDController< GRB, CONTROLLER::LANES_VALUE, CONTROLLER::MASK_VALUE >.

Definition at line 244 of file chipsets.h.

244 {
245 // Ensure buffer is large enough
247 Rgbw rgbw = this->getRgbw();
249 while (pixels.has(1)) {
250 pixels.stepDithering();
251 pixels.loadAndScaleRGBW(rgbw, data, data + 1, data + 2, data + 3);
252 data += 4;
253 pixels.advanceData();
254 }
255
256 // Force the device controller to a state where it passes data through
257 // unmodified: color correction, color temperature, dither, and brightness
258 // (passed as an argument to show()). Temporarily enable the controller,
259 // show the LEDs, and disable it again.
260 //
261 // The device controller is in the global controller list, so if we
262 // don't keep it disabled, it will refresh again with unknown brightness,
263 // temperature, etc.
264
265 mController.setCorrection(CRGB(255, 255, 255));
266 mController.setTemperature(CRGB(255, 255, 255));
267 mController.setDither(DISABLE_DITHER);
268
269 mController.setEnabled(true);
270 mController.callShow(mRGBWPixels.get(), Rgbw::size_as_rgb(pixels.size()), 255);
271 mController.setEnabled(false);
272 }
Emulation layer to support RGBW LEDs on RGB controllers.
Definition chipsets.h:195
Rgbw getRgbw() const FL_NOEXCEPT
virtual int size() const FL_NOEXCEPT
How many LEDs does this controller manage?
void ensureBuffer(fl::i32 num_leds)
Ensures the internal RGBW buffer is large enough for the LED count.
Definition chipsets.h:287
ControllerT mController
The underlying RGB controller instance.
Definition chipsets.h:308
fl::unique_ptr< CRGB[]> mRGBWPixels
Internal buffer for packed RGBW data.
Definition chipsets.h:305
fl::CRGB CRGB
Definition crgb.h:25
To * bit_cast_ptr(void *storage) FL_NOEXCEPT
Definition bit_cast.h:60

References PixelController< RGB_ORDER, LANES, MASK >::advanceData(), fl::bit_cast_ptr(), DISABLE_DITHER, ensureBuffer(), fl::CLEDController::getRgbw(), PixelController< RGB_ORDER, LANES, MASK >::has(), PixelController< RGB_ORDER, LANES, MASK >::loadAndScaleRGBW(), mController, mRGBWPixels, rgbw, PixelController< RGB_ORDER, LANES, MASK >::size(), Rgbw::size_as_rgb(), and PixelController< RGB_ORDER, LANES, MASK >::stepDithering().

+ Here is the call graph for this function: