FastLED 3.10.8
Loading...
Searching...
No Matches
fl::ChannelOptions Struct Reference

Detailed Description

Optional channel configuration parameters All fields have sensible defaults and can be overridden as needed.

Driver selection (#2459). mBus is the single typed selector:

  • Bus::AUTO (default) — let ChannelManager pick by priority dispatch.
  • Any other value — pin this channel to the named driver via ChannelManager::findDriverByName(busName(mBus)). If the named driver isn't registered, Channel::showPixels emits a one-shot FL_ERROR with the resolution hint (fl::enableDrivers<fl::Bus::X>() or FastLED.enableAllDrivers()) and falls back to AUTO/priority.

White-channel configuration (#2558). mWhiteCfg is a 3-way variant:

  • fl::Empty (default) — plain 3-channel RGB output, no white extraction. Replaces the legacy Rgbw{rgbw_mode=kRGBWInvalid} sentinel.
  • Rgbw — 4-channel RGBW output. Mode + CCT + optional shared colorimetric profile handle inside the Rgbw value.
  • Rgbww — 5-channel RGB + warm-W + cool-W output. Mode + two CCTs + optional profile pointer inside the Rgbww value.

setRgbw() / getRgbw() on CLEDController remain backward-compatible — they wrap the variant. New 5-channel callers use setRgbww()/getRgbww().

Custom / third-party / mock drivers whose names aren't in the fl::Bus enum should be bound either by priority (clear competing drivers via clearAllDrivers() and let the mock win priority dispatch) or via ChannelManager::setExclusiveDriverByName(name) for process-wide binding. There is no string-typed affinity field on ChannelOptions.

Examples
Sailboat.ino.

Definition at line 92 of file options.h.

#include <options.h>

+ Collaboration diagram for fl::ChannelOptions:

Public Member Functions

void clearColorProfile () FL_NO_EXCEPT
 
const EmitterProfile * emitterProfile () const FL_NO_EXCEPT
 
 FL_DEPRECATED ("Ask the channel: Channel::isColorManaged()") bool isColorManaged() const FL_NO_EXCEPT
 
bool hasColorProfile () const FL_NO_EXCEPT
 
bool hasTargetWhite () const FL_NO_EXCEPT
 
bool isRgbw () const FL_NO_EXCEPT
 True if this channel emits 4-channel RGBW.
 
bool isRgbww () const FL_NO_EXCEPT
 True if this channel emits 5-channel RGBWW.
 
void requestColorManagement (SourceProfile source=SourceProfile::linearSrgb()) FL_NO_EXCEPT
 
Rgbw rgbw () const FL_NO_EXCEPT
 
Rgbww rgbww () const FL_NO_EXCEPT
 
bool setColorProfile (const EmitterProfile &profile) FL_NO_EXCEPT
 
bool setColorProfile (const EmitterProfile &profile, SourceProfile source, bool global_source, GamutPolicy gamut=GamutPolicy::ChromaCompress) FL_NO_EXCEPT
 
bool setColorProfile (const EmitterProfile &profile, SourceProfile source, GamutPolicy gamut=GamutPolicy::ChromaCompress) FL_NO_EXCEPT
 
void setLegacyCorrection (CRGB correction) FL_NO_EXCEPT
 
void setLegacyTemperature (CRGB temperature) FL_NO_EXCEPT
 
bool setTargetWhite (Chromaticity white) FL_NO_EXCEPT
 
Chromaticity targetWhite () const FL_NO_EXCEPT
 

Static Public Member Functions

template<const EmitterProfile & Profile>
static ChannelOptions withColorProfile () FL_NO_EXCEPT
 

Public Attributes

Bus mBus = Bus::AUTO
 
fl::u8 mBusWhich = 0
 
CRGB mCorrection = UncorrectedColor
 
fl::u8 mDitherMode = BINARY_DITHER
 
fl::optional< float > mGamma
 
CRGB mTemperature = UncorrectedTemperature
 
fl::variant< fl::Empty, Rgbw, Rgbww > mWhiteCfg
 White-channel selection (variant): Empty = plain RGB, Rgbw = 4-channel, Rgbww = 5-channel.
 

Private Member Functions

void warnProfileCleared () FL_NO_EXCEPT
 

Static Private Member Functions

static bool finitePositive (float value) FL_NO_EXCEPT
 
static bool validChromaticity (Chromaticity xy) FL_NO_EXCEPT
 
static bool validChromaticity (const float xy[2]) FL_NO_EXCEPT
 
static bool validPrimaries (const RgbPrimaries &primaries) FL_NO_EXCEPT
 
static bool validResponseLut (const u16 *values, u16 size) FL_NO_EXCEPT
 

The documentation for this struct was generated from the following files: