FastLED 3.9.3
|
Represents a set of LED objects.
Provides the [] array operator, and works like a normal array in that case. This should be kept in sync with the set of functions provided by the other Pixel Data Types (CRGB/CHSV) as well as functions in colorutils.h.
PIXEL_TYPE | the type of LED data referenced in the class, e.g. CRGB. |
Definition at line 65 of file pixelset.h.
#include <pixelset.h>
Classes | |
class | pixelset_iterator_base |
Iterator helper class for CPixelView. More... | |
Public Member Functions | |
CPixelView (const CPixelView &other) | |
PixelSet copy constructor. | |
CPixelView (PIXEL_TYPE *_leds, int _len) | |
PixelSet constructor for a pixel set starting at the given PIXEL_TYPE* and going for _len leds. | |
CPixelView (PIXEL_TYPE *_leds, int _start, int _end) | |
PixelSet constructor for the given set of LEDs, with start and end boundaries. | |
int | size () |
Get the size of this set. | |
bool | reversed () |
Whether or not this set goes backwards. | |
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 the same. | |
bool | operator!= (const CPixelView &rhs) const |
Do these sets point to different things? Note that this is different from the contents of the set being the same. | |
PIXEL_TYPE & | operator[] (int x) const |
Access a single element in this set, just like an array operator. | |
CPixelView | operator() (int start, int end) |
Access an inclusive subset of the LEDs in this set. | |
CPixelView | operator- () |
Return the reverse ordering of this set. | |
operator PIXEL_TYPE * () const | |
Return a pointer to the first element in this set. | |
CPixelView & | operator= (const PIXEL_TYPE &color) |
Assign the passed in color to all elements in this set. | |
void | dump () const |
Print debug data to serial, disabled for release. | |
CPixelView & | operator= (const CPixelView &rhs) |
Copy the contents of the passed-in set to our set. | |
operator bool () | |
Returns whether or not any LEDs in this set are non-zero. | |
Modification/Scaling Operators | |
CPixelView & | addToRGB (uint8_t inc) |
Add the passed in value to all channels for all of the pixels in this set. | |
CPixelView & | operator+= (CPixelView &rhs) |
Add every pixel in the other set to this set. | |
CPixelView & | subFromRGB (uint8_t inc) |
Subtract the passed in value from all channels for all of the pixels in this set. | |
CPixelView & | operator-= (CPixelView &rhs) |
Subtract every pixel in the other set from this set. | |
CPixelView & | operator++ () |
Increment every pixel value in this set. | |
CPixelView & | operator++ (int DUMMY_ARG) |
Increment every pixel value in this set. | |
CPixelView & | operator-- () |
Decrement every pixel value in this set. | |
CPixelView & | operator-- (int DUMMY_ARG) |
Decrement every pixel value in this set. | |
CPixelView & | operator/= (uint8_t d) |
Divide every LED by the given value. | |
CPixelView & | operator>>= (uint8_t d) |
Shift every LED in this set right by the given number of bits. | |
CPixelView & | operator*= (uint8_t d) |
Multiply every LED in this set by the given value. | |
CPixelView & | nscale8_video (uint8_t scaledown) |
Scale every LED by the given scale. | |
CPixelView & | operator%= (uint8_t scaledown) |
Scale down every LED by the given scale. | |
CPixelView & | fadeLightBy (uint8_t fadefactor) |
Fade every LED down by the given scale. | |
CPixelView & | nscale8 (uint8_t scaledown) |
Scale every LED by the given scale. | |
CPixelView & | nscale8 (PIXEL_TYPE &scaledown) |
Scale every LED by the given scale. | |
CPixelView & | nscale8 (CPixelView &rhs) |
Scale every LED in this set by every led in the other set. | |
CPixelView & | fadeToBlackBy (uint8_t fade) |
Fade every LED down by the given scale. | |
CPixelView & | operator|= (const PIXEL_TYPE &rhs) |
Apply the PIXEL_TYPE |= operator to every pixel in this set with the given PIXEL_TYPE value. | |
CPixelView & | operator|= (const CPixelView &rhs) |
Apply the PIXEL_TYPE |= operator to every pixel in this set with every pixel in the passed in set. | |
CPixelView & | operator|= (uint8_t d) |
Apply the PIXEL_TYPE |= operator to every pixel in this set. | |
CPixelView & | operator&= (const PIXEL_TYPE &rhs) |
Apply the PIXEL_TYPE &= operator to every pixel in this set with the given PIXEL_TYPE value. | |
CPixelView & | operator&= (const CPixelView &rhs) |
Apply the PIXEL_TYPE &= operator to every pixel in this set with every pixel in the passed in set. | |
CPixelView & | operator&= (uint8_t d) |
Apply the PIXEL_TYPE &= operator to every pixel in this set with the passed in value. | |
Color Util Functions | |
CPixelView & | fill_solid (const PIXEL_TYPE &color) |
Fill all of the LEDs with a solid color. | |
CPixelView & | fill_solid (const CHSV &color) |
Fill all of the LEDs with a solid color. | |
CPixelView & | fill_rainbow (uint8_t initialhue, uint8_t deltahue=5) |
Fill all of the LEDs with a rainbow of colors. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
CPixelView & | nblend (const PIXEL_TYPE &overlay, fract8 amountOfOverlay) |
Destructively modifies all LEDs, blending in a given fraction of an overlay color. | |
CPixelView & | nblend (const CPixelView &rhs, fract8 amountOfOverlay) |
Destructively blend another set of LEDs into this one. | |
CPixelView & | blur1d (fract8 blur_amount) |
One-dimensional blur filter. | |
CPixelView & | napplyGamma_video (float gamma) |
Destructively applies a gamma adjustment to all LEDs. | |
CPixelView & | napplyGamma_video (float gammaR, float gammaG, float gammaB) |
Destructively applies a gamma adjustment to all LEDs. | |
Public Attributes | |
const int8_t | dir |
direction of the LED data, either 1 or -1. Determines how the pointer is incremented. | |
const int | len |
length of the LED data, in PIXEL_TYPE units. | |
PIXEL_TYPE *const | leds |
pointer to the LED data | |
PIXEL_TYPE *const | end_pos |
pointer to the end position of the LED data | |
Iterator | |
typedef pixelset_iterator_base< PIXEL_TYPE > | iterator |
Iterator helper type for this class. | |
typedef pixelset_iterator_base< const PIXEL_TYPE > | const_iterator |
Const iterator helper type for this class. | |
iterator | begin () |
Makes an iterator instance for the start of the LED set. | |
iterator | end () |
Makes an iterator instance for the end of the LED set. | |
iterator | begin () const |
Makes an iterator instance for the start of the LED set, const qualified. | |
iterator | end () const |
Makes an iterator instance for the end of the LED set, const qualified. | |
const_iterator | cbegin () const |
Makes a const iterator instance for the start of the LED set, const qualified. | |
const_iterator | cend () const |
Makes a const iterator instance for the end of the LED set, const qualified. | |
typedef pixelset_iterator_base<const PIXEL_TYPE> CPixelView< PIXEL_TYPE >::const_iterator |
Const iterator helper type for this class.
Definition at line 423 of file pixelset.h.
typedef pixelset_iterator_base<PIXEL_TYPE> CPixelView< PIXEL_TYPE >::iterator |
Iterator helper type for this class.
Definition at line 422 of file pixelset.h.
|
inline |
PixelSet copy constructor.
Definition at line 75 of file pixelset.h.
|
inline |
PixelSet constructor for a pixel set starting at the given PIXEL_TYPE*
and going for _len
leds.
Note that the length can be backwards, creating a PixelSet that walks backwards over the data
_leds | pointer to the raw LED data |
_len | how many LEDs in this set |
Definition at line 81 of file pixelset.h.
|
inline |
PixelSet constructor for the given set of LEDs, with start and end boundaries.
Note that start can be after end, resulting in a set that will iterate backwards
_leds | pointer to the raw LED data |
_start | the start index of the LEDs for this array |
_end | the end index of the LEDs for this array |
Definition at line 88 of file pixelset.h.
|
inline |
Add the passed in value to all channels for all of the pixels in this set.
Definition at line 156 of file pixelset.h.
|
inline |
Makes an iterator instance for the start of the LED set.
Definition at line 425 of file pixelset.h.
|
inline |
Makes an iterator instance for the start of the LED set, const qualified.
Definition at line 428 of file pixelset.h.
|
inline |
One-dimensional blur filter.
blur_amount | the amount of blur to apply |
Definition at line 354 of file pixelset.h.
|
inline |
Makes a const iterator instance for the start of the LED set, const qualified.
Definition at line 431 of file pixelset.h.
|
inline |
Makes a const iterator instance for the end of the LED set, const qualified.
Definition at line 432 of file pixelset.h.
|
inline |
Print debug data to serial, disabled for release.
Edit this file to re-enable these for debugging purposes.
Definition at line 133 of file pixelset.h.
|
inline |
Makes an iterator instance for the end of the LED set.
Definition at line 426 of file pixelset.h.
|
inline |
Makes an iterator instance for the end of the LED set, const qualified.
Definition at line 429 of file pixelset.h.
|
inline |
Fade every LED down by the given scale.
Definition at line 187 of file pixelset.h.
|
inline |
Fade every LED down by the given scale.
Definition at line 197 of file pixelset.h.
|
inline |
Fill all of the LEDs with a smooth HSV gradient between four HSV colors.
c1 | the starting color in the gradient |
c2 | the first middle color for the gradient |
c3 | the second middle color for the gradient |
c4 | the end color for the gradient |
directionCode | the direction to travel around the color wheel |
Definition at line 286 of file pixelset.h.
|
inline |
Fill all of the LEDs with a smooth HSV gradient between three HSV colors.
c1 | the starting color in the gradient |
c2 | the middle color for the gradient |
c3 | the end color for the gradient |
directionCode | the direction to travel around the color wheel |
Definition at line 270 of file pixelset.h.
|
inline |
Fill all of the LEDs with a smooth HSV gradient between two HSV colors.
startcolor | the starting color in the gradient |
endcolor | the end color for the gradient |
directionCode | the direction to travel around the color wheel |
Definition at line 255 of file pixelset.h.
|
inline |
Fill all of the LEDs with a smooth RGB gradient between three RGB colors.
c1 | the starting color in the gradient |
c2 | the middle color for the gradient |
c3 | the end color for the gradient |
Definition at line 314 of file pixelset.h.
|
inline |
Fill all of the LEDs with a smooth RGB gradient between four RGB colors.
c1 | the starting color in the gradient |
c2 | the first middle color for the gradient |
c3 | the second middle color for the gradient |
c4 | the end color for the gradient |
Definition at line 329 of file pixelset.h.
|
inline |
Fill all of the LEDs with a smooth RGB gradient between two RGB colors.
startcolor | the starting color in the gradient |
endcolor | the end color for the gradient |
directionCode | the direction to travel around the color wheel |
Definition at line 300 of file pixelset.h.
|
inline |
Fill all of the LEDs with a rainbow of colors.
initialhue | the starting hue for the rainbow |
deltahue | how many hue values to advance for each LED |
Definition at line 241 of file pixelset.h.
|
inline |
Fill all of the LEDs with a solid color.
color | the color to fill with |
Definition at line 235 of file pixelset.h.
|
inline |
Fill all of the LEDs with a solid color.
color | the color to fill with |
Definition at line 233 of file pixelset.h.
|
inline |
Destructively applies a gamma adjustment to all LEDs.
gamma | the gamma value to apply |
Definition at line 366 of file pixelset.h.
|
inline |
Destructively applies a gamma adjustment to all LEDs.
gammaR | the gamma value to apply to the CRGB::red channel |
gammaG | the gamma value to apply to the CRGB::green channel |
gammaB | the gamma value to apply to the CRGB::blue channel |
Definition at line 380 of file pixelset.h.
|
inline |
Destructively blend another set of LEDs into this one.
rhs | the set of LEDs to blend into this set |
amountOfOverlay | the fraction of each color in the other set to blend in |
Definition at line 348 of file pixelset.h.
|
inline |
Destructively modifies all LEDs, blending in a given fraction of an overlay color.
overlay | the color to blend in |
amountOfOverlay | the fraction of overlay to blend in |
Definition at line 342 of file pixelset.h.
|
inline |
Scale every LED in this set by every led in the other set.
Definition at line 194 of file pixelset.h.
|
inline |
Scale every LED by the given scale.
Definition at line 192 of file pixelset.h.
|
inline |
Scale every LED by the given scale.
Definition at line 190 of file pixelset.h.
|
inline |
Scale every LED by the given scale.
Definition at line 183 of file pixelset.h.
|
inline |
Returns whether or not any LEDs in this set are non-zero.
Definition at line 225 of file pixelset.h.
|
inline |
Return a pointer to the first element in this set.
Definition at line 122 of file pixelset.h.
|
inline |
Do these sets point to different things? Note that this is different from the contents of the set being the same.
Definition at line 102 of file pixelset.h.
|
inline |
Scale down every LED by the given scale.
Definition at line 185 of file pixelset.h.
|
inline |
Apply the PIXEL_TYPE &= operator to every pixel in this set with every pixel in the passed in set.
With CRGB, this brings up each channel down to the lower of the two values
Definition at line 216 of file pixelset.h.
|
inline |
Apply the PIXEL_TYPE &= operator to every pixel in this set with the given PIXEL_TYPE value.
With CRGB, this brings up each channel down to the lower of the two values
Definition at line 213 of file pixelset.h.
|
inline |
Apply the PIXEL_TYPE &= operator to every pixel in this set with the passed in value.
With CRGB, this brings up each channel down to the lower of the two values
Definition at line 219 of file pixelset.h.
|
inline |
Access an inclusive subset of the LEDs in this set.
start | the first element from this set for the new subset |
end | the last element for the new subset |
Definition at line 112 of file pixelset.h.
|
inline |
Multiply every LED in this set by the given value.
Definition at line 180 of file pixelset.h.
|
inline |
Increment every pixel value in this set.
Definition at line 166 of file pixelset.h.
|
inline |
Increment every pixel value in this set.
Definition at line 168 of file pixelset.h.
|
inline |
Add every pixel in the other set to this set.
Definition at line 158 of file pixelset.h.
|
inline |
Return the reverse ordering of this set.
Definition at line 119 of file pixelset.h.
|
inline |
Decrement every pixel value in this set.
Definition at line 171 of file pixelset.h.
|
inline |
Decrement every pixel value in this set.
Definition at line 173 of file pixelset.h.
|
inline |
Subtract every pixel in the other set from this set.
Definition at line 163 of file pixelset.h.
|
inline |
Divide every LED by the given value.
Definition at line 176 of file pixelset.h.
|
inline |
Copy the contents of the passed-in set to our set.
Definition at line 145 of file pixelset.h.
|
inline |
Assign the passed in color to all elements in this set.
color | the new color for the elements in the set |
Definition at line 126 of file pixelset.h.
|
inline |
Do these sets point to the same thing? Note that this is different from the contents of the set being the same.
Definition at line 99 of file pixelset.h.
|
inline |
Shift every LED in this set right by the given number of bits.
Definition at line 178 of file pixelset.h.
|
inline |
Access a single element in this set, just like an array operator.
Definition at line 105 of file pixelset.h.
|
inline |
Apply the PIXEL_TYPE |= operator to every pixel in this set with every pixel in the passed in set.
With CRGB, this brings up each channel to the higher of the two values
Definition at line 205 of file pixelset.h.
|
inline |
Apply the PIXEL_TYPE |= operator to every pixel in this set with the given PIXEL_TYPE value.
With CRGB, this brings up each channel to the higher of the two values
Definition at line 202 of file pixelset.h.
|
inline |
Apply the PIXEL_TYPE |= operator to every pixel in this set.
With CRGB, this brings up each channel to the higher of the two values
Definition at line 208 of file pixelset.h.
|
inline |
Whether or not this set goes backwards.
Definition at line 96 of file pixelset.h.
|
inline |
Get the size of this set.
Definition at line 92 of file pixelset.h.
|
inline |
Subtract the passed in value from all channels for all of the pixels in this set.
Definition at line 161 of file pixelset.h.
const int8_t CPixelView< PIXEL_TYPE >::dir |
direction of the LED data, either 1 or -1. Determines how the pointer is incremented.
Definition at line 67 of file pixelset.h.
PIXEL_TYPE* const CPixelView< PIXEL_TYPE >::end_pos |
pointer to the end position of the LED data
Definition at line 71 of file pixelset.h.
PIXEL_TYPE* const CPixelView< PIXEL_TYPE >::leds |
pointer to the LED data
Definition at line 70 of file pixelset.h.
const int CPixelView< PIXEL_TYPE >::len |
length of the LED data, in PIXEL_TYPE units.
More accurately, it's the distance from the start of the CPixelView::leds array to the end of the set (CPixelView::end_pos)
Definition at line 68 of file pixelset.h.