FastLED 3.10.8
Loading...
Searching...
No Matches
pixel_iterator_any.h
Go to the documentation of this file.
1
3
4#pragma once
5
7#include "pixel_controller.h"
8#include "fl/stl/optional.h"
9#include "fl/stl/vector.h"
10#include "rgbw.h"
11#include "fl/gfx/rgbww.h"
12
13namespace fl {
14
15// Forward declarations
16class XYMap;
17
18
19
25 public:
35
36 template<typename PIXEL_CONTROLLER>
37 PixelIteratorAny(PIXEL_CONTROLLER &controller, EOrder newOrder, Rgbw rgbw,
39 : mController(controller), // Normalize to RGB order (#2558).
40 mOrder(newOrder), mRgbw(rgbw), mRgbww(rgbww) {
42 }
43
46 const PixelIterator& get() const FL_NO_EXCEPT { return *mPixelIterator; }
47
49 operator PixelIterator&() FL_NO_EXCEPT { return *mPixelIterator; }
50
56
67 : mController(other.mController), mOrder(other.mOrder),
68 mRgbw(other.mRgbw), mRgbww(other.mRgbww), mXyMap(other.mXyMap) {
70 }
71
73 : mController(other.mController), mOrder(other.mOrder),
74 mRgbw(other.mRgbw), mRgbww(other.mRgbww), mXyMap(fl::move(other.mXyMap)) {
76 }
77
79 if (this != &other) {
80 mController = other.mController;
81 mOrder = other.mOrder;
82 mRgbw = other.mRgbw;
83 mRgbww = other.mRgbww;
84 mXyMap = other.mXyMap;
86 }
87 return *this;
88 }
89
91 if (this != &other) {
92 mController = other.mController;
93 mOrder = other.mOrder;
94 mRgbw = other.mRgbw;
95 mRgbww = other.mRgbww;
96 mXyMap = fl::move(other.mXyMap);
98 }
99 return *this;
100 }
101
102 private:
119
122
123 // fl::optional used just as a way to defer construction.
125
128
129 // XYMap for pixel addressing (optional) - contains embedded width/height
131};
132
133} // namespace fl
XYMap xymap
CLEDController * controller
Rgbw rgbw
PixelController< RGB > mController
void setXYMap(const fl::shared_ptr< const XYMap > &xymap) FL_NO_EXCEPT
Set XYMap for pixel addressing.
PixelIteratorAny(PixelController< RGB > &controller, EOrder newOrder, Rgbw rgbw, Rgbww rgbww=RgbwwInvalid::value()) FL_NO_EXCEPT
Construct adapter with color order conversion.
PixelIteratorAny(PIXEL_CONTROLLER &controller, EOrder newOrder, Rgbw rgbw, Rgbww rgbww=RgbwwInvalid::value()) FL_NO_EXCEPT
void bindIterator() FL_NO_EXCEPT
Point mPixelIterator at this object's own controller.
fl::Optional< PixelIterator > mPixelIterator
PixelIterator & get() FL_NO_EXCEPT
Get the type-erased PixelIterator.
PixelIteratorAny(const PixelIteratorAny &other) FL_NO_EXCEPT
Copy: the iterator must be re-aimed, not copied.
const PixelIterator & get() const FL_NO_EXCEPT
PixelIteratorAny & operator=(const PixelIteratorAny &other) FL_NO_EXCEPT
fl::shared_ptr< const XYMap > mXyMap
PixelIteratorAny(PixelIteratorAny &&other) FL_NO_EXCEPT
PixelIteratorAny & operator=(PixelIteratorAny &&other) FL_NO_EXCEPT
Non-templated low level pixel data writing class.
Functions for red, green, blue, white (RGBW) output.
constexpr remove_reference< T >::type && move(T &&t) FL_NO_EXCEPT
Definition move.h:30
u8 u8 fract8 blur_amount FL_NO_EXCEPT
Definition blur.h:186
EOrder
RGB color channel orderings, used when instantiating controllers to determine what order the controll...
Definition eorder.h:15
Base definition for an LED controller.
Definition crgb.hpp:179
Low level pixel data writing class.
fl::PixelIterator PixelIterator
5-channel RGB + warm-W + cool-W (RGBWW / RGBCCT) configuration types (issue #2558,...
Pixel controller class.
static Rgbww value() FL_NO_EXCEPT
Definition rgbww.h:111