FastLED 3.9.15
Loading...
Searching...
No Matches
pixelset.h
Go to the documentation of this file.
1#pragma once
2
3#include "FastLED.h"
4#include "fl/force_inline.h"
5#include "fl/unused.h"
6
7
8#if FASTLED_IS_USING_NAMESPACE
9#define FUNCTION_FILL_RAINBOW(a,b,c,d) FASTLED_NAMESPACE::fill_rainbow(a,b,c,d)
10#define FUNCTION_NAPPLY_GAMMA(a,b,c) FASTLED_NAMESPACE::napplyGamma_video(a,b,c)
11#define FUNCTION_NAPPLY_GAMMA_RGB(a,b,c,d,e) FASTLED_NAMESPACE::napplyGamma_video(a,b,c,d,e)
12#define FUNCTION_BLUR1D(a,b,c) FASTLED_NAMESPACE::blur1d(a,b,c)
13#define FUNCTION_FILL_GRADIENT(a,b,c,d,e) FASTLED_NAMESPACE::fill_gradient(a,b,c,d,e)
14#define FUNCTION_FILL_GRADIENT3(a,b,c,d,e,f) FASTLED_NAMESPACE::fill_gradient(a,b,c,d,e,f)
15#define FUNCTION_FILL_GRADIENT4(a,b,c,d,e,f,g) FASTLED_NAMESPACE::fill_gradient(a,b,c,d,e,f,g)
16#define FUNCTION_NBLEND(a,b,c) FASTLED_NAMESPACE::nblend(a,b,c)
17#define FUNCTION_FILL_GRADIENT_RGB(a,b,c,d) FASTLED_NAMESPACE::fill_gradient_RGB(a,b,c,d)
18#define FUNCTION_FILL_GRADIENT_RGB3(a,b,c,d,e) FASTLED_NAMESPACE::fill_gradient_RGB(a,b,c,d,e)
19#define FUNCTION_FILL_GRADIENT_RGB4(a,b,c,d,e,f) FASTLED_NAMESPACE::fill_gradient_RGB(a,b,c,d,e,f)
20#else
21#define FUNCTION_FILL_RAINBOW(a,b,c,d) ::fill_rainbow(a,b,c,d)
22#define FUNCTION_NAPPLY_GAMMA(a,b,c) ::napplyGamma_video(a,b,c)
23#define FUNCTION_NAPPLY_GAMMA_RGB(a,b,c,d,e) ::napplyGamma_video(a,b,c,d,e)
24#define FUNCTION_BLUR1D(a,b,c) ::blur1d(a,b,c)
25#define FUNCTION_FILL_GRADIENT(a,b,c,d,e) ::fill_gradient(a,b,c,d,e)
26#define FUNCTION_FILL_GRADIENT3(a,b,c,d,e,f) ::fill_gradient(a,b,c,d,e,f)
27#define FUNCTION_FILL_GRADIENT4(a,b,c,d,e,f,g) ::fill_gradient(a,b,c,d,e,f,g)
28#define FUNCTION_NBLEND(a,b,c) ::nblend(a,b,c)
29#define FUNCTION_FILL_GRADIENT_RGB(a,b,c,d) ::fill_gradient_RGB(a,b,c,d)
30#define FUNCTION_FILL_GRADIENT_RGB3(a,b,c,d,e) ::fill_gradient_RGB(a,b,c,d,e)
31#define FUNCTION_FILL_GRADIENT_RGB4(a,b,c,d,e,f) ::fill_gradient_RGB(a,b,c,d,e,f)
32#endif
33
34#ifndef abs
35#include <stdlib.h>
36#endif
37
38
39#include "fl/namespace.h"
40
42
43template<class PIXEL_TYPE>
44class CPixelView;
45
48
51CRGB *operator+(const CRGBSet & pixels, int offset);
52
53
56
57
61
66template<class PIXEL_TYPE>
68public:
69 const int8_t dir;
70 const int len;
72 PIXEL_TYPE * const leds;
73 PIXEL_TYPE * const end_pos;
74
75public:
77 inline CPixelView(const CPixelView & other) : dir(other.dir), len(other.len), leds(other.leds), end_pos(other.end_pos) {}
78
83 inline CPixelView(PIXEL_TYPE *_leds, int _len) : dir(_len < 0 ? -1 : 1), len(_len), leds(_leds), end_pos(_leds + _len) {}
84
90 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) {}
91
94 int size() { return abs(len); }
95
98 bool reversed() { return len < 0; }
99
101 bool operator==(const CPixelView & rhs) const { return leds == rhs.leds && len == rhs.len && dir == rhs.dir; }
102
104 bool operator!=(const CPixelView & rhs) const { return leds != rhs.leds || len != rhs.len || dir != rhs.dir; }
105
107 inline PIXEL_TYPE & operator[](int x) const { if(dir & 0x80) { return leds[-x]; } else { return leds[x]; } }
108
114 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); } }
115
116 // Access an inclusive subset of the LEDs in this set, starting from the first.
117 // @param end the last element for the new subset
118 // @todo Not sure i want this? inline CPixelView operator()(int end) { return CPixelView(leds, 0, end); }
119
121 inline CPixelView operator-() { return CPixelView(leds, len - dir, 0); }
122
124 inline operator PIXEL_TYPE* () const { return leds; }
125
128 inline CPixelView & operator=(const PIXEL_TYPE & color) {
129 for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel) = color; }
130 return *this;
131 }
132
135 void dump() const {
142 }
143
147 inline CPixelView & operator=(const CPixelView & rhs) {
148 for(iterator pixel = begin(), rhspixel = rhs.begin(), _end = end(), rhs_end = rhs.end(); (pixel != _end) && (rhspixel != rhs_end); ++pixel, ++rhspixel) {
149 (*pixel) = (*rhspixel);
150 }
151 return *this;
152 }
153
156
158 inline CPixelView & addToRGB(uint8_t inc) { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel) += inc; } return *this; }
160 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; }
161
163 inline CPixelView & subFromRGB(uint8_t inc) { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel) -= inc; } return *this; }
165 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; }
166
168 inline CPixelView & operator++() { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel)++; } return *this; }
170 inline CPixelView & operator++(int DUMMY_ARG) {
171 FASTLED_UNUSED(DUMMY_ARG);
172 for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) {
173 (*pixel)++;
174 }
175 return *this;
176 }
177
179 inline CPixelView & operator--() { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel)--; } return *this; }
181 inline CPixelView & operator--(int DUMMY_ARG) {
182 FASTLED_UNUSED(DUMMY_ARG);
183 for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) {
184 (*pixel)--;
185 }
186 return *this;
187 }
188
190 inline CPixelView & operator/=(uint8_t d) { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel) /= d; } return *this; }
192 inline CPixelView & operator>>=(uint8_t d) { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel) >>= d; } return *this; }
194 inline CPixelView & operator*=(uint8_t d) { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel) *= d; } return *this; }
195
197 inline CPixelView & nscale8_video(uint8_t scaledown) { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel).nscale8_video(scaledown); } return *this;}
199 inline CPixelView & operator%=(uint8_t scaledown) { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel).nscale8_video(scaledown); } return *this; }
201 inline CPixelView & fadeLightBy(uint8_t fadefactor) { return nscale8_video(255 - fadefactor); }
202
204 inline CPixelView & nscale8(uint8_t scaledown) { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel).nscale8(scaledown); } return *this; }
206 inline CPixelView & nscale8(PIXEL_TYPE & scaledown) { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel).nscale8(scaledown); } return *this; }
208 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; }
209
211 inline CPixelView & fadeToBlackBy(uint8_t fade) { return nscale8(255 - fade); }
212
216 inline CPixelView & operator|=(const PIXEL_TYPE & rhs) { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel) |= rhs; } return *this; }
219 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; }
222 inline CPixelView & operator|=(uint8_t d) { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel) |= d; } return *this; }
223
227 inline CPixelView & operator&=(const PIXEL_TYPE & rhs) { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel) &= rhs; } return *this; }
230 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; }
233 inline CPixelView & operator&=(uint8_t d) { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel) &= d; } return *this; }
234
236
237
239 inline operator bool() { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { if((*pixel)) return true; } return false; }
240
241
244
247 inline CPixelView & fill_solid(const PIXEL_TYPE & color) { *this = color; return *this; }
249 inline CPixelView & fill_solid(const CHSV & color) { *this = color; return *this; }
250
255 inline CPixelView & fill_rainbow(uint8_t initialhue, uint8_t deltahue=5) {
256 if(dir >= 0) {
257 FUNCTION_FILL_RAINBOW(leds,len,initialhue,deltahue);
258 } else {
259 FUNCTION_FILL_RAINBOW(leds + len + 1, -len, initialhue - deltahue * (len+1), -deltahue);
260 }
261 return *this;
262 }
263
269 inline CPixelView & fill_gradient(const CHSV & startcolor, const CHSV & endcolor, TGradientDirectionCode directionCode = SHORTEST_HUES) {
270 if(dir >= 0) {
271 FUNCTION_FILL_GRADIENT(leds,len,startcolor, endcolor, directionCode);
272 } else {
273 FUNCTION_FILL_GRADIENT(leds + len + 1, (-len), endcolor, startcolor, directionCode);
274 }
275 return *this;
276 }
277
284 inline CPixelView & fill_gradient(const CHSV & c1, const CHSV & c2, const CHSV & c3, TGradientDirectionCode directionCode = SHORTEST_HUES) {
285 if(dir >= 0) {
286 FUNCTION_FILL_GRADIENT3(leds, len, c1, c2, c3, directionCode);
287 } else {
288 FUNCTION_FILL_GRADIENT3(leds + len + 1, -len, c3, c2, c1, directionCode);
289 }
290 return *this;
291 }
292
300 inline CPixelView & fill_gradient(const CHSV & c1, const CHSV & c2, const CHSV & c3, const CHSV & c4, TGradientDirectionCode directionCode = SHORTEST_HUES) {
301 if(dir >= 0) {
302 FUNCTION_FILL_GRADIENT4(leds, len, c1, c2, c3, c4, directionCode);
303 } else {
304 FUNCTION_FILL_GRADIENT4(leds + len + 1, -len, c4, c3, c2, c1, directionCode);
305 }
306 return *this;
307 }
308
314 inline CPixelView & fill_gradient_RGB(const PIXEL_TYPE & startcolor, const PIXEL_TYPE & endcolor, TGradientDirectionCode directionCode = SHORTEST_HUES) {
315 FASTLED_UNUSED(directionCode); // TODO: why is this not used?
316 if(dir >= 0) {
317 FUNCTION_FILL_GRADIENT_RGB(leds,len,startcolor, endcolor);
318 } else {
319 FUNCTION_FILL_GRADIENT_RGB(leds + len + 1, (-len), endcolor, startcolor);
320 }
321 return *this;
322 }
323
329 inline CPixelView & fill_gradient_RGB(const PIXEL_TYPE & c1, const PIXEL_TYPE & c2, const PIXEL_TYPE & c3) {
330 if(dir >= 0) {
332 } else {
333 FUNCTION_FILL_GRADIENT_RGB3(leds + len + 1, -len, c3, c2, c1);
334 }
335 return *this;
336 }
337
344 inline CPixelView & fill_gradient_RGB(const PIXEL_TYPE & c1, const PIXEL_TYPE & c2, const PIXEL_TYPE & c3, const PIXEL_TYPE & c4) {
345 if(dir >= 0) {
346 FUNCTION_FILL_GRADIENT_RGB4(leds, len, c1, c2, c3, c4);
347 } else {
348 FUNCTION_FILL_GRADIENT_RGB4(leds + len + 1, -len, c4, c3, c2, c1);
349 }
350 return *this;
351 }
352
357 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; }
358
363 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; }
364
369 inline CPixelView & blur1d(fract8 blur_amount) {
370 if(dir >= 0) {
371 FUNCTION_BLUR1D(leds, len, blur_amount);
372 } else {
373 FUNCTION_BLUR1D(leds + len + 1, -len, blur_amount);
374 }
375 return *this;
376 }
377
381 inline CPixelView & napplyGamma_video(float gamma) {
382 if(dir >= 0) {
384 } else {
385 FUNCTION_NAPPLY_GAMMA(leds + len + 1, -len, gamma);
386 }
387 return *this;
388 }
389
395 inline CPixelView & napplyGamma_video(float gammaR, float gammaG, float gammaB) {
396 if(dir >= 0) {
397 FUNCTION_NAPPLY_GAMMA_RGB(leds, len, gammaR, gammaG, gammaB);
398 } else {
399 FUNCTION_NAPPLY_GAMMA_RGB(leds + len + 1, -len, gammaR, gammaG, gammaB);
400 }
401 return *this;
402 }
403
405
406
409
413 template <class T>
415 T * leds;
416 const int8_t dir;
417
418 public:
421
426 FASTLED_FORCE_INLINE pixelset_iterator_base(T * _leds, const char _dir) : leds(_leds), dir(_dir) {}
427
430
431 FASTLED_FORCE_INLINE bool operator==(pixelset_iterator_base & other) const { return leds == other.leds; /* && set==other.set; */ }
432 FASTLED_FORCE_INLINE bool operator!=(pixelset_iterator_base & other) const { return leds != other.leds; /* || set != other.set; */ }
433
434 FASTLED_FORCE_INLINE PIXEL_TYPE& operator*() const { return *leds; }
435 };
436
437 typedef pixelset_iterator_base<PIXEL_TYPE> iterator;
438 typedef pixelset_iterator_base<const PIXEL_TYPE> const_iterator;
439
440 iterator begin() { return iterator(leds, dir); }
441 iterator end() { return iterator(end_pos, dir); }
442
443 iterator begin() const { return iterator(leds, dir); }
444 iterator end() const { return iterator(end_pos, dir); }
445
448
450};
451
453CRGB *operator+(const CRGBSet & pixels, int offset) {
454 return (CRGB*)pixels + offset;
455}
456
457
460template<int SIZE>
461class CRGBArray : public CPixelView<CRGB> {
462 CRGB rawleds[SIZE] = {0};
463
464public:
466 using CPixelView::operator=;
467 CRGB* get() { return &rawleds[0]; }
468 const CRGB* get() const { return &rawleds[0]; }
469 size_t size() const { return SIZE; }
470};
471
473
475
476#undef FUNCTION_FILL_RAINBOW
477#undef FUNCTION_NAPPLY_GAMMA
478#undef FUNCTION_NAPPLY_GAMMA_RGB
479#undef FUNCTION_BLUR1D
480#undef FUNCTION_FILL_GRADIENT
481#undef FUNCTION_FILL_GRADIENT3
482#undef FUNCTION_FILL_GRADIENT4
483#undef FUNCTION_NBLEND
484#undef FUNCTION_FILL_GRADIENT_RGB
485#undef FUNCTION_FILL_GRADIENT_RGB3
486#undef FUNCTION_FILL_GRADIENT_RGB4
central include file for FastLED, defines the CFastLED class/object
uint32_t x[NUM_LAYERS]
Definition Fire2023.ino:80
FASTLED_FORCE_INLINE bool operator==(pixelset_iterator_base &other) const
Check if iterator is at the same position.
Definition pixelset.h:431
FASTLED_FORCE_INLINE pixelset_iterator_base & operator++()
Increment LED pointer in data direction.
Definition pixelset.h:428
FASTLED_FORCE_INLINE pixelset_iterator_base operator++(int)
Increment LED pointer in data direction.
Definition pixelset.h:429
FASTLED_FORCE_INLINE pixelset_iterator_base(const pixelset_iterator_base &rhs)
Copy constructor.
Definition pixelset.h:420
FASTLED_FORCE_INLINE pixelset_iterator_base(T *_leds, const char _dir)
Base constructor.
Definition pixelset.h:426
FASTLED_FORCE_INLINE PIXEL_TYPE & operator*() const
Dereference operator, to get underlying pointer to the LEDs.
Definition pixelset.h:434
FASTLED_FORCE_INLINE bool operator!=(pixelset_iterator_base &other) const
Check if iterator is not at the same position.
Definition pixelset.h:432
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:83
CPixelView & nscale8(PIXEL_TYPE &scaledown)
Scale every LED by the given scale.
Definition pixelset.h:206
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:230
CPixelView & fill_gradient(const CHSV &c1, const CHSV &c2, const CHSV &c3, TGradientDirectionCode directionCode=SHORTEST_HUES)
Fill all of the LEDs with a smooth HSV gradient between three HSV colors.
Definition pixelset.h:284
CPixelView & operator-=(CPixelView &rhs)
Subtract every pixel in the other set from this set.
Definition pixelset.h:165
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:344
CPixelView & fill_rainbow(uint8_t initialhue, uint8_t deltahue=5)
Fill all of the LEDs with a rainbow of colors.
Definition pixelset.h:255
CPixelView & addToRGB(uint8_t inc)
Add the passed in value to all channels for all of the pixels in this set.
Definition pixelset.h:158
CRGB *const leds
Definition pixelset.h:72
CPixelView & nscale8_video(uint8_t scaledown)
Scale every LED by the given scale.
Definition pixelset.h:197
CPixelView & operator--()
Decrement every pixel value in this set.
Definition pixelset.h:179
const_iterator cbegin() const
Makes a const iterator instance for the start of the LED set, const qualified.
Definition pixelset.h:446
const_iterator cend() const
Makes a const iterator instance for the end of the LED set, const qualified.
Definition pixelset.h:447
CPixelView & operator*=(uint8_t d)
Multiply every LED in this set by the given value.
Definition pixelset.h:194
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:216
bool reversed()
Whether or not this set goes backwards.
Definition pixelset.h:98
CPixelView & operator--(int DUMMY_ARG)
Decrement every pixel value in this set.
Definition pixelset.h:181
CPixelView & fill_solid(const CHSV &color)
Fill all of the LEDs with a solid color.
Definition pixelset.h:249
CPixelView & operator=(const CPixelView &rhs)
Copy the contents of the passed-in set to our set.
Definition pixelset.h:147
CPixelView & operator++(int DUMMY_ARG)
Increment every pixel value in this set.
Definition pixelset.h:170
iterator end()
Definition pixelset.h:441
CPixelView & operator+=(CPixelView &rhs)
Add every pixel in the other set to this set.
Definition pixelset.h:160
CPixelView & operator=(const PIXEL_TYPE &color)
Assign the passed in color to all elements in this set.
Definition pixelset.h:128
const int8_t dir
Definition pixelset.h:69
CPixelView & operator++()
Increment every pixel value in this set.
Definition pixelset.h:168
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:329
void dump() const
Print debug data to serial, disabled for release.
Definition pixelset.h:135
CPixelView & blur1d(fract8 blur_amount)
One-dimensional blur filter.
Definition pixelset.h:369
CPixelView & nblend(const PIXEL_TYPE &overlay, fract8 amountOfOverlay)
Destructively modifies all LEDs, blending in a given fraction of an overlay color.
Definition pixelset.h:357
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:227
CPixelView & fill_gradient(const CHSV &startcolor, const CHSV &endcolor, TGradientDirectionCode directionCode=SHORTEST_HUES)
Fill all of the LEDs with a smooth HSV gradient between two HSV colors.
Definition pixelset.h:269
CPixelView & operator%=(uint8_t scaledown)
Scale down every LED by the given scale.
Definition pixelset.h:199
pixelset_iterator_base< CRGB > iterator
Definition pixelset.h:437
CPixelView & operator/=(uint8_t d)
Divide every LED by the given value.
Definition pixelset.h:190
CPixelView & nscale8(uint8_t scaledown)
Scale every LED by the given scale.
Definition pixelset.h:204
CPixelView & fill_gradient_RGB(const PIXEL_TYPE &startcolor, const PIXEL_TYPE &endcolor, TGradientDirectionCode directionCode=SHORTEST_HUES)
Fill all of the LEDs with a smooth RGB gradient between two RGB colors.
Definition pixelset.h:314
CPixelView & operator>>=(uint8_t d)
Shift every LED in this set right by the given number of bits.
Definition pixelset.h:192
CPixelView operator()(int start, int end)
Access an inclusive subset of the LEDs in this set.
Definition pixelset.h:114
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:101
CPixelView & napplyGamma_video(float gamma)
Destructively applies a gamma adjustment to all LEDs.
Definition pixelset.h:381
CPixelView & fadeToBlackBy(uint8_t fade)
Fade every LED down by the given scale.
Definition pixelset.h:211
CPixelView & fill_gradient(const CHSV &c1, const CHSV &c2, const CHSV &c3, const CHSV &c4, TGradientDirectionCode directionCode=SHORTEST_HUES)
Fill all of the LEDs with a smooth HSV gradient between four HSV colors.
Definition pixelset.h:300
CPixelView & operator|=(uint8_t d)
Apply the PIXEL_TYPE |= operator to every pixel in this set.
Definition pixelset.h:222
CRGB *const end_pos
Definition pixelset.h:73
PIXEL_TYPE & operator[](int x) const
Access a single element in this set, just like an array operator.
Definition pixelset.h:107
CPixelView & subFromRGB(uint8_t inc)
Subtract the passed in value from all channels for all of the pixels in this set.
Definition pixelset.h:163
CPixelView & fadeLightBy(uint8_t fadefactor)
Fade every LED down by the given scale.
Definition pixelset.h:201
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:219
pixelset_iterator_base< const CRGB > const_iterator
Definition pixelset.h:438
CPixelView & nscale8(CPixelView &rhs)
Scale every LED in this set by every led in the other set.
Definition pixelset.h:208
CPixelView operator-()
Return the reverse ordering of this set.
Definition pixelset.h:121
CPixelView & fill_solid(const PIXEL_TYPE &color)
Fill all of the LEDs with a solid color.
Definition pixelset.h:247
CPixelView(PIXEL_TYPE *_leds, int _start, int _end)
PixelSet constructor for the given set of LEDs, with start and end boundaries.
Definition pixelset.h:90
CPixelView & operator&=(uint8_t d)
Apply the PIXEL_TYPE &= operator to every pixel in this set with the passed in value.
Definition pixelset.h:233
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:104
CPixelView & nblend(const CPixelView &rhs, fract8 amountOfOverlay)
Destructively blend another set of LEDs into this one.
Definition pixelset.h:363
iterator begin() const
Makes an iterator instance for the start of the LED set, const qualified.
Definition pixelset.h:443
iterator begin()
Makes an iterator instance for the start of the LED set.
Definition pixelset.h:440
iterator end() const
Makes an iterator instance for the end of the LED set, const qualified.
Definition pixelset.h:444
const int len
Definition pixelset.h:70
CPixelView & napplyGamma_video(float gammaR, float gammaG, float gammaB)
Destructively applies a gamma adjustment to all LEDs.
Definition pixelset.h:395
CPixelView(const CPixelView &other)
PixelSet copy constructor.
Definition pixelset.h:77
int size()
Get the size of this set.
Definition pixelset.h:94
Represents a set of LED objects.
Definition pixelset.h:67
CRGB rawleds[SIZE]
the LED data
Definition pixelset.h:462
CRGB * get()
Definition pixelset.h:467
size_t size() const
Definition pixelset.h:469
const CRGB * get() const
Definition pixelset.h:468
#define FASTLED_FORCE_INLINE
Definition force_inline.h:7
TGradientDirectionCode
Hue direction for calculating fill gradients.
Definition colorutils.h:160
@ SHORTEST_HUES
Hue goes whichever way is shortest.
Definition colorutils.h:163
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:453
#define FASTLED_NAMESPACE_END
Definition namespace.h:22
Implements the FastLED namespace macros.
#define FUNCTION_NBLEND(a, b, c)
Definition pixelset.h:28
#define FUNCTION_FILL_GRADIENT3(a, b, c, d, e, f)
Definition pixelset.h:26
#define FUNCTION_FILL_GRADIENT_RGB3(a, b, c, d, e)
Definition pixelset.h:30
#define FUNCTION_FILL_GRADIENT4(a, b, c, d, e, f, g)
Definition pixelset.h:27
#define FUNCTION_FILL_GRADIENT(a, b, c, d, e)
Definition pixelset.h:25
#define FUNCTION_FILL_GRADIENT_RGB(a, b, c, d)
Definition pixelset.h:29
#define FUNCTION_FILL_GRADIENT_RGB4(a, b, c, d, e, f)
Definition pixelset.h:31
#define FUNCTION_BLUR1D(a, b, c)
Definition pixelset.h:24
#define FUNCTION_NAPPLY_GAMMA_RGB(a, b, c, d, e)
Definition pixelset.h:23
#define FUNCTION_NAPPLY_GAMMA(a, b, c)
Definition pixelset.h:22
CPixelView< CRGB > CRGBSet
CPixelView for CRGB arrays.
Definition pixelset.h:47
#define FUNCTION_FILL_RAINBOW(a, b, c, d)
Definition pixelset.h:21
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:54
#define FASTLED_UNUSED(x)
Definition unused.h:3