FastLED 3.9.15
Loading...
Searching...
No Matches
options.h
Go to the documentation of this file.
1#pragma once
2
3#include "led_sysdefs.h" // IWYU pragma: keep
4#include "pixeltypes.h" // IWYU pragma: keep
5#include "color.h"
6#include "dither_mode.h"
7#include "fl/channels/bus.h"
8#include "rgbw.h" // IWYU pragma: keep
9#include "fl/gfx/rgbww.h" // IWYU pragma: keep
10#include "fl/stl/optional.h"
11#include "fl/stl/variant.h"
12
13namespace fl {
14
49 fl::variant<fl::Empty, Rgbw, Rgbww> mWhiteCfg;
50 Bus mBus = Bus::AUTO; // Typed driver selection
51 fl::optional<float> mGamma; // Gamma correction (nullopt = use default 2.8)
52
56 if (auto* p = mWhiteCfg.ptr<Rgbw>()) return *p;
57 return RgbwInvalid::value();
58 }
59
62 if (auto* p = mWhiteCfg.ptr<Rgbww>()) return *p;
63 return RgbwwInvalid::value();
64 }
65
70 bool isRgbw() const FL_NOEXCEPT {
71 auto* p = mWhiteCfg.ptr<Rgbw>();
72 return p != nullptr && p->active();
73 }
74
76 bool isRgbww() const FL_NOEXCEPT {
77 auto* p = mWhiteCfg.ptr<Rgbww>();
78 return p != nullptr && p->active();
79 }
80};
81
82} // namespace fl
Compile-time identifier for an LED channel transmission bus.
#define BINARY_DITHER
Enable dithering using binary dithering (only option)
Definition dither_mode.h:12
Declares dithering options and types.
@ UncorrectedTemperature
Uncorrected temperature (0xFFFFFF)
Definition color.h:90
@ UncorrectedColor
Uncorrected color (0xFFFFFF)
Definition color.h:24
Determines which platform system definitions to include.
unsigned char u8
Definition s16x16x4.h:132
Optional< T > optional
Definition optional.h:16
Bus
Driver identifier for compile-time bus selection.
Definition bus.h:60
@ AUTO
Sentinel: defer to DefaultBus<Chipset>::value.
Definition bus.h:61
Base definition for an LED controller.
Definition crgb.hpp:179
Includes defintions for RGB and HSV pixels.
5-channel RGB + warm-W + cool-W (RGBWW / RGBCCT) configuration types (issue #2558,...
#define FL_NOEXCEPT
Representation of an 8-bit RGB pixel (Red, Green, Blue)
Definition crgb.h:38
fl::optional< float > mGamma
Definition options.h:51
fl::variant< fl::Empty, Rgbw, Rgbww > mWhiteCfg
White-channel selection (variant): Empty = plain RGB, Rgbw = 4-channel, Rgbww = 5-channel.
Definition options.h:49
bool isRgbw() const FL_NOEXCEPT
True if this channel emits 4-channel RGBW.
Definition options.h:70
fl::u8 mDitherMode
Definition options.h:46
Rgbww rgbww() const FL_NOEXCEPT
Definition options.h:61
Rgbw rgbw() const FL_NOEXCEPT
Definition options.h:55
bool isRgbww() const FL_NOEXCEPT
True if this channel emits 5-channel RGBWW.
Definition options.h:76
Optional channel configuration parameters All fields have sensible defaults and can be overridden as ...
Definition options.h:43
FASTLED_FORCE_INLINE bool active() const FL_NOEXCEPT
Definition rgbw.h:182
static Rgbw value() FL_NOEXCEPT
Definition rgbw.h:203
FASTLED_FORCE_INLINE bool active() const FL_NOEXCEPT
Definition rgbww.h:79
Per-strip RGBWW configuration.
Definition rgbww.h:60
static Rgbww value() FL_NOEXCEPT
Definition rgbww.h:90