FastLED 3.9.7
Loading...
Searching...
No Matches
CRGBArray< SIZE > Class Template Reference

Detailed Description

template<int SIZE>
class CRGBArray< SIZE >

A version of CPixelView<CRGB> with an included array of CRGB LEDs.

Template Parameters
SIZEthe number of LEDs to include in the array
Examples
RGBSetDemo.ino.

Definition at line 460 of file pixelset.h.

#include <pixelset.h>

+ Inheritance diagram for CRGBArray< SIZE >:

Public Member Functions

CRGBget ()
 
const CRGBget () const
 
size_t size () const
 
CPixelViewoperator= (const PIXEL_TYPE &color)
 Assign the passed in color to all elements in this set.
 
CPixelViewoperator= (const CPixelView &rhs)
 Copy the contents of the passed-in set to our set.
 
- Public Member Functions inherited from CPixelView< CRGB >
 CPixelView (const CPixelView &other)
 PixelSet copy constructor.
 
 CPixelView (CRGB *_leds, int _len)
 PixelSet constructor for a pixel set starting at the given PIXEL_TYPE* and going for _len leds.
 
 CPixelView (CRGB *_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.
 
CRGBoperator[] (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 CRGB * () const
 Return a pointer to the first element in this set.
 
CPixelViewoperator= (const CRGB &color)
 Assign the passed in color to all elements in this set.
 
CPixelViewoperator= (const CPixelView &rhs)
 Copy the contents of the passed-in set to our set.
 
void dump () const
 Print debug data to serial, disabled for release.
 
 operator bool ()
 Returns whether or not any LEDs in this set are non-zero.
 
CPixelViewaddToRGB (uint8_t inc)
 Add the passed in value to all channels for all of the pixels in this set.
 
CPixelViewoperator+= (CPixelView &rhs)
 Add every pixel in the other set to this set.
 
CPixelViewsubFromRGB (uint8_t inc)
 Subtract the passed in value from all channels for all of the pixels in this set.
 
CPixelViewoperator-= (CPixelView &rhs)
 Subtract every pixel in the other set from this set.
 
CPixelViewoperator++ ()
 Increment every pixel value in this set.
 
CPixelViewoperator++ (int DUMMY_ARG)
 Increment every pixel value in this set.
 
CPixelViewoperator-- ()
 Decrement every pixel value in this set.
 
CPixelViewoperator-- (int DUMMY_ARG)
 Decrement every pixel value in this set.
 
CPixelViewoperator/= (uint8_t d)
 Divide every LED by the given value.
 
CPixelViewoperator>>= (uint8_t d)
 Shift every LED in this set right by the given number of bits.
 
CPixelViewoperator*= (uint8_t d)
 Multiply every LED in this set by the given value.
 
CPixelViewnscale8_video (uint8_t scaledown)
 Scale every LED by the given scale.
 
CPixelViewoperator%= (uint8_t scaledown)
 Scale down every LED by the given scale.
 
CPixelViewfadeLightBy (uint8_t fadefactor)
 Fade every LED down by the given scale.
 
CPixelViewnscale8 (uint8_t scaledown)
 Scale every LED by the given scale.
 
CPixelViewnscale8 (CRGB &scaledown)
 Scale every LED by the given scale.
 
CPixelViewnscale8 (CPixelView &rhs)
 Scale every LED in this set by every led in the other set.
 
CPixelViewfadeToBlackBy (uint8_t fade)
 Fade every LED down by the given scale.
 
CPixelViewoperator|= (const CRGB &rhs)
 Apply the PIXEL_TYPE |= operator to every pixel in this set with the given PIXEL_TYPE value.
 
CPixelViewoperator|= (const CPixelView &rhs)
 Apply the PIXEL_TYPE |= operator to every pixel in this set with every pixel in the passed in set.
 
CPixelViewoperator|= (uint8_t d)
 Apply the PIXEL_TYPE |= operator to every pixel in this set.
 
CPixelViewoperator&= (const CRGB &rhs)
 Apply the PIXEL_TYPE &= operator to every pixel in this set with the given PIXEL_TYPE value.
 
CPixelViewoperator&= (const CPixelView &rhs)
 Apply the PIXEL_TYPE &= operator to every pixel in this set with every pixel in the passed in set.
 
CPixelViewoperator&= (uint8_t d)
 Apply the PIXEL_TYPE &= operator to every pixel in this set with the passed in value.
 
CPixelViewfill_solid (const CRGB &color)
 Fill all of the LEDs with a solid color.
 
CPixelViewfill_solid (const CHSV &color)
 Fill all of the LEDs with a solid color.
 
CPixelViewfill_rainbow (uint8_t initialhue, uint8_t deltahue=5)
 Fill all of the LEDs with a rainbow of colors.
 
CPixelViewfill_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.
 
CPixelViewfill_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.
 
CPixelViewfill_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.
 
CPixelViewfill_gradient_RGB (const CRGB &startcolor, const CRGB &endcolor, TGradientDirectionCode directionCode=SHORTEST_HUES)
 Fill all of the LEDs with a smooth RGB gradient between two RGB colors.
 
CPixelViewfill_gradient_RGB (const CRGB &c1, const CRGB &c2, const CRGB &c3)
 Fill all of the LEDs with a smooth RGB gradient between three RGB colors.
 
CPixelViewfill_gradient_RGB (const CRGB &c1, const CRGB &c2, const CRGB &c3, const CRGB &c4)
 Fill all of the LEDs with a smooth RGB gradient between four RGB colors.
 
CPixelViewnblend (const CRGB &overlay, fract8 amountOfOverlay)
 Destructively modifies all LEDs, blending in a given fraction of an overlay color.
 
CPixelViewnblend (const CPixelView &rhs, fract8 amountOfOverlay)
 Destructively blend another set of LEDs into this one.
 
CPixelViewblur1d (fract8 blur_amount)
 One-dimensional blur filter.
 
CPixelViewnapplyGamma_video (float gamma)
 Destructively applies a gamma adjustment to all LEDs.
 
CPixelViewnapplyGamma_video (float gammaR, float gammaG, float gammaB)
 Destructively applies a gamma adjustment to all LEDs.
 
iterator begin ()
 Makes an iterator instance for the start of the LED set.
 
iterator begin () const
 Makes an iterator instance for the start of the LED set, const qualified.
 
iterator end ()
 Makes an iterator instance for the end of the LED set.
 
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.
 

Additional Inherited Members

- Public Types inherited from CPixelView< CRGB >
typedef pixelset_iterator_base< CRGBiterator
 Iterator helper type for this class.
 
typedef pixelset_iterator_base< const CRGBconst_iterator
 Const iterator helper type for this class.
 
- Public Attributes inherited from CPixelView< CRGB >
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.
 
CRGB *const leds
 pointer to the LED data
 
CRGB *const end_pos
 pointer to the end position of the LED data
 

Constructor & Destructor Documentation

◆ CRGBArray()

template<int SIZE>
CRGBArray< SIZE >::CRGBArray ( )
inline

Definition at line 464 of file pixelset.h.

Member Function Documentation

◆ get() [1/2]

template<int SIZE>
CRGB * CRGBArray< SIZE >::get ( )
inline

Definition at line 466 of file pixelset.h.

◆ get() [2/2]

template<int SIZE>
const CRGB * CRGBArray< SIZE >::get ( ) const
inline

Definition at line 467 of file pixelset.h.

◆ operator=() [1/2]

template<int SIZE>
CPixelView & CPixelView< PIXEL_TYPE >::operator= ( const CPixelView & rhs)
inline

Copy the contents of the passed-in set to our set.

Note
If one set is smaller than the other, only the smallest number of items will be copied over.

Definition at line 146 of file pixelset.h.

◆ operator=() [2/2]

template<int SIZE>
CPixelView & CPixelView< PIXEL_TYPE >::operator= ( const PIXEL_TYPE & color)
inline

Assign the passed in color to all elements in this set.

Parameters
colorthe new color for the elements in the set

Definition at line 127 of file pixelset.h.

◆ size()

template<int SIZE>
size_t CRGBArray< SIZE >::size ( ) const
inline

Definition at line 468 of file pixelset.h.


The documentation for this class was generated from the following file: