FastLED 3.10.6
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 245 of file chipsets.h.

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