47#if FL_COLOR_PIPELINE_SHARED
71 template<const EmitterProfile& Profile>
74 FL_STATIC_ASSERT(&Profile ==
nullptr,
"Color profiles are unsupported on AVR");
77#if FL_COLOR_PROFILE_RUNTIME
80 rebound.
options.mColorProfile.mStaticProfile = &Profile;
81 rebound.
options.mColorProfile.mRequested =
true;
87#if FL_COLOR_PROFILE_RUNTIME
88 if (channel->reconcileColorProfile(rebound.
options)) {
89 events.onColorProfileFallback(
93 events.onChannelCreated(*channel);
96 template<ProfileId Id>
163#if FL_COLOR_PROFILE_RUNTIME
176#if FL_COLOR_PIPELINE_SHARED
227#if FL_COLOR_PROFILE_RUNTIME
228 return mPipeline !=
nullptr;
243#if FL_COLOR_PROFILE_RUNTIME
251#if FL_COLOR_PIPELINE_SHARED
262#if FL_COLOR_PROFILE_RUNTIME
263 return mColorProfileFallback;
269#if FL_COLOR_PROFILE_RUNTIME
270 return mProfileBindingAccepted;
276#if FL_COLOR_PROFILE_RUNTIME
318 template<typename T, typename... Args>
416#if FL_COLOR_PROFILE_RUNTIME
431 ColorPipelineStorage mPipeline;
469#if FL_COLOR_PROFILE_RUNTIME
481 void raiseColorProfileFallback(
const char* reason)
FL_NO_EXCEPT;
483 bool mColorProfileFallback =
false;
484 bool mProfileBindingAccepted =
true;
489 bool mWarnedColorProfileFallback =
false;
495template<const EmitterProfile& Profile>
501 FL_STATIC_ASSERT(&Profile ==
nullptr,
"Color profiles are unsupported on AVR");
508#if FL_COLOR_PROFILE_RUNTIME
fl::UISlider brightness("Brightness", BRIGHTNESS, 0, 255)
CLEDController * controller
Portable compile-time identifiers for LED channel buses.
CPixelLEDController(RegistrationMode mode) FL_NO_EXCEPT
bool getEnabled() FL_NO_EXCEPT
int getPin() const FL_NO_EXCEPT
Get the pin number for this channel (data pin)
static FL_NO_INLINE void encodeWS2801(Channel &, PixelIterator &, bool, fl::vector_psram< u8 > &) FL_NO_EXCEPT
int getClockPin() const FL_NO_EXCEPT
Get the clock pin for this channel (SPI only, -1 for clockless)
static FL_NO_INLINE void encodeSK9822(Channel &, PixelIterator &, bool, fl::vector_psram< u8 > &) FL_NO_EXCEPT
CRGB getTemperature() FL_NO_EXCEPT
Get the color temperature.
static i32 nextId() FL_NO_EXCEPT
void(*)(Channel &, PixelIterator &, bool, fl::vector_psram< u8 > &) PixelEncoder
u8 ditherPhase() const FL_NO_EXCEPT
Where this channel is in its dither cycle: the number of frames its driver has accepted,...
virtual ~Channel() FL_NO_EXCEPT
Destructor.
bool hasScreenMap() const FL_NO_EXCEPT
Check if screen map is configured.
void showPixels(PixelController< RGB, 1, 0xFFFFFFFF > &pixels) FL_NO_EXCEPT override
const Channel * asChannel() const FL_NO_EXCEPT override
bool isSpi() const FL_NO_EXCEPT
Check if this is an SPI chipset.
PixelEncoder mPixelEncoder
static FL_NO_INLINE void encodeWS2812(Channel &, PixelIterator &, bool, fl::vector_psram< u8 > &) FL_NO_EXCEPT
const CLEDController * asController() const FL_NO_EXCEPT
const SourceProfile & sourceProfile() const FL_NO_EXCEPT
bool isInDrawList() const FL_NO_EXCEPT
Check if this channel is in the controller draw list.
u8 mDitherPhase
This channel's temporal-dither phase.
const fl::string & name() const FL_NO_EXCEPT override
Get the channel name.
void showLeds(u8 brightness=255) FL_NO_EXCEPT OVERRIDE_IF_NOT_AVR
Show the LEDs with optional brightness scaling.
CRGB getCorrection() FL_NO_EXCEPT
Get the color correction.
fl::optional< float > getGamma() const FL_NO_EXCEPT
Get gamma correction value.
static fl::string makeName(i32 id, const fl::optional< fl::string > &configName=fl::optional< fl::string >()) FL_NO_EXCEPT
u8 getDither() FL_NO_EXCEPT
Get the dither mode.
const fl::ScreenMap & getScreenMap() const FL_NO_EXCEPT
Get the current screen map.
void removeFromDrawList() FL_NO_EXCEPT
Remove this channel from the global controller draw list.
bool isEnabled() const FL_NO_EXCEPT
fl::span< CRGB > leds() FL_NO_EXCEPT
Get the LED array as a span (non-const)
void onSettingsChanged(SettingsChange change) FL_NO_EXCEPT override
FL_NO_INLINE fl::shared_ptr< IChannelDriver > resolveDynamicDriver() FL_NO_EXCEPT
Cold slow-path helper for showPixels().
ChannelDataPtr mChannelData
static FL_NO_INLINE void encodeTM1908(Channel &, PixelIterator &, bool, fl::vector_psram< u8 > &) FL_NO_EXCEPT
friend class StaticProfileChannel
static PixelEncoder selectPixelEncoder(const ChipsetVariant &) FL_NO_EXCEPT
The chipset is fixed when a Channel is constructed, so bind its pixel encoder once instead of switchi...
Channel & setScreenMap(const fl::XYMap &map, float diameter=-1.f) FL_NO_EXCEPT
Set screen map for JS canvas visualization from XYMap.
int size() const FL_NO_EXCEPT OVERRIDE_IF_NOT_AVR
Get the number of LEDs in this channel.
FL_NO_INLINE bool waitForInUseBuffer() FL_NO_EXCEPT
Cold helper for showPixels() when mChannelData is still in use by the driver: warns and waits for REA...
static FL_NO_INLINE void encodeLPD6803(Channel &, PixelIterator &, bool, fl::vector_psram< u8 > &) FL_NO_EXCEPT
bool isClockless() const FL_NO_EXCEPT
Check if this is a clockless chipset.
static FL_NO_INLINE void encodeP9813(Channel &, PixelIterator &, bool, fl::vector_psram< u8 > &) FL_NO_EXCEPT
fl::string getEngineName() const FL_NO_EXCEPT
Get the name of the currently bound driver (if any)
static FL_NO_INLINE void encodeWS2803(Channel &, PixelIterator &, bool, fl::vector_psram< u8 > &) FL_NO_EXCEPT
static FL_NO_INLINE void encodeUCS7604(Channel &, PixelIterator &, bool, fl::vector_psram< u8 > &) FL_NO_EXCEPT
Channel(const ChipsetVariant &chipset, fl::span< CRGB > leds, EOrder rgbOrder, const ChannelOptions &options) FL_NO_EXCEPT
Private constructor (use create() factory method)
ColorProfileStatus colorProfileStatus() const FL_NO_EXCEPT
bool hasColorProfile() const FL_NO_EXCEPT
const EmitterProfile * emitterProfile() const FL_NO_EXCEPT
static ChannelPtr create(const ChannelConfig &config) FL_NO_EXCEPT
Create a new channel with optional mBus driver pinning.
CLEDController * asController() FL_NO_EXCEPT
Get pointer to base CLEDController for linked list traversal.
void syncLegacySettings() FL_NO_EXCEPT
FL_NO_INLINE void encodeFrame(PixelController< RGB, 1, 0xFFFFFFFF > &pixels) FL_NO_EXCEPT
Encode pixels into mChannelData and fire onChannelDataEncoded (#4566).
static FL_NO_INLINE void encodeTM1812RGBWW(Channel &, PixelIterator &, bool, fl::vector_psram< u8 > &) FL_NO_EXCEPT
static FL_NO_INLINE void encodeLPD8806(Channel &, PixelIterator &, bool, fl::vector_psram< u8 > &) FL_NO_EXCEPT
virtual const EmitterProfile * staticEmitterProfile() const FL_NO_EXCEPT
Rgbw getRgbw() const FL_NO_EXCEPT
Get the RGBW conversion mode.
Chromaticity targetWhite() const FL_NO_EXCEPT
Channel & setGamma(float gamma) FL_NO_EXCEPT
Set gamma correction value.
bool mDisabledDriverWarned
bool isColorManaged() const FL_NO_EXCEPT
True when the streaming transform is actually installed in the output path, which is not the same que...
const ChipsetTimingConfig & getTiming() const FL_NO_EXCEPT
Get the timing configuration for this channel (clockless only)
void init() FL_NO_EXCEPT override
Initialize the LED controller.
fl::weak_ptr< IChannelDriver > mDriver
static FL_NO_INLINE void encodeAPA102(Channel &, PixelIterator &, bool, fl::vector_psram< u8 > &) FL_NO_EXCEPT
friend fl::shared_ptr< T > fl::adl_barrier::make_shared(Args &&... args) FL_NO_EXCEPT
Friend declaration for make_shared to access private constructor.
EOrder getRgbOrder() const FL_NO_EXCEPT
Get the RGB channel ordering.
bool mStaticProfileCleared
static FL_NO_INLINE void encodeMY9221(Channel &, PixelIterator &, bool, fl::vector_psram< u8 > &) FL_NO_EXCEPT
void applyConfig(const ChannelConfig &config) FL_NO_EXCEPT
Apply reconfigurable settings from a ChannelConfig.
static ChannelPtr create(const ChannelConfig &config) FL_NO_EXCEPT
FL_NO_INLINE void submitFrame(const fl::shared_ptr< IChannelDriver > &driver) FL_NO_EXCEPT
Submit the encoded frame to driver: disabled-driver drop + one-shot diagnostic, enqueue,...
bool hasColorProfileFallback() const FL_NO_EXCEPT
void addToDrawList() FL_NO_EXCEPT
Add this channel to the global controller draw list.
const ChipsetVariant & getChipset() const FL_NO_EXCEPT
Get the chipset configuration variant.
static FL_NO_INLINE void encodeSM16716(Channel &, PixelIterator &, bool, fl::vector_psram< u8 > &) FL_NO_EXCEPT
bool profileBindingAccepted() const FL_NO_EXCEPT
static FL_NO_INLINE void encodeHD108(Channel &, PixelIterator &, bool, fl::vector_psram< u8 > &) FL_NO_EXCEPT
Transmission data for a single LED channel.
LED channel for parallel output, pretty much a CPixelLEDController but with timing and pin informatio...
IChannel() FL_NO_EXCEPT=default
Minimal interface for LED channel transmission drivers.
StaticProfileChannel(const ChannelConfig &config) FL_NO_EXCEPT
const EmitterProfile * staticEmitterProfile() const FL_NO_EXCEPT override
A compile-time profile channel.
#define OVERRIDE_IF_NOT_AVR
defines the templated version of the CLEDController class
Type-erased base for the templated Channel<Bus, Chipset> family.
shared_ptr< T > make_shared(Args &&... args) FL_NO_EXCEPT
SourceProfile & defaultSourceProfile() FL_NO_EXCEPT
u8 u8 fract8 blur_amount FL_NO_EXCEPT
void installColorPipelineHooks() FL_NO_EXCEPT
Point the hooks at the real implementations.
IChannelDriver * getStubChannelEngine() FL_NO_EXCEPT
Get stub channel driver for testing or unsupported platforms.
MapRedBlackTree< Key, T, Compare, fl::allocator_slab< char > > map
constexpr u32 gamma(float g) FL_NO_EXCEPT
fl::variant< ClocklessChipset, SpiChipsetConfig > ChipsetVariant
Bus
Portable public bus selector.
EOrder
RGB color channel orderings, used when instantiating controllers to determine what order the controll...
Base definition for an LED controller.
Payload shared by every color-profile notification.
#define FASTLED_SHARED_PTR(type)
#define FL_STATIC_ASSERT(...)
Representation of an 8-bit RGB pixel (Red, Green, Blue)
fl::optional< fl::string > mName
Optional user-specified name (if not set, Channel generates one automatically)
ChannelOptions options
Optional channel settings (correction, temperature, dither, rgbw, affinity)
fl::span< CRGB > mLeds
LED data array.
ChipsetVariant chipset
Chipset configuration (clockless or SPI)
EOrder rgb_order
RGB channel ordering.
Configuration for a single LED channel.
static ChannelEvents & instance() FL_NO_EXCEPT
void clearColorProfile() FL_NO_EXCEPT
Optional channel configuration parameters All fields have sensible defaults and can be overridden as ...
Runtime bit-period timing for a clockless chipset.
CIE 1931 xy chromaticity, independent of encoded storage and chipset.
Clockless chipset configuration (single data pin)
A source declaration, not a container or an output-device selection.
SPI chipset configuration (data + clock pins)