template<typename CONTROLLER,
EOrder RGB_ORDER = GRB>
class RGBWEmulatedController< CONTROLLER, RGB_ORDER >
Emulation layer to support RGBW LEDs on RGB controllers.
This template class allows you to use RGBW (4-channel) LED strips with controllers that only support RGB (3-channel) output. It works by:
- Creating an internal buffer to store the converted RGBW data
- Converting RGB color values to RGBW using configurable color conversion modes
- Packing the RGBW data (4 bytes per pixel) into RGB format (3 bytes) for transmission
- Sending the packed data to the underlying RGB controller
- Template Parameters
-
| CONTROLLER | The base RGB controller type (e.g., WS2812) |
| RGB_ORDER | The color channel ordering (e.g., GRB for WS2812) |
Usage Example:
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_GLOBAL_CONSTRUCTORS CFastLED FastLED
Global LED strip management instance.
CRGB * leds() FL_NO_EXCEPT
Pointer to the CRGB array for this controller.
RGBWEmulatedController(const Rgbw &rgbw=RgbwDefault()) FL_NO_EXCEPT
Constructor with optional RGBW configuration.
Color Conversion Modes (via Rgbw parameter):
- kRGBWExactColors: Preserves color accuracy, reduces max brightness
- kRGBWMaxBrightness: Maximizes brightness, may oversaturate colors
- kRGBWBoostedWhite: Boosts white channel for better whites
- kRGBWNullWhitePixel: Disables white channel (RGB mode only)
- Note
- The base CONTROLLER must use RGB ordering (no internal reordering). Color channel reordering is handled by this wrapper class via RGB_ORDER.
Definition at line 194 of file chipsets.h.
|
| | RGBWEmulatedController (const Rgbw &rgbw=RgbwDefault()) FL_NO_EXCEPT |
| | Constructor with optional RGBW configuration.
|
| |
| | ~RGBWEmulatedController ()=default |
| | Destructor - cleans up the internal RGBW buffer.
|
| |
| VIRTUAL_IF_NOT_AVR void * | beginShowLeds (int size) FL_NO_EXCEPT OVERRIDE_IF_NOT_AVR |
| |
| VIRTUAL_IF_NOT_AVR void | endShowLeds (void *data) FL_NO_EXCEPT OVERRIDE_IF_NOT_AVR |
| |
| | FL_STATIC_ASSERT (RGB==CONTROLLER::RGB_ORDER_VALUE, "The delegated controller MUST NOT do reordering") |
| |
| virtual void | showPixels (PixelController< RGB_ORDER, LANES, MASK > &pixels) FL_NO_EXCEPT override |
| | Main rendering function that converts RGB to RGBW and shows pixels.
|
| |
| | CPixelLEDController () FL_NO_EXCEPT |
| |
| int | lanes () FL_NO_EXCEPT override |
| | Get the number of lanes of the Controller.
|
| |
| | CLEDController () FL_NO_EXCEPT |
| | Create an led controller object, add it to the chain of controllers.
|
| |
| VIRTUAL_IF_NOT_AVR | ~CLEDController () FL_NO_EXCEPT |
| |
| void | addToList () FL_NO_EXCEPT |
| | Add this controller to the linked list.
|
| |
| virtual const Channel * | asChannel () const FL_NO_EXCEPT |
| |
| VIRTUAL_IF_NOT_AVR void * | beginShowLeds (int size) FL_NO_EXCEPT |
| |
| void | clearLedDataInternal (int nLeds=-1) FL_NO_EXCEPT |
| | Zero out the LED data managed by this controller.
|
| |
| VIRTUAL_IF_NOT_AVR void | clearLeds (int nLeds=-1) FL_NO_EXCEPT |
| | Clear out/zero out the given number of LEDs.
|
| |
| CLEDController & | clearWhiteChannel () FL_NO_EXCEPT |
| | Reset this channel to plain 3-channel RGB (clears any RGBW/RGBWW configuration).
|
| |
| VIRTUAL_IF_NOT_AVR void | endShowLeds (void *data) FL_NO_EXCEPT |
| |
| CRGB | getAdjustment (fl::u8 scale) FL_NO_EXCEPT |
| | Get the combined brightness/color adjustment for this controller.
|
| |
| ColorAdjustment | getAdjustmentData (fl::u8 brightness) FL_NO_EXCEPT |
| |
| CRGB | getCorrection () FL_NO_EXCEPT |
| | Get the correction value used by this controller.
|
| |
| fl::u8 | getDither () const FL_NO_EXCEPT |
| | Get the dithering option currently set for this controller.
|
| |
| bool | getEnabled () FL_NO_EXCEPT |
| |
| virtual fl::u16 | getMaxRefreshRate () const FL_NO_EXCEPT |
| | Gets the maximum possible refresh rate of the strip.
|
| |
| Rgbw | getRgbw () const FL_NO_EXCEPT |
| |
| Rgbww | getRgbww () const FL_NO_EXCEPT |
| |
| CRGB | getTemperature () FL_NO_EXCEPT |
| | Get the color temperature, aka white point, for this controller.
|
| |
| bool | isInList () const FL_NO_EXCEPT |
| | Check if this controller is in the linked list.
|
| |
| const CRGB * | leds () const FL_NO_EXCEPT |
| | Const pointer to the CRGB array for this controller.
|
| |
| CRGB * | leds () FL_NO_EXCEPT |
| | Pointer to the CRGB array for this controller.
|
| |
| fl::span< CRGB > | ledsSpan () FL_NO_EXCEPT |
| | Span of LEDs managed by this controller.
|
| |
| const CLEDController * | next () const FL_NO_EXCEPT |
| | Get the next controller in the linked list after this one (const version).
|
| |
| CLEDController * | next () FL_NO_EXCEPT |
| | Get the next controller in the linked list after this one.
|
| |
| CRGB & | operator[] (int x) FL_NO_EXCEPT |
| | Reference to the n'th LED managed by the controller.
|
| |
| void | removeFromDrawList () FL_NO_EXCEPT |
| | Remove this controller from the draw list.
|
| |
| const Rgbw * | rgbwConfig () const FL_NO_EXCEPT |
| |
| CLEDController & | setCorrection (CRGB correction) FL_NO_EXCEPT |
| | The color corrction to use for this controller, expressed as a CRGB object.
|
| |
| CLEDController & | setCorrection (LEDColorCorrection correction) FL_NO_EXCEPT |
| | The color corrction to use for this controller, expressed as a CRGB object.
|
| |
| CLEDController & | setDither (fl::u8 ditherMode=BINARY_DITHER) FL_NO_EXCEPT |
| | Set the dithering mode for this controller to use.
|
| |
| void | setEnabled (bool enabled) FL_NO_EXCEPT |
| |
| CLEDController & | setLeds (CRGB *data, int nLeds) FL_NO_EXCEPT |
| | Set the default array of LEDs to be used by this controller.
|
| |
| CLEDController & | setLeds (fl::span< CRGB > leds) FL_NO_EXCEPT |
| | Set the default array of LEDs to be used by this controller (span version)
|
| |
| CLEDController & | setRgbw (const Rgbw &arg=RgbwDefault::value()) FL_NO_EXCEPT |
| |
| CLEDController & | setRgbww (const Rgbww &arg=RgbwwDefault::value()) FL_NO_EXCEPT |
| | Configure this channel for 5-channel RGBWW (RGB + warm-W + cool-W) output.
|
| |
| CLEDController & | setScreenMap (const fl::ScreenMap &map) FL_NO_EXCEPT |
| |
| CLEDController & | setScreenMap (const fl::XYMap &map, float diameter=-1.f) FL_NO_EXCEPT |
| |
| CLEDController & | setScreenMap (fl::u16 width, fl::u16 height, float diameter=-1.f) FL_NO_EXCEPT |
| |
| CLEDController & | setSpiBus (Esp32SpiBus bus) FL_NO_EXCEPT |
| | Select an ESP-IDF SPI host for this clocked controller before init().
|
| |
| CLEDController & | setTemperature (ColorTemperature temperature) FL_NO_EXCEPT |
| | Set the color temperature, aka white point, for this controller.
|
| |
| CLEDController & | setTemperature (CRGB temperature) FL_NO_EXCEPT |
| | Set the color temperature, aka white point, for this controller.
|
| |
| void | showColorInternal (const CRGB &data, fl::u8 brightness) FL_NO_EXCEPT |
| |
| void | showColorInternal (const CRGB &data, int nLeds, fl::u8 brightness) FL_NO_EXCEPT |
| |
| void | showInternal (const CRGB *data, int nLeds, fl::u8 brightness) FL_NO_EXCEPT |
| |
| VIRTUAL_IF_NOT_AVR void | showLeds (fl::u8 brightness) FL_NO_EXCEPT |
| |
| void | showLedsInternal (fl::u8 brightness) FL_NO_EXCEPT |
| | Write the data to the LEDs managed by this controller.
|
| |
| VIRTUAL_IF_NOT_AVR int | size () const FL_NO_EXCEPT |
| | How many LEDs does this controller manage?
|
| |