FastLED 3.9.15
Loading...
Searching...
No Matches
pixelset.h
Go to the documentation of this file.
1#pragma once
2
3
5#include "fl/gfx/colorutils.h"
6#include "fl/math/math.h"
7
8#include "fl/gfx/fill.h"
9#include "fl/gfx/blur.h"
10
11#include "fl/system/fastled.h"
12#include "fl/stl/span.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
27template<class PIXEL_TYPE>
28class CPixelView;
29
52
55CRGB *operator+(const CRGBSet & pixels, int offset);
56
57
60
61
65
101template<class PIXEL_TYPE>
103public:
104 const fl::i8 dir;
105 const int len;
107 PIXEL_TYPE * const leds;
108 PIXEL_TYPE * const end_pos;
109
110public:
112 inline CPixelView(const CPixelView & other) : dir(other.dir), len(other.len), leds(other.leds), end_pos(other.end_pos) {}
113
118 inline CPixelView(PIXEL_TYPE *_leds, int _len) : dir(_len < 0 ? -1 : 1), len(_len), leds(_leds), end_pos(_leds + _len) {}
119
125 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) {}
126
129 int size() { return fl::abs(len); }
130
133 bool reversed() { return len < 0; }
134
136 bool operator==(const CPixelView & rhs) const { return leds == rhs.leds && len == rhs.len && dir == rhs.dir; }
137
139 bool operator!=(const CPixelView & rhs) const { return leds != rhs.leds || len != rhs.len || dir != rhs.dir; }
140
142 inline PIXEL_TYPE & operator[](int x) const { if(dir & 0x80) { return leds[-x]; } else { return leds[x]; } }
143
149 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); } }
150
151 // Access an inclusive subset of the LEDs in this set, starting from the first.
152 // @param end the last element for the new subset
153 // @todo Not sure i want this? inline CPixelView operator()(int end) { return CPixelView(leds, 0, end); }
154
156 inline CPixelView operator-() { return CPixelView(leds, len - dir, 0); }
157
159 inline operator PIXEL_TYPE* () const { return leds; }
160
163 inline CPixelView & operator=(const PIXEL_TYPE & color) {
164 for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel) = color; }
165 return *this;
166 }
167
170 void dump() const {
177 }
178
182 inline CPixelView & operator=(const CPixelView & rhs) {
183 for(iterator pixel = begin(), rhspixel = rhs.begin(), _end = end(), rhs_end = rhs.end(); (pixel != _end) && (rhspixel != rhs_end); ++pixel, ++rhspixel) {
184 (*pixel) = (*rhspixel);
185 }
186 return *this;
187 }
188
191
193 inline CPixelView & addToRGB(fl::u8 inc) { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel) += inc; } return *this; }
195 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; }
196
198 inline CPixelView & subFromRGB(fl::u8 inc) { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel) -= inc; } return *this; }
200 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; }
201
203 inline CPixelView & operator++() { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel)++; } return *this; }
205 inline CPixelView & operator++(int DUMMY_ARG) {
206 FASTLED_UNUSED(DUMMY_ARG);
207 for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) {
208 (*pixel)++;
209 }
210 return *this;
211 }
212
214 inline CPixelView & operator--() { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel)--; } return *this; }
216 inline CPixelView & operator--(int DUMMY_ARG) {
217 FASTLED_UNUSED(DUMMY_ARG);
218 for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) {
219 (*pixel)--;
220 }
221 return *this;
222 }
223
225 inline CPixelView & operator/=(fl::u8 d) { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel) /= d; } return *this; }
227 inline CPixelView & operator>>=(fl::u8 d) { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel) >>= d; } return *this; }
229 inline CPixelView & operator*=(fl::u8 d) { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel) *= d; } return *this; }
230
232 inline CPixelView & nscale8_video(fl::u8 scaledown) { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel).nscale8_video(scaledown); } return *this;}
234 inline CPixelView & operator%=(fl::u8 scaledown) { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel).nscale8_video(scaledown); } return *this; }
236 inline CPixelView & fadeLightBy(fl::u8 fadefactor) { return nscale8_video(255 - fadefactor); }
237
239 inline CPixelView & nscale8(fl::u8 scaledown) { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel).nscale8(scaledown); } return *this; }
241 inline CPixelView & nscale8(PIXEL_TYPE & scaledown) { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel).nscale8(scaledown); } return *this; }
243 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; }
244
246 inline CPixelView & fadeToBlackBy(fl::u8 fade) { return nscale8(255 - fade); }
247
251 inline CPixelView & operator|=(const PIXEL_TYPE & rhs) { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel) |= rhs; } return *this; }
254 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; }
257 inline CPixelView & operator|=(fl::u8 d) { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel) |= d; } return *this; }
258
262 inline CPixelView & operator&=(const PIXEL_TYPE & rhs) { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel) &= rhs; } return *this; }
265 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; }
268 inline CPixelView & operator&=(fl::u8 d) { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel) &= d; } return *this; }
269
271
272
274 inline operator bool() { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { if((*pixel)) return true; } return false; }
275
276
279
282 inline CPixelView & fill_solid(const PIXEL_TYPE & color) { *this = color; return *this; }
284 inline CPixelView & fill_solid(const CHSV & color) { *this = color; return *this; }
285
290 inline CPixelView & fill_rainbow(fl::u8 initialhue, fl::u8 deltahue=5) {
291 if(dir >= 0) {
292 FUNCTION_FILL_RAINBOW(leds,len,initialhue,deltahue);
293 } else {
294 FUNCTION_FILL_RAINBOW(leds + len + 1, -len, initialhue - deltahue * (len+1), -deltahue);
295 }
296 return *this;
297 }
298
304 inline CPixelView & fill_gradient(const CHSV & startcolor, const CHSV & endcolor, TGradientDirectionCode directionCode = fl::SHORTEST_HUES) {
305 if(dir >= 0) {
306 FUNCTION_FILL_GRADIENT(leds,len,startcolor, endcolor, directionCode);
307 } else {
308 FUNCTION_FILL_GRADIENT(leds + len + 1, (-len), endcolor, startcolor, directionCode);
309 }
310 return *this;
311 }
312
319 inline CPixelView & fill_gradient(const CHSV & c1, const CHSV & c2, const CHSV & c3, TGradientDirectionCode directionCode = fl::SHORTEST_HUES) {
320 if(dir >= 0) {
321 FUNCTION_FILL_GRADIENT3(leds, len, c1, c2, c3, directionCode);
322 } else {
323 FUNCTION_FILL_GRADIENT3(leds + len + 1, -len, c3, c2, c1, directionCode);
324 }
325 return *this;
326 }
327
335 inline CPixelView & fill_gradient(const CHSV & c1, const CHSV & c2, const CHSV & c3, const CHSV & c4, TGradientDirectionCode directionCode = fl::SHORTEST_HUES) {
336 if(dir >= 0) {
337 FUNCTION_FILL_GRADIENT4(leds, len, c1, c2, c3, c4, directionCode);
338 } else {
339 FUNCTION_FILL_GRADIENT4(leds + len + 1, -len, c4, c3, c2, c1, directionCode);
340 }
341 return *this;
342 }
343
349 inline CPixelView & fill_gradient_RGB(const PIXEL_TYPE & startcolor, const PIXEL_TYPE & endcolor, TGradientDirectionCode directionCode = fl::SHORTEST_HUES) {
350 FASTLED_UNUSED(directionCode); // TODO: why is this not used?
351 if(dir >= 0) {
352 FUNCTION_FILL_GRADIENT_RGB(leds,len,startcolor, endcolor);
353 } else {
354 FUNCTION_FILL_GRADIENT_RGB(leds + len + 1, (-len), endcolor, startcolor);
355 }
356 return *this;
357 }
358
364 inline CPixelView & fill_gradient_RGB(const PIXEL_TYPE & c1, const PIXEL_TYPE & c2, const PIXEL_TYPE & c3) {
365 if(dir >= 0) {
367 } else {
368 FUNCTION_FILL_GRADIENT_RGB3(leds + len + 1, -len, c3, c2, c1);
369 }
370 return *this;
371 }
372
379 inline CPixelView & fill_gradient_RGB(const PIXEL_TYPE & c1, const PIXEL_TYPE & c2, const PIXEL_TYPE & c3, const PIXEL_TYPE & c4) {
380 if(dir >= 0) {
381 FUNCTION_FILL_GRADIENT_RGB4(leds, len, c1, c2, c3, c4);
382 } else {
383 FUNCTION_FILL_GRADIENT_RGB4(leds + len + 1, -len, c4, c3, c2, c1);
384 }
385 return *this;
386 }
387
392 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; }
393
398 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; }
399
404 inline CPixelView & blur1d(fract8 blur_amount) {
405 if(dir >= 0) {
406 FUNCTION_BLUR1D(leds, len, blur_amount);
407 } else {
408 FUNCTION_BLUR1D(leds + len + 1, -len, blur_amount);
409 }
410 return *this;
411 }
412
416 inline CPixelView & napplyGamma_video(float gamma) {
417 if(dir >= 0) {
419 } else {
420 FUNCTION_NAPPLY_GAMMA(leds + len + 1, -len, gamma);
421 }
422 return *this;
423 }
424
430 inline CPixelView & napplyGamma_video(float gammaR, float gammaG, float gammaB) {
431 if(dir >= 0) {
432 FUNCTION_NAPPLY_GAMMA_RGB(leds, len, gammaR, gammaG, gammaB);
433 } else {
434 FUNCTION_NAPPLY_GAMMA_RGB(leds + len + 1, -len, gammaR, gammaG, gammaB);
435 }
436 return *this;
437 }
438
440
441
444
448 template <class T>
450 T * leds;
451 const fl::i8 dir;
452
453 public:
456
461 FASTLED_FORCE_INLINE pixelset_iterator_base(T * _leds, const char _dir) : leds(_leds), dir(_dir) {}
462
465
466 FASTLED_FORCE_INLINE bool operator==(pixelset_iterator_base & other) const { return leds == other.leds; /* && set==other.set; */ }
467 FASTLED_FORCE_INLINE bool operator!=(pixelset_iterator_base & other) const { return leds != other.leds; /* || set != other.set; */ }
468
469 FASTLED_FORCE_INLINE PIXEL_TYPE& operator*() const { return *leds; }
470 };
471
472 typedef pixelset_iterator_base<PIXEL_TYPE> iterator;
473 typedef pixelset_iterator_base<const PIXEL_TYPE> const_iterator;
474
475 iterator begin() { return iterator(leds, dir); }
476 iterator end() { return iterator(end_pos, dir); }
477
478 iterator begin() const { return iterator(leds, dir); }
479 iterator end() const { return iterator(end_pos, dir); }
480
483
485};
486
488CRGB *operator+(const CRGBSet & pixels, int offset) {
489 return (CRGB*)pixels + offset;
490}
491
492
495template<int SIZE>
496class CRGBArray : public CPixelView<CRGB> {
497 CRGB rawleds[SIZE] = {0};
498
499public:
501 using CPixelView::operator=;
502 CRGB* get() { return &rawleds[0]; }
503 const CRGB* get() const { return &rawleds[0]; }
504 size_t size() const { return SIZE; }
505 operator fl::span<CRGB>() { return fl::span<CRGB>(rawleds, SIZE); }
506 operator fl::span<const CRGB>() const { return fl::span<const CRGB>(rawleds, SIZE); }
507};
508
510
511
512
513#undef FUNCTION_FILL_RAINBOW
514#undef FUNCTION_NAPPLY_GAMMA
515#undef FUNCTION_NAPPLY_GAMMA_RGB
516#undef FUNCTION_BLUR1D
517#undef FUNCTION_FILL_GRADIENT
518#undef FUNCTION_FILL_GRADIENT3
519#undef FUNCTION_FILL_GRADIENT4
520#undef FUNCTION_NBLEND
521#undef FUNCTION_FILL_GRADIENT_RGB
522#undef FUNCTION_FILL_GRADIENT_RGB3
523#undef FUNCTION_FILL_GRADIENT_RGB4
int x
Definition simple.h:92
FASTLED_FORCE_INLINE bool operator==(pixelset_iterator_base &other) const
Check if iterator is at the same position.
Definition pixelset.h:466
FASTLED_FORCE_INLINE pixelset_iterator_base & operator++()
Increment LED pointer in data direction.
Definition pixelset.h:463
FASTLED_FORCE_INLINE pixelset_iterator_base operator++(int)
Increment LED pointer in data direction.
Definition pixelset.h:464
FASTLED_FORCE_INLINE pixelset_iterator_base(const pixelset_iterator_base &rhs)
Copy constructor.
Definition pixelset.h:455
FASTLED_FORCE_INLINE pixelset_iterator_base(T *_leds, const char _dir)
Base constructor.
Definition pixelset.h:461
FASTLED_FORCE_INLINE PIXEL_TYPE & operator*() const
Dereference operator, to get underlying pointer to the LEDs.
Definition pixelset.h:469
FASTLED_FORCE_INLINE bool operator!=(pixelset_iterator_base &other) const
Check if iterator is not at the same position.
Definition pixelset.h:467
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:118
CPixelView & nscale8(PIXEL_TYPE &scaledown)
Scale every LED by the given scale.
Definition pixelset.h:241
CPixelView & operator/=(fl::u8 d)
Divide every LED by the given value.
Definition pixelset.h:225
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:265
CPixelView & operator%=(fl::u8 scaledown)
Scale down every LED by the given scale.
Definition pixelset.h:234
CPixelView & fadeToBlackBy(fl::u8 fade)
Fade every LED down by the given scale.
Definition pixelset.h:246
CPixelView & operator-=(CPixelView &rhs)
Subtract every pixel in the other set from this set.
Definition pixelset.h:200
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:379
CRGB *const leds
Definition pixelset.h:107
CPixelView & operator--()
Decrement every pixel value in this set.
Definition pixelset.h:214
const_iterator cbegin() const
Makes a const iterator instance for the start of the LED set, const qualified.
Definition pixelset.h:481
CPixelView & operator&=(fl::u8 d)
Apply the PIXEL_TYPE &= operator to every pixel in this set with the passed in value.
Definition pixelset.h:268
const_iterator cend() const
Makes a const iterator instance for the end of the LED set, const qualified.
Definition pixelset.h:482
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:319
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:251
bool reversed()
Whether or not this set goes backwards.
Definition pixelset.h:133
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:335
CPixelView & operator--(int DUMMY_ARG)
Decrement every pixel value in this set.
Definition pixelset.h:216
CPixelView & nscale8(fl::u8 scaledown)
Scale every LED by the given scale.
Definition pixelset.h:239
CPixelView & fadeLightBy(fl::u8 fadefactor)
Fade every LED down by the given scale.
Definition pixelset.h:236
CPixelView & fill_solid(const CHSV &color)
Fill all of the LEDs with a solid color.
Definition pixelset.h:284
CPixelView & nscale8_video(fl::u8 scaledown)
Scale every LED by the given scale.
Definition pixelset.h:232
CPixelView & fill_rainbow(fl::u8 initialhue, fl::u8 deltahue=5)
Fill all of the LEDs with a rainbow of colors.
Definition pixelset.h:290
CPixelView & operator=(const CPixelView &rhs)
Copy the contents of the passed-in set to our set.
Definition pixelset.h:182
CPixelView & operator*=(fl::u8 d)
Multiply every LED in this set by the given value.
Definition pixelset.h:229
CPixelView & operator++(int DUMMY_ARG)
Increment every pixel value in this set.
Definition pixelset.h:205
iterator end()
Definition pixelset.h:476
CPixelView & operator+=(CPixelView &rhs)
Add every pixel in the other set to this set.
Definition pixelset.h:195
CPixelView & subFromRGB(fl::u8 inc)
Subtract the passed in value from all channels for all of the pixels in this set.
Definition pixelset.h:198
CPixelView & operator=(const PIXEL_TYPE &color)
Assign the passed in color to all elements in this set.
Definition pixelset.h:163
CPixelView & operator|=(fl::u8 d)
Apply the PIXEL_TYPE |= operator to every pixel in this set.
Definition pixelset.h:257
CPixelView & operator++()
Increment every pixel value in this set.
Definition pixelset.h:203
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:364
void dump() const
Print debug data to serial, disabled for release.
Definition pixelset.h:170
CPixelView & blur1d(fract8 blur_amount)
One-dimensional blur filter.
Definition pixelset.h:404
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:304
CPixelView & nblend(const PIXEL_TYPE &overlay, fract8 amountOfOverlay)
Destructively modifies all LEDs, blending in a given fraction of an overlay color.
Definition pixelset.h:392
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:262
pixelset_iterator_base< CRGB > iterator
Definition pixelset.h:472
CPixelView operator()(int start, int end)
Access an inclusive subset of the LEDs in this set.
Definition pixelset.h:149
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:136
CPixelView & napplyGamma_video(float gamma)
Destructively applies a gamma adjustment to all LEDs.
Definition pixelset.h:416
CRGB *const end_pos
Definition pixelset.h:108
PIXEL_TYPE & operator[](int x) const
Access a single element in this set, just like an array operator.
Definition pixelset.h:142
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:254
pixelset_iterator_base< const CRGB > const_iterator
Definition pixelset.h:473
CPixelView & nscale8(CPixelView &rhs)
Scale every LED in this set by every led in the other set.
Definition pixelset.h:243
CPixelView operator-()
Return the reverse ordering of this set.
Definition pixelset.h:156
CPixelView & fill_solid(const PIXEL_TYPE &color)
Fill all of the LEDs with a solid color.
Definition pixelset.h:282
CPixelView(PIXEL_TYPE *_leds, int _start, int _end)
PixelSet constructor for the given set of LEDs, with start and end boundaries.
Definition pixelset.h:125
const fl::i8 dir
Definition pixelset.h:104
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:139
CPixelView & nblend(const CPixelView &rhs, fract8 amountOfOverlay)
Destructively blend another set of LEDs into this one.
Definition pixelset.h:398
iterator begin() const
Makes an iterator instance for the start of the LED set, const qualified.
Definition pixelset.h:478
CPixelView & addToRGB(fl::u8 inc)
Add the passed in value to all channels for all of the pixels in this set.
Definition pixelset.h:193
iterator begin()
Makes an iterator instance for the start of the LED set.
Definition pixelset.h:475
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:349
CPixelView & operator>>=(fl::u8 d)
Shift every LED in this set right by the given number of bits.
Definition pixelset.h:227
iterator end() const
Makes an iterator instance for the end of the LED set, const qualified.
Definition pixelset.h:479
CPixelView & napplyGamma_video(float gammaR, float gammaG, float gammaB)
Destructively applies a gamma adjustment to all LEDs.
Definition pixelset.h:430
CPixelView(const CPixelView &other)
PixelSet copy constructor.
Definition pixelset.h:112
int size()
Get the size of this set.
Definition pixelset.h:129
Represents a view/window into a set of LED pixels, providing array-like access and rich color operati...
Definition pixelset.h:102
CRGB rawleds[SIZE]
the LED data
Definition pixelset.h:497
CRGB * get()
Definition pixelset.h:502
size_t size() const
Definition pixelset.h:504
const CRGB * get() const
Definition pixelset.h:503
fl::UISlider offset("Offset", 0.0f, 0.0f, 1.0f, 0.01f)
Utility functions for color fill, palettes, blending, and more.
Internal FastLED header for implementation files.
fl::hsv8 CHSV
Definition chsv.h:11
fl::CRGB CRGB
Definition crgb.h:25
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:488
u8 fract8
Fixed-Point Fractional Types.
Definition s16x16x4.h:161
unsigned char u8
Definition stdint.h:131
TGradientDirectionCode
Hue direction for calculating fill gradients.
@ SHORTEST_HUES
Hue goes whichever way is shortest.
signed char i8
Definition stdint.h:130
constexpr enable_if< is_fixed_point< T >::value, T >::type abs(T x) FL_NOEXCEPT
#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 specialized for CRGB pixel arrays - the most commonly used pixel view type.
Definition pixelset.h:51
#define FUNCTION_FILL_RAINBOW(a, b, c, d)
Definition pixelset.h:14
#define FASTLED_FORCE_INLINE
#define FASTLED_UNUSED(x)