FastLED 3.9.15
Loading...
Searching...
No Matches
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
60
63CRGB *operator+(const CRGBSet & pixels, int offset);
64
65
68
69
73
109template<class PIXEL_TYPE>
111public:
112 const int8_t dir;
113 const int len;
115 PIXEL_TYPE * const leds;
116 PIXEL_TYPE * const end_pos;
117
118public:
120 inline CPixelView(const CPixelView & other) : dir(other.dir), len(other.len), leds(other.leds), end_pos(other.end_pos) {}
121
126 inline CPixelView(PIXEL_TYPE *_leds, int _len) : dir(_len < 0 ? -1 : 1), len(_len), leds(_leds), end_pos(_leds + _len) {}
127
133 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) {}
134
137 int size() { return abs(len); }
138
141 bool reversed() { return len < 0; }
142
144 bool operator==(const CPixelView & rhs) const { return leds == rhs.leds && len == rhs.len && dir == rhs.dir; }
145
147 bool operator!=(const CPixelView & rhs) const { return leds != rhs.leds || len != rhs.len || dir != rhs.dir; }
148
150 inline PIXEL_TYPE & operator[](int x) const { if(dir & 0x80) { return leds[-x]; } else { return leds[x]; } }
151
157 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); } }
158
159 // Access an inclusive subset of the LEDs in this set, starting from the first.
160 // @param end the last element for the new subset
161 // @todo Not sure i want this? inline CPixelView operator()(int end) { return CPixelView(leds, 0, end); }
162
164 inline CPixelView operator-() { return CPixelView(leds, len - dir, 0); }
165
167 inline operator PIXEL_TYPE* () const { return leds; }
168
171 inline CPixelView & operator=(const PIXEL_TYPE & color) {
172 for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel) = color; }
173 return *this;
174 }
175
178 void dump() const {
185 }
186
190 inline CPixelView & operator=(const CPixelView & rhs) {
191 for(iterator pixel = begin(), rhspixel = rhs.begin(), _end = end(), rhs_end = rhs.end(); (pixel != _end) && (rhspixel != rhs_end); ++pixel, ++rhspixel) {
192 (*pixel) = (*rhspixel);
193 }
194 return *this;
195 }
196
199
201 inline CPixelView & addToRGB(uint8_t inc) { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel) += inc; } return *this; }
203 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; }
204
206 inline CPixelView & subFromRGB(uint8_t inc) { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel) -= inc; } return *this; }
208 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; }
209
211 inline CPixelView & operator++() { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel)++; } return *this; }
213 inline CPixelView & operator++(int DUMMY_ARG) {
214 FASTLED_UNUSED(DUMMY_ARG);
215 for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) {
216 (*pixel)++;
217 }
218 return *this;
219 }
220
222 inline CPixelView & operator--() { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel)--; } return *this; }
224 inline CPixelView & operator--(int DUMMY_ARG) {
225 FASTLED_UNUSED(DUMMY_ARG);
226 for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) {
227 (*pixel)--;
228 }
229 return *this;
230 }
231
233 inline CPixelView & operator/=(uint8_t d) { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel) /= d; } return *this; }
235 inline CPixelView & operator>>=(uint8_t d) { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel) >>= d; } return *this; }
237 inline CPixelView & operator*=(uint8_t d) { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel) *= d; } return *this; }
238
240 inline CPixelView & nscale8_video(uint8_t scaledown) { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel).nscale8_video(scaledown); } return *this;}
242 inline CPixelView & operator%=(uint8_t scaledown) { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel).nscale8_video(scaledown); } return *this; }
244 inline CPixelView & fadeLightBy(uint8_t fadefactor) { return nscale8_video(255 - fadefactor); }
245
247 inline CPixelView & nscale8(uint8_t scaledown) { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel).nscale8(scaledown); } return *this; }
249 inline CPixelView & nscale8(PIXEL_TYPE & scaledown) { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel).nscale8(scaledown); } return *this; }
251 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; }
252
254 inline CPixelView & fadeToBlackBy(uint8_t fade) { return nscale8(255 - fade); }
255
259 inline CPixelView & operator|=(const PIXEL_TYPE & rhs) { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel) |= rhs; } return *this; }
262 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; }
265 inline CPixelView & operator|=(uint8_t d) { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel) |= d; } return *this; }
266
270 inline CPixelView & operator&=(const PIXEL_TYPE & rhs) { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel) &= rhs; } return *this; }
273 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; }
276 inline CPixelView & operator&=(uint8_t d) { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { (*pixel) &= d; } return *this; }
277
279
280
282 inline operator bool() { for(iterator pixel = begin(), _end = end(); pixel != _end; ++pixel) { if((*pixel)) return true; } return false; }
283
284
287
290 inline CPixelView & fill_solid(const PIXEL_TYPE & color) { *this = color; return *this; }
292 inline CPixelView & fill_solid(const CHSV & color) { *this = color; return *this; }
293
298 inline CPixelView & fill_rainbow(uint8_t initialhue, uint8_t deltahue=5) {
299 if(dir >= 0) {
300 FUNCTION_FILL_RAINBOW(leds,len,initialhue,deltahue);
301 } else {
302 FUNCTION_FILL_RAINBOW(leds + len + 1, -len, initialhue - deltahue * (len+1), -deltahue);
303 }
304 return *this;
305 }
306
312 inline CPixelView & fill_gradient(const CHSV & startcolor, const CHSV & endcolor, TGradientDirectionCode directionCode = fl::SHORTEST_HUES) {
313 if(dir >= 0) {
314 FUNCTION_FILL_GRADIENT(leds,len,startcolor, endcolor, directionCode);
315 } else {
316 FUNCTION_FILL_GRADIENT(leds + len + 1, (-len), endcolor, startcolor, directionCode);
317 }
318 return *this;
319 }
320
327 inline CPixelView & fill_gradient(const CHSV & c1, const CHSV & c2, const CHSV & c3, TGradientDirectionCode directionCode = fl::SHORTEST_HUES) {
328 if(dir >= 0) {
329 FUNCTION_FILL_GRADIENT3(leds, len, c1, c2, c3, directionCode);
330 } else {
331 FUNCTION_FILL_GRADIENT3(leds + len + 1, -len, c3, c2, c1, directionCode);
332 }
333 return *this;
334 }
335
343 inline CPixelView & fill_gradient(const CHSV & c1, const CHSV & c2, const CHSV & c3, const CHSV & c4, TGradientDirectionCode directionCode = fl::SHORTEST_HUES) {
344 if(dir >= 0) {
345 FUNCTION_FILL_GRADIENT4(leds, len, c1, c2, c3, c4, directionCode);
346 } else {
347 FUNCTION_FILL_GRADIENT4(leds + len + 1, -len, c4, c3, c2, c1, directionCode);
348 }
349 return *this;
350 }
351
357 inline CPixelView & fill_gradient_RGB(const PIXEL_TYPE & startcolor, const PIXEL_TYPE & endcolor, TGradientDirectionCode directionCode = fl::SHORTEST_HUES) {
358 FASTLED_UNUSED(directionCode); // TODO: why is this not used?
359 if(dir >= 0) {
360 FUNCTION_FILL_GRADIENT_RGB(leds,len,startcolor, endcolor);
361 } else {
362 FUNCTION_FILL_GRADIENT_RGB(leds + len + 1, (-len), endcolor, startcolor);
363 }
364 return *this;
365 }
366
372 inline CPixelView & fill_gradient_RGB(const PIXEL_TYPE & c1, const PIXEL_TYPE & c2, const PIXEL_TYPE & c3) {
373 if(dir >= 0) {
375 } else {
376 FUNCTION_FILL_GRADIENT_RGB3(leds + len + 1, -len, c3, c2, c1);
377 }
378 return *this;
379 }
380
387 inline CPixelView & fill_gradient_RGB(const PIXEL_TYPE & c1, const PIXEL_TYPE & c2, const PIXEL_TYPE & c3, const PIXEL_TYPE & c4) {
388 if(dir >= 0) {
389 FUNCTION_FILL_GRADIENT_RGB4(leds, len, c1, c2, c3, c4);
390 } else {
391 FUNCTION_FILL_GRADIENT_RGB4(leds + len + 1, -len, c4, c3, c2, c1);
392 }
393 return *this;
394 }
395
400 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; }
401
406 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; }
407
412 inline CPixelView & blur1d(fract8 blur_amount) {
413 if(dir >= 0) {
414 FUNCTION_BLUR1D(leds, len, blur_amount);
415 } else {
416 FUNCTION_BLUR1D(leds + len + 1, -len, blur_amount);
417 }
418 return *this;
419 }
420
424 inline CPixelView & napplyGamma_video(float gamma) {
425 if(dir >= 0) {
427 } else {
428 FUNCTION_NAPPLY_GAMMA(leds + len + 1, -len, gamma);
429 }
430 return *this;
431 }
432
438 inline CPixelView & napplyGamma_video(float gammaR, float gammaG, float gammaB) {
439 if(dir >= 0) {
440 FUNCTION_NAPPLY_GAMMA_RGB(leds, len, gammaR, gammaG, gammaB);
441 } else {
442 FUNCTION_NAPPLY_GAMMA_RGB(leds + len + 1, -len, gammaR, gammaG, gammaB);
443 }
444 return *this;
445 }
446
448
449
452
456 template <class T>
458 T * leds;
459 const int8_t dir;
460
461 public:
464
469 FASTLED_FORCE_INLINE pixelset_iterator_base(T * _leds, const char _dir) : leds(_leds), dir(_dir) {}
470
473
474 FASTLED_FORCE_INLINE bool operator==(pixelset_iterator_base & other) const { return leds == other.leds; /* && set==other.set; */ }
475 FASTLED_FORCE_INLINE bool operator!=(pixelset_iterator_base & other) const { return leds != other.leds; /* || set != other.set; */ }
476
477 FASTLED_FORCE_INLINE PIXEL_TYPE& operator*() const { return *leds; }
478 };
479
480 typedef pixelset_iterator_base<PIXEL_TYPE> iterator;
481 typedef pixelset_iterator_base<const PIXEL_TYPE> const_iterator;
482
483 iterator begin() { return iterator(leds, dir); }
484 iterator end() { return iterator(end_pos, dir); }
485
486 iterator begin() const { return iterator(leds, dir); }
487 iterator end() const { return iterator(end_pos, dir); }
488
491
493};
494
496CRGB *operator+(const CRGBSet & pixels, int offset) {
497 return (CRGB*)pixels + offset;
498}
499
500
503template<int SIZE>
504class CRGBArray : public CPixelView<CRGB> {
505 CRGB rawleds[SIZE] = {0};
506
507public:
509 using CPixelView::operator=;
510 CRGB* get() { return &rawleds[0]; }
511 const CRGB* get() const { return &rawleds[0]; }
512 size_t size() const { return SIZE; }
513};
514
516
518
519#undef FUNCTION_FILL_RAINBOW
520#undef FUNCTION_NAPPLY_GAMMA
521#undef FUNCTION_NAPPLY_GAMMA_RGB
522#undef FUNCTION_BLUR1D
523#undef FUNCTION_FILL_GRADIENT
524#undef FUNCTION_FILL_GRADIENT3
525#undef FUNCTION_FILL_GRADIENT4
526#undef FUNCTION_NBLEND
527#undef FUNCTION_FILL_GRADIENT_RGB
528#undef FUNCTION_FILL_GRADIENT_RGB3
529#undef FUNCTION_FILL_GRADIENT_RGB4
int x
Definition simple.h:92
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:474
FASTLED_FORCE_INLINE pixelset_iterator_base & operator++()
Increment LED pointer in data direction.
Definition pixelset.h:471
FASTLED_FORCE_INLINE pixelset_iterator_base operator++(int)
Increment LED pointer in data direction.
Definition pixelset.h:472
FASTLED_FORCE_INLINE pixelset_iterator_base(const pixelset_iterator_base &rhs)
Copy constructor.
Definition pixelset.h:463
FASTLED_FORCE_INLINE pixelset_iterator_base(T *_leds, const char _dir)
Base constructor.
Definition pixelset.h:469
FASTLED_FORCE_INLINE PIXEL_TYPE & operator*() const
Dereference operator, to get underlying pointer to the LEDs.
Definition pixelset.h:477
FASTLED_FORCE_INLINE bool operator!=(pixelset_iterator_base &other) const
Check if iterator is not at the same position.
Definition pixelset.h:475
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:126
CPixelView & nscale8(PIXEL_TYPE &scaledown)
Scale every LED by the given scale.
Definition pixelset.h:249
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:273
CPixelView & operator-=(CPixelView &rhs)
Subtract every pixel in the other set from this set.
Definition pixelset.h:208
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:387
CPixelView & fill_rainbow(uint8_t initialhue, uint8_t deltahue=5)
Fill all of the LEDs with a rainbow of colors.
Definition pixelset.h:298
CPixelView & addToRGB(uint8_t inc)
Add the passed in value to all channels for all of the pixels in this set.
Definition pixelset.h:201
CRGB *const leds
Definition pixelset.h:115
CPixelView & nscale8_video(uint8_t scaledown)
Scale every LED by the given scale.
Definition pixelset.h:240
CPixelView & operator--()
Decrement every pixel value in this set.
Definition pixelset.h:222
const_iterator cbegin() const
Makes a const iterator instance for the start of the LED set, const qualified.
Definition pixelset.h:489
const_iterator cend() const
Makes a const iterator instance for the end of the LED set, const qualified.
Definition pixelset.h:490
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:327
CPixelView & operator*=(uint8_t d)
Multiply every LED in this set by the given value.
Definition pixelset.h:237
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:259
bool reversed()
Whether or not this set goes backwards.
Definition pixelset.h:141
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:343
CPixelView & operator--(int DUMMY_ARG)
Decrement every pixel value in this set.
Definition pixelset.h:224
CPixelView & fill_solid(const CHSV &color)
Fill all of the LEDs with a solid color.
Definition pixelset.h:292
CPixelView & operator=(const CPixelView &rhs)
Copy the contents of the passed-in set to our set.
Definition pixelset.h:190
CPixelView & operator++(int DUMMY_ARG)
Increment every pixel value in this set.
Definition pixelset.h:213
iterator end()
Definition pixelset.h:484
CPixelView & operator+=(CPixelView &rhs)
Add every pixel in the other set to this set.
Definition pixelset.h:203
CPixelView & operator=(const PIXEL_TYPE &color)
Assign the passed in color to all elements in this set.
Definition pixelset.h:171
const int8_t dir
Definition pixelset.h:112
CPixelView & operator++()
Increment every pixel value in this set.
Definition pixelset.h:211
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:372
void dump() const
Print debug data to serial, disabled for release.
Definition pixelset.h:178
CPixelView & blur1d(fract8 blur_amount)
One-dimensional blur filter.
Definition pixelset.h:412
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:312
CPixelView & nblend(const PIXEL_TYPE &overlay, fract8 amountOfOverlay)
Destructively modifies all LEDs, blending in a given fraction of an overlay color.
Definition pixelset.h:400
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:270
CPixelView & operator%=(uint8_t scaledown)
Scale down every LED by the given scale.
Definition pixelset.h:242
pixelset_iterator_base< CRGB > iterator
Definition pixelset.h:480
CPixelView & operator/=(uint8_t d)
Divide every LED by the given value.
Definition pixelset.h:233
CPixelView & nscale8(uint8_t scaledown)
Scale every LED by the given scale.
Definition pixelset.h:247
CPixelView & operator>>=(uint8_t d)
Shift every LED in this set right by the given number of bits.
Definition pixelset.h:235
CPixelView operator()(int start, int end)
Access an inclusive subset of the LEDs in this set.
Definition pixelset.h:157
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:144
CPixelView & napplyGamma_video(float gamma)
Destructively applies a gamma adjustment to all LEDs.
Definition pixelset.h:424
CPixelView & fadeToBlackBy(uint8_t fade)
Fade every LED down by the given scale.
Definition pixelset.h:254
CPixelView & operator|=(uint8_t d)
Apply the PIXEL_TYPE |= operator to every pixel in this set.
Definition pixelset.h:265
CRGB *const end_pos
Definition pixelset.h:116
PIXEL_TYPE & operator[](int x) const
Access a single element in this set, just like an array operator.
Definition pixelset.h:150
CPixelView & subFromRGB(uint8_t inc)
Subtract the passed in value from all channels for all of the pixels in this set.
Definition pixelset.h:206
CPixelView & fadeLightBy(uint8_t fadefactor)
Fade every LED down by the given scale.
Definition pixelset.h:244
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:262
pixelset_iterator_base< const CRGB > const_iterator
Definition pixelset.h:481
CPixelView & nscale8(CPixelView &rhs)
Scale every LED in this set by every led in the other set.
Definition pixelset.h:251
CPixelView operator-()
Return the reverse ordering of this set.
Definition pixelset.h:164
CPixelView & fill_solid(const PIXEL_TYPE &color)
Fill all of the LEDs with a solid color.
Definition pixelset.h:290
CPixelView(PIXEL_TYPE *_leds, int _start, int _end)
PixelSet constructor for the given set of LEDs, with start and end boundaries.
Definition pixelset.h:133
CPixelView & operator&=(uint8_t d)
Apply the PIXEL_TYPE &= operator to every pixel in this set with the passed in value.
Definition pixelset.h:276
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:147
CPixelView & nblend(const CPixelView &rhs, fract8 amountOfOverlay)
Destructively blend another set of LEDs into this one.
Definition pixelset.h:406
iterator begin() const
Makes an iterator instance for the start of the LED set, const qualified.
Definition pixelset.h:486
iterator begin()
Makes an iterator instance for the start of the LED set.
Definition pixelset.h:483
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:357
iterator end() const
Makes an iterator instance for the end of the LED set, const qualified.
Definition pixelset.h:487
CPixelView & napplyGamma_video(float gammaR, float gammaG, float gammaB)
Destructively applies a gamma adjustment to all LEDs.
Definition pixelset.h:438
CPixelView(const CPixelView &other)
PixelSet copy constructor.
Definition pixelset.h:120
int size()
Get the size of this set.
Definition pixelset.h:137
Represents a view/window into a set of LED pixels, providing array-like access and rich color operati...
Definition pixelset.h:110
CRGB rawleds[SIZE]
the LED data
Definition pixelset.h:505
CRGB * get()
Definition pixelset.h:510
size_t size() const
Definition pixelset.h:512
const CRGB * get() const
Definition pixelset.h:511
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
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:496
#define FASTLED_NAMESPACE_END
Definition namespace.h:23
#define FASTLED_NAMESPACE_BEGIN
Definition namespace.h:22
Implements the FastLED namespace macros.
@ SHORTEST_HUES
Hue goes whichever way is shortest.
u8 fract8
Fixed-Point Fractional Types.
Definition int.h:49
#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:59
#define FUNCTION_FILL_RAINBOW(a, b, c, d)
Definition pixelset.h:14
Representation of an RGB pixel (Red, Green, Blue)
Definition crgb.h:86
Representation of an HSV pixel (hue, saturation, value (aka brightness)).
Definition hsv.h:15
#define FASTLED_UNUSED(x)
Definition unused.h:4