FastLED 3.9.15
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
pixelset.h
Go to the documentation of this file.
1#pragma once
2
3
4#include "fl/force_inline.h"
5#include "fl/namespace.h"
6#include "fl/unused.h"
7#include "fl/colorutils.h"
8
9#include "fl/fill.h"
10#include "fl/blur.h"
11
12#include "FastLED.h"
13
14#define FUNCTION_FILL_RAINBOW(a,b,c,d) fl::fill_rainbow(a,b,c,d)
15#define FUNCTION_NAPPLY_GAMMA(a,b,c) fl::napplyGamma_video(a,b,c)
16#define FUNCTION_NAPPLY_GAMMA_RGB(a,b,c,d,e) fl::napplyGamma_video(a,b,c,d,e)
17#define FUNCTION_BLUR1D(a,b,c) fl::blur1d(a,b,c)
18#define FUNCTION_FILL_GRADIENT(a,b,c,d,e) fl::fill_gradient(a,b,c,d,e)
19#define FUNCTION_FILL_GRADIENT3(a,b,c,d,e,f) fl::fill_gradient(a,b,c,d,e,f)
20#define FUNCTION_FILL_GRADIENT4(a,b,c,d,e,f,g) fl::fill_gradient(a,b,c,d,e,f,g)
21#define FUNCTION_NBLEND(a,b,c) fl::nblend(a,b,c)
22#define FUNCTION_FILL_GRADIENT_RGB(a,b,c,d) fl::fill_gradient_RGB(a,b,c,d)
23#define FUNCTION_FILL_GRADIENT_RGB3(a,b,c,d,e) fl::fill_gradient_RGB(a,b,c,d,e)
24#define FUNCTION_FILL_GRADIENT_RGB4(a,b,c,d,e,f) fl::fill_gradient_RGB(a,b,c,d,e,f)
25
26#ifndef abs
27#include <stdlib.h>
28#endif
29
30
31#include "fl/namespace.h"
32
34
35template<class PIXEL_TYPE>
36class CPixelView;
37
40
43CRGB *operator+(const CRGBSet & pixels, int offset);
44
45
48
49
53
58template<class PIXEL_TYPE>
60public:
61 const int8_t dir;
62 const int len;
64 PIXEL_TYPE * const leds;
65 PIXEL_TYPE * const end_pos;
66
67public:
69 inline CPixelView(const CPixelView & other) : dir(other.dir), len(other.len), leds(other.leds), end_pos(other.end_pos) {}
70
75 inline CPixelView(PIXEL_TYPE *_leds, int _len) : dir(_len < 0 ? -1 : 1), len(_len), leds(_leds), end_pos(_leds + _len) {}
76
82 inline CPixelView(PIXEL_TYPE *_leds, int _start, int _end) : dir(((_end-_start)<0) ? -1 : 1), len((_end - _start) + dir), leds(_leds + _start), end_pos(_leds + _start + len) {}
83
86 int size() { return abs(len); }
87
90 bool reversed() { return len < 0; }
91
93 bool operator==(const CPixelView & rhs) const { return leds == rhs.leds && len == rhs.len && dir == rhs.dir; }
94
96 bool operator!=(const CPixelView & rhs) const { return leds != rhs.leds || len != rhs.len || dir != rhs.dir; }
97
99 inline PIXEL_TYPE & operator[](int x) const { if(dir & 0x80) { return leds[-x]; } else { return leds[x]; } }
100
106 inline CPixelView operator()(int start, int end) { if(dir & 0x80) { return CPixelView(leds+len+1, -len-start-1, -len-end-1); } else { return CPixelView(leds, start, end); } }
107
108 // Access an inclusive subset of the LEDs in this set, starting from the first.
109 // @param end the last element for the new subset
110 // @todo Not sure i want this? inline CPixelView operator()(int end) { return CPixelView(leds, 0, end); }
111
113 inline CPixelView operator-() { return CPixelView(leds, len - dir, 0); }
114
116 inline operator PIXEL_TYPE* () const { return leds; }
117
120 inline CPixelView & operator=(const PIXEL_TYPE & color) {
121 for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel) = color; }
122 return *this;
123 }
124
127 void dump() const {
134 }
135
139 inline CPixelView & operator=(const CPixelView & rhs) {
140 for(iterator pixel = begin(), rhspixel = rhs.begin(), _end = end(), rhs_end = rhs.end(); (pixel != _end) && (rhspixel != rhs_end); ++pixel, ++rhspixel) {
141 (*pixel) = (*rhspixel);
142 }
143 return *this;
144 }
145
148
150 inline CPixelView & addToRGB(uint8_t inc) { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel) += inc; } return *this; }
152 inline CPixelView & operator+=(CPixelView & rhs) { for(iterator pixel = begin(), rhspixel = rhs.begin(), _end = end(), rhs_end = rhs.end(); (pixel != _end) && (rhspixel != rhs_end); ++pixel, ++rhspixel) { (*pixel) += (*rhspixel); } return *this; }
153
155 inline CPixelView & subFromRGB(uint8_t inc) { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel) -= inc; } return *this; }
157 inline CPixelView & operator-=(CPixelView & rhs) { for(iterator pixel = begin(), rhspixel = rhs.begin(), _end = end(), rhs_end = rhs.end(); (pixel != _end) && (rhspixel != rhs_end); ++pixel, ++rhspixel) { (*pixel) -= (*rhspixel); } return *this; }
158
160 inline CPixelView & operator++() { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel)++; } return *this; }
162 inline CPixelView & operator++(int DUMMY_ARG) {
163 FASTLED_UNUSED(DUMMY_ARG);
164 for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) {
165 (*pixel)++;
166 }
167 return *this;
168 }
169
171 inline CPixelView & operator--() { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel)--; } return *this; }
173 inline CPixelView & operator--(int DUMMY_ARG) {
174 FASTLED_UNUSED(DUMMY_ARG);
175 for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) {
176 (*pixel)--;
177 }
178 return *this;
179 }
180
182 inline CPixelView & operator/=(uint8_t d) { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel) /= d; } return *this; }
184 inline CPixelView & operator>>=(uint8_t d) { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel) >>= d; } return *this; }
186 inline CPixelView & operator*=(uint8_t d) { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel) *= d; } return *this; }
187
189 inline CPixelView & nscale8_video(uint8_t scaledown) { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel).nscale8_video(scaledown); } return *this;}
191 inline CPixelView & operator%=(uint8_t scaledown) { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel).nscale8_video(scaledown); } return *this; }
193 inline CPixelView & fadeLightBy(uint8_t fadefactor) { return nscale8_video(255 - fadefactor); }
194
196 inline CPixelView & nscale8(uint8_t scaledown) { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel).nscale8(scaledown); } return *this; }
198 inline CPixelView & nscale8(PIXEL_TYPE & scaledown) { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel).nscale8(scaledown); } return *this; }
200 inline CPixelView & nscale8(CPixelView & rhs) { for(iterator pixel = begin(), rhspixel = rhs.begin(), _end = end(), rhs_end = rhs.end(); (pixel != _end) && (rhspixel != rhs_end); ++pixel, ++rhspixel) { (*pixel).nscale8((*rhspixel)); } return *this; }
201
203 inline CPixelView & fadeToBlackBy(uint8_t fade) { return nscale8(255 - fade); }
204
208 inline CPixelView & operator|=(const PIXEL_TYPE & rhs) { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel) |= rhs; } return *this; }
211 inline CPixelView & operator|=(const CPixelView & rhs) { for(iterator pixel = begin(), rhspixel = rhs.begin(), _end = end(), rhs_end = rhs.end(); (pixel != _end) && (rhspixel != rhs_end); ++pixel, ++rhspixel) { (*pixel) |= (*rhspixel); } return *this; }
214 inline CPixelView & operator|=(uint8_t d) { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel) |= d; } return *this; }
215
219 inline CPixelView & operator&=(const PIXEL_TYPE & rhs) { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel) &= rhs; } return *this; }
222 inline CPixelView & operator&=(const CPixelView & rhs) { for(iterator pixel = begin(), rhspixel = rhs.begin(), _end = end(), rhs_end = rhs.end(); (pixel != _end) && (rhspixel != rhs_end); ++pixel, ++rhspixel) { (*pixel) &= (*rhspixel); } return *this; }
225 inline CPixelView & operator&=(uint8_t d) { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel) &= d; } return *this; }
226
228
229
231 inline operator bool() { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { if((*pixel)) return true; } return false; }
232
233
236
239 inline CPixelView & fill_solid(const PIXEL_TYPE & color) { *this = color; return *this; }
241 inline CPixelView & fill_solid(const CHSV & color) { *this = color; return *this; }
242
247 inline CPixelView & fill_rainbow(uint8_t initialhue, uint8_t deltahue=5) {
248 if(dir >= 0) {
249 FUNCTION_FILL_RAINBOW(leds,len,initialhue,deltahue);
250 } else {
251 FUNCTION_FILL_RAINBOW(leds + len + 1, -len, initialhue - deltahue * (len+1), -deltahue);
252 }
253 return *this;
254 }
255
261 inline CPixelView & fill_gradient(const CHSV & startcolor, const CHSV & endcolor, TGradientDirectionCode directionCode = fl::SHORTEST_HUES) {
262 if(dir >= 0) {
263 FUNCTION_FILL_GRADIENT(leds,len,startcolor, endcolor, directionCode);
264 } else {
265 FUNCTION_FILL_GRADIENT(leds + len + 1, (-len), endcolor, startcolor, directionCode);
266 }
267 return *this;
268 }
269
276 inline CPixelView & fill_gradient(const CHSV & c1, const CHSV & c2, const CHSV & c3, TGradientDirectionCode directionCode = fl::SHORTEST_HUES) {
277 if(dir >= 0) {
278 FUNCTION_FILL_GRADIENT3(leds, len, c1, c2, c3, directionCode);
279 } else {
280 FUNCTION_FILL_GRADIENT3(leds + len + 1, -len, c3, c2, c1, directionCode);
281 }
282 return *this;
283 }
284
292 inline CPixelView & fill_gradient(const CHSV & c1, const CHSV & c2, const CHSV & c3, const CHSV & c4, TGradientDirectionCode directionCode = fl::SHORTEST_HUES) {
293 if(dir >= 0) {
294 FUNCTION_FILL_GRADIENT4(leds, len, c1, c2, c3, c4, directionCode);
295 } else {
296 FUNCTION_FILL_GRADIENT4(leds + len + 1, -len, c4, c3, c2, c1, directionCode);
297 }
298 return *this;
299 }
300
306 inline CPixelView & fill_gradient_RGB(const PIXEL_TYPE & startcolor, const PIXEL_TYPE & endcolor, TGradientDirectionCode directionCode = fl::SHORTEST_HUES) {
307 FASTLED_UNUSED(directionCode); // TODO: why is this not used?
308 if(dir >= 0) {
309 FUNCTION_FILL_GRADIENT_RGB(leds,len,startcolor, endcolor);
310 } else {
311 FUNCTION_FILL_GRADIENT_RGB(leds + len + 1, (-len), endcolor, startcolor);
312 }
313 return *this;
314 }
315
321 inline CPixelView & fill_gradient_RGB(const PIXEL_TYPE & c1, const PIXEL_TYPE & c2, const PIXEL_TYPE & c3) {
322 if(dir >= 0) {
324 } else {
325 FUNCTION_FILL_GRADIENT_RGB3(leds + len + 1, -len, c3, c2, c1);
326 }
327 return *this;
328 }
329
336 inline CPixelView & fill_gradient_RGB(const PIXEL_TYPE & c1, const PIXEL_TYPE & c2, const PIXEL_TYPE & c3, const PIXEL_TYPE & c4) {
337 if(dir >= 0) {
338 FUNCTION_FILL_GRADIENT_RGB4(leds, len, c1, c2, c3, c4);
339 } else {
340 FUNCTION_FILL_GRADIENT_RGB4(leds + len + 1, -len, c4, c3, c2, c1);
341 }
342 return *this;
343 }
344
349 inline CPixelView & nblend(const PIXEL_TYPE & overlay, fract8 amountOfOverlay) { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { FUNCTION_NBLEND((*pixel), overlay, amountOfOverlay); } return *this; }
350
355 inline CPixelView & nblend(const CPixelView & rhs, fract8 amountOfOverlay) { for(iterator pixel = begin(), rhspixel = rhs.begin(), _end = end(), rhs_end = rhs.end(); (pixel != _end) && (rhspixel != rhs_end); ++pixel, ++rhspixel) { FUNCTION_NBLEND((*pixel), (*rhspixel), amountOfOverlay); } return *this; }
356
361 inline CPixelView & blur1d(fract8 blur_amount) {
362 if(dir >= 0) {
363 FUNCTION_BLUR1D(leds, len, blur_amount);
364 } else {
365 FUNCTION_BLUR1D(leds + len + 1, -len, blur_amount);
366 }
367 return *this;
368 }
369
373 inline CPixelView & napplyGamma_video(float gamma) {
374 if(dir >= 0) {
376 } else {
377 FUNCTION_NAPPLY_GAMMA(leds + len + 1, -len, gamma);
378 }
379 return *this;
380 }
381
387 inline CPixelView & napplyGamma_video(float gammaR, float gammaG, float gammaB) {
388 if(dir >= 0) {
389 FUNCTION_NAPPLY_GAMMA_RGB(leds, len, gammaR, gammaG, gammaB);
390 } else {
391 FUNCTION_NAPPLY_GAMMA_RGB(leds + len + 1, -len, gammaR, gammaG, gammaB);
392 }
393 return *this;
394 }
395
397
398
401
405 template <class T>
407 T * leds;
408 const int8_t dir;
409
410 public:
413
418 FASTLED_FORCE_INLINE pixelset_iterator_base(T * _leds, const char _dir) : leds(_leds), dir(_dir) {}
419
422
423 FASTLED_FORCE_INLINE bool operator==(pixelset_iterator_base & other) const { return leds == other.leds; /* && set==other.set; */ }
424 FASTLED_FORCE_INLINE bool operator!=(pixelset_iterator_base & other) const { return leds != other.leds; /* || set != other.set; */ }
425
426 FASTLED_FORCE_INLINE PIXEL_TYPE& operator*() const { return *leds; }
427 };
428
429 typedef pixelset_iterator_base<PIXEL_TYPE> iterator;
430 typedef pixelset_iterator_base<const PIXEL_TYPE> const_iterator;
431
432 iterator begin() { return iterator(leds, dir); }
433 iterator end() { return iterator(end_pos, dir); }
434
435 iterator begin() const { return iterator(leds, dir); }
436 iterator end() const { return iterator(end_pos, dir); }
437
440
442};
443
445CRGB *operator+(const CRGBSet & pixels, int offset) {
446 return (CRGB*)pixels + offset;
447}
448
449
452template<int SIZE>
453class CRGBArray : public CPixelView<CRGB> {
454 CRGB rawleds[SIZE] = {0};
455
456public:
458 using CPixelView::operator=;
459 CRGB* get() { return &rawleds[0]; }
460 const CRGB* get() const { return &rawleds[0]; }
461 size_t size() const { return SIZE; }
462};
463
465
467
468#undef FUNCTION_FILL_RAINBOW
469#undef FUNCTION_NAPPLY_GAMMA
470#undef FUNCTION_NAPPLY_GAMMA_RGB
471#undef FUNCTION_BLUR1D
472#undef FUNCTION_FILL_GRADIENT
473#undef FUNCTION_FILL_GRADIENT3
474#undef FUNCTION_FILL_GRADIENT4
475#undef FUNCTION_NBLEND
476#undef FUNCTION_FILL_GRADIENT_RGB
477#undef FUNCTION_FILL_GRADIENT_RGB3
478#undef FUNCTION_FILL_GRADIENT_RGB4
int x
Definition Audio.ino:71
central include file for FastLED, defines the CFastLED class/object
FASTLED_FORCE_INLINE bool operator==(pixelset_iterator_base &other) const
Check if iterator is at the same position.
Definition pixelset.h:423
FASTLED_FORCE_INLINE pixelset_iterator_base & operator++()
Increment LED pointer in data direction.
Definition pixelset.h:420
FASTLED_FORCE_INLINE pixelset_iterator_base operator++(int)
Increment LED pointer in data direction.
Definition pixelset.h:421
FASTLED_FORCE_INLINE pixelset_iterator_base(const pixelset_iterator_base &rhs)
Copy constructor.
Definition pixelset.h:412
FASTLED_FORCE_INLINE pixelset_iterator_base(T *_leds, const char _dir)
Base constructor.
Definition pixelset.h:418
FASTLED_FORCE_INLINE PIXEL_TYPE & operator*() const
Dereference operator, to get underlying pointer to the LEDs.
Definition pixelset.h:426
FASTLED_FORCE_INLINE bool operator!=(pixelset_iterator_base &other) const
Check if iterator is not at the same position.
Definition pixelset.h:424
CPixelView(PIXEL_TYPE *_leds, int _len)
PixelSet constructor for a pixel set starting at the given PIXEL_TYPE* and going for _len leds.
Definition pixelset.h:75
CPixelView & nscale8(PIXEL_TYPE &scaledown)
Scale every LED by the given scale.
Definition pixelset.h:198
CPixelView & operator&=(const CPixelView &rhs)
Apply the PIXEL_TYPE &= operator to every pixel in this set with every pixel in the passed in set.
Definition pixelset.h:222
CPixelView & operator-=(CPixelView &rhs)
Subtract every pixel in the other set from this set.
Definition pixelset.h:157
CPixelView & fill_gradient_RGB(const PIXEL_TYPE &c1, const PIXEL_TYPE &c2, const PIXEL_TYPE &c3, const PIXEL_TYPE &c4)
Fill all of the LEDs with a smooth RGB gradient between four RGB colors.
Definition pixelset.h:336
CPixelView & fill_rainbow(uint8_t initialhue, uint8_t deltahue=5)
Fill all of the LEDs with a rainbow of colors.
Definition pixelset.h:247
CPixelView & addToRGB(uint8_t inc)
Add the passed in value to all channels for all of the pixels in this set.
Definition pixelset.h:150
CRGB *const leds
Definition pixelset.h:64
CPixelView & nscale8_video(uint8_t scaledown)
Scale every LED by the given scale.
Definition pixelset.h:189
CPixelView & operator--()
Decrement every pixel value in this set.
Definition pixelset.h:171
const_iterator cbegin() const
Makes a const iterator instance for the start of the LED set, const qualified.
Definition pixelset.h:438
const_iterator cend() const
Makes a const iterator instance for the end of the LED set, const qualified.
Definition pixelset.h:439
CPixelView & fill_gradient(const CHSV &c1, const CHSV &c2, const CHSV &c3, TGradientDirectionCode directionCode=fl::SHORTEST_HUES)
Fill all of the LEDs with a smooth HSV gradient between three HSV colors.
Definition pixelset.h:276
CPixelView & operator*=(uint8_t d)
Multiply every LED in this set by the given value.
Definition pixelset.h:186
CPixelView & operator|=(const PIXEL_TYPE &rhs)
Apply the PIXEL_TYPE |= operator to every pixel in this set with the given PIXEL_TYPE value.
Definition pixelset.h:208
bool reversed()
Whether or not this set goes backwards.
Definition pixelset.h:90
CPixelView & fill_gradient(const CHSV &c1, const CHSV &c2, const CHSV &c3, const CHSV &c4, TGradientDirectionCode directionCode=fl::SHORTEST_HUES)
Fill all of the LEDs with a smooth HSV gradient between four HSV colors.
Definition pixelset.h:292
CPixelView & operator--(int DUMMY_ARG)
Decrement every pixel value in this set.
Definition pixelset.h:173
CPixelView & fill_solid(const CHSV &color)
Fill all of the LEDs with a solid color.
Definition pixelset.h:241
CPixelView & operator=(const CPixelView &rhs)
Copy the contents of the passed-in set to our set.
Definition pixelset.h:139
CPixelView & operator++(int DUMMY_ARG)
Increment every pixel value in this set.
Definition pixelset.h:162
iterator end()
Definition pixelset.h:433
CPixelView & operator+=(CPixelView &rhs)
Add every pixel in the other set to this set.
Definition pixelset.h:152
CPixelView & operator=(const PIXEL_TYPE &color)
Assign the passed in color to all elements in this set.
Definition pixelset.h:120
const int8_t dir
Definition pixelset.h:61
CPixelView & operator++()
Increment every pixel value in this set.
Definition pixelset.h:160
CPixelView & fill_gradient_RGB(const PIXEL_TYPE &c1, const PIXEL_TYPE &c2, const PIXEL_TYPE &c3)
Fill all of the LEDs with a smooth RGB gradient between three RGB colors.
Definition pixelset.h:321
void dump() const
Print debug data to serial, disabled for release.
Definition pixelset.h:127
CPixelView & blur1d(fract8 blur_amount)
One-dimensional blur filter.
Definition pixelset.h:361
CPixelView & fill_gradient(const CHSV &startcolor, const CHSV &endcolor, TGradientDirectionCode directionCode=fl::SHORTEST_HUES)
Fill all of the LEDs with a smooth HSV gradient between two HSV colors.
Definition pixelset.h:261
CPixelView & nblend(const PIXEL_TYPE &overlay, fract8 amountOfOverlay)
Destructively modifies all LEDs, blending in a given fraction of an overlay color.
Definition pixelset.h:349
CPixelView & operator&=(const PIXEL_TYPE &rhs)
Apply the PIXEL_TYPE &= operator to every pixel in this set with the given PIXEL_TYPE value.
Definition pixelset.h:219
CPixelView & operator%=(uint8_t scaledown)
Scale down every LED by the given scale.
Definition pixelset.h:191
pixelset_iterator_base< CRGB > iterator
Definition pixelset.h:429
CPixelView & operator/=(uint8_t d)
Divide every LED by the given value.
Definition pixelset.h:182
CPixelView & nscale8(uint8_t scaledown)
Scale every LED by the given scale.
Definition pixelset.h:196
CPixelView & operator>>=(uint8_t d)
Shift every LED in this set right by the given number of bits.
Definition pixelset.h:184
CPixelView operator()(int start, int end)
Access an inclusive subset of the LEDs in this set.
Definition pixelset.h:106
bool operator==(const CPixelView &rhs) const
Do these sets point to the same thing? Note that this is different from the contents of the set being...
Definition pixelset.h:93
CPixelView & napplyGamma_video(float gamma)
Destructively applies a gamma adjustment to all LEDs.
Definition pixelset.h:373
CPixelView & fadeToBlackBy(uint8_t fade)
Fade every LED down by the given scale.
Definition pixelset.h:203
CPixelView & operator|=(uint8_t d)
Apply the PIXEL_TYPE |= operator to every pixel in this set.
Definition pixelset.h:214
CRGB *const end_pos
Definition pixelset.h:65
PIXEL_TYPE & operator[](int x) const
Access a single element in this set, just like an array operator.
Definition pixelset.h:99
CPixelView & subFromRGB(uint8_t inc)
Subtract the passed in value from all channels for all of the pixels in this set.
Definition pixelset.h:155
CPixelView & fadeLightBy(uint8_t fadefactor)
Fade every LED down by the given scale.
Definition pixelset.h:193
CPixelView & operator|=(const CPixelView &rhs)
Apply the PIXEL_TYPE |= operator to every pixel in this set with every pixel in the passed in set.
Definition pixelset.h:211
pixelset_iterator_base< const CRGB > const_iterator
Definition pixelset.h:430
CPixelView & nscale8(CPixelView &rhs)
Scale every LED in this set by every led in the other set.
Definition pixelset.h:200
CPixelView operator-()
Return the reverse ordering of this set.
Definition pixelset.h:113
CPixelView & fill_solid(const PIXEL_TYPE &color)
Fill all of the LEDs with a solid color.
Definition pixelset.h:239
CPixelView(PIXEL_TYPE *_leds, int _start, int _end)
PixelSet constructor for the given set of LEDs, with start and end boundaries.
Definition pixelset.h:82
CPixelView & operator&=(uint8_t d)
Apply the PIXEL_TYPE &= operator to every pixel in this set with the passed in value.
Definition pixelset.h:225
bool operator!=(const CPixelView &rhs) const
Do these sets point to different things? Note that this is different from the contents of the set bei...
Definition pixelset.h:96
CPixelView & nblend(const CPixelView &rhs, fract8 amountOfOverlay)
Destructively blend another set of LEDs into this one.
Definition pixelset.h:355
iterator begin() const
Makes an iterator instance for the start of the LED set, const qualified.
Definition pixelset.h:435
iterator begin()
Makes an iterator instance for the start of the LED set.
Definition pixelset.h:432
CPixelView & fill_gradient_RGB(const PIXEL_TYPE &startcolor, const PIXEL_TYPE &endcolor, TGradientDirectionCode directionCode=fl::SHORTEST_HUES)
Fill all of the LEDs with a smooth RGB gradient between two RGB colors.
Definition pixelset.h:306
iterator end() const
Makes an iterator instance for the end of the LED set, const qualified.
Definition pixelset.h:436
const int len
Definition pixelset.h:62
CPixelView & napplyGamma_video(float gammaR, float gammaG, float gammaB)
Destructively applies a gamma adjustment to all LEDs.
Definition pixelset.h:387
CPixelView(const CPixelView &other)
PixelSet copy constructor.
Definition pixelset.h:69
int size()
Get the size of this set.
Definition pixelset.h:86
Represents a set of LED objects.
Definition pixelset.h:59
CRGB rawleds[SIZE]
the LED data
Definition pixelset.h:454
CRGB * get()
Definition pixelset.h:459
size_t size() const
Definition pixelset.h:461
const CRGB * get() const
Definition pixelset.h:460
TGradientDirectionCode
Hue direction for calculating fill gradients.
UISlider offset("Offset", 0.0f, 0.0f, 1.0f, 0.01f)
Utility functions for color fill, palettes, blending, and more.
#define FASTLED_FORCE_INLINE
Definition force_inline.h:6
uint8_t fract8
ANSI: unsigned short _Fract.
Definition types.h:36
FASTLED_FORCE_INLINE CRGB * operator+(const CRGBSet &pixels, int offset)
Retrieve a pointer to a CRGB array, using a CRGBSet and an LED offset.
Definition pixelset.h:445
#define FASTLED_NAMESPACE_END
Definition namespace.h:23
Implements the FastLED namespace macros.
@ SHORTEST_HUES
Hue goes whichever way is shortest.
#define FUNCTION_NBLEND(a, b, c)
Definition pixelset.h:21
#define FUNCTION_FILL_GRADIENT3(a, b, c, d, e, f)
Definition pixelset.h:19
#define FUNCTION_FILL_GRADIENT_RGB3(a, b, c, d, e)
Definition pixelset.h:23
#define FUNCTION_FILL_GRADIENT4(a, b, c, d, e, f, g)
Definition pixelset.h:20
#define FUNCTION_FILL_GRADIENT(a, b, c, d, e)
Definition pixelset.h:18
#define FUNCTION_FILL_GRADIENT_RGB(a, b, c, d)
Definition pixelset.h:22
#define FUNCTION_FILL_GRADIENT_RGB4(a, b, c, d, e, f)
Definition pixelset.h:24
#define FUNCTION_BLUR1D(a, b, c)
Definition pixelset.h:17
#define FUNCTION_NAPPLY_GAMMA_RGB(a, b, c, d, e)
Definition pixelset.h:16
#define FUNCTION_NAPPLY_GAMMA(a, b, c)
Definition pixelset.h:15
CPixelView< CRGB > CRGBSet
CPixelView for CRGB arrays.
Definition pixelset.h:39
#define FUNCTION_FILL_RAINBOW(a, b, c, d)
Definition pixelset.h:14
Representation of an HSV pixel (hue, saturation, value (aka brightness)).
Definition chsv.h:16
Representation of an RGB pixel (Red, Green, Blue)
Definition crgb.h:55
#define FASTLED_UNUSED(x)
Definition unused.h:3