MCPcopy Create free account
hub / github.com/FastLED/FastLED / applyWhiteCfg

Function applyWhiteCfg

src/fl/channels/channel.cpp.hpp:35–45  ·  view source on GitHub ↗

@brief Apply the white-channel selection from ChannelOptions to a CLEDController. The variant alternative chooses RGB-only / RGBW / RGBWW without forcing every call site to duplicate the dispatch.

Source from the content-addressed store, hash-verified

33/// CLEDController. The variant alternative chooses RGB-only / RGBW / RGBWW
34/// without forcing every call site to duplicate the dispatch.
35inline void applyWhiteCfg(CLEDController& ctrl,
36 const ChannelOptions& options) FL_NOEXCEPT {
37 if (auto* p = options.mWhiteCfg.ptr<Rgbww>()) {
38 ctrl.setRgbww(*p);
39 } else if (auto* p = options.mWhiteCfg.ptr<Rgbw>()) {
40 ctrl.setRgbw(*p);
41 } else {
42 // Empty alternative (or default-constructed) → plain RGB.
43 ctrl.clearWhiteChannel();
44 }
45}
46
47/// @brief Encapsulates pixel iterator construction with optional XYMap reordering
48class ReorderingPixelIteratorAny {

Callers 2

ChannelMethod · 0.85
applyConfigMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected