FastLED 3.9.7
Loading...
Searching...
No Matches
CPixelView< PIXEL_TYPE > Class Template Reference

Detailed Description

template<class PIXEL_TYPE>
class CPixelView< PIXEL_TYPE >

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.

Template Parameters
PIXEL_TYPEthe type of LED data referenced in the class, e.g. CRGB.
Note
A pixel set is a window into another set of LED data, it is not its own set of LED data.

Definition at line 66 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.
 
CPixelViewoperator= (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.
 
CPixelViewoperator= (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
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 (PIXEL_TYPE &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 PIXEL_TYPE &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 PIXEL_TYPE &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.
 
Color Util Functions
CPixelViewfill_solid (const PIXEL_TYPE &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 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.
 
CPixelViewfill_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.
 
CPixelViewfill_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.
 
CPixelViewnblend (const PIXEL_TYPE &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.
 

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.
 

Member Typedef Documentation

◆ const_iterator

template<class PIXEL_TYPE >
typedef pixelset_iterator_base<const PIXEL_TYPE> CPixelView< PIXEL_TYPE >::const_iterator

Const iterator helper type for this class.

Definition at line 437 of file pixelset.h.

◆ iterator

template<class PIXEL_TYPE >
typedef pixelset_iterator_base<PIXEL_TYPE> CPixelView< PIXEL_TYPE >::iterator

Iterator helper type for this class.

Definition at line 436 of file pixelset.h.

Constructor & Destructor Documentation

◆ CPixelView() [1/3]

template<class PIXEL_TYPE >
CPixelView< PIXEL_TYPE >::CPixelView ( const CPixelView< PIXEL_TYPE > & other)
inline

PixelSet copy constructor.

Definition at line 76 of file pixelset.h.

◆ CPixelView() [2/3]

template<class PIXEL_TYPE >
CPixelView< PIXEL_TYPE >::CPixelView ( PIXEL_TYPE * _leds,
int _len )
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

Parameters
_ledspointer to the raw LED data
_lenhow many LEDs in this set

Definition at line 82 of file pixelset.h.

◆ CPixelView() [3/3]

template<class PIXEL_TYPE >
CPixelView< PIXEL_TYPE >::CPixelView ( PIXEL_TYPE * _leds,
int _start,
int _end )
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

Parameters
_ledspointer to the raw LED data
_startthe start index of the LEDs for this array
_endthe end index of the LEDs for this array

Definition at line 89 of file pixelset.h.

Member Function Documentation

◆ addToRGB()

template<class PIXEL_TYPE >
CPixelView & CPixelView< PIXEL_TYPE >::addToRGB ( uint8_t inc)
inline

Add the passed in value to all channels for all of the pixels in this set.

Definition at line 157 of file pixelset.h.

◆ begin() [1/2]

template<class PIXEL_TYPE >
iterator CPixelView< PIXEL_TYPE >::begin ( )
inline

Makes an iterator instance for the start of the LED set.

Definition at line 439 of file pixelset.h.

◆ begin() [2/2]

template<class PIXEL_TYPE >
iterator CPixelView< PIXEL_TYPE >::begin ( ) const
inline

Makes an iterator instance for the start of the LED set, const qualified.

Definition at line 442 of file pixelset.h.

◆ blur1d()

template<class PIXEL_TYPE >
CPixelView & CPixelView< PIXEL_TYPE >::blur1d ( fract8 blur_amount)
inline

One-dimensional blur filter.

Parameters
blur_amountthe amount of blur to apply
Note
Only bringing in a 1d blur, not sure 2d blur makes sense when looking at sub arrays
See also
blur1d(CRGB*, uint16_t, fract8)

Definition at line 368 of file pixelset.h.

◆ cbegin()

template<class PIXEL_TYPE >
const_iterator CPixelView< PIXEL_TYPE >::cbegin ( ) const
inline

Makes a const iterator instance for the start of the LED set, const qualified.

Definition at line 445 of file pixelset.h.

◆ cend()

template<class PIXEL_TYPE >
const_iterator CPixelView< PIXEL_TYPE >::cend ( ) const
inline

Makes a const iterator instance for the end of the LED set, const qualified.

Definition at line 446 of file pixelset.h.

◆ dump()

template<class PIXEL_TYPE >
void CPixelView< PIXEL_TYPE >::dump ( ) const
inline

Print debug data to serial, disabled for release.

Edit this file to re-enable these for debugging purposes.

Serial.print("len: "); Serial.print(len); Serial.print(", dir:"); Serial.print((int)dir);
Serial.print(", range:"); Serial.print((uint32_t)leds); Serial.print("-"); Serial.print((uint32_t)end_pos);
Serial.print(", diff:"); Serial.print((int32_t)(end_pos - leds));
Serial.println("");
PIXEL_TYPE *const leds
pointer to the LED data
Definition pixelset.h:71
const int8_t dir
direction of the LED data, either 1 or -1. Determines how the pointer is incremented.
Definition pixelset.h:68
PIXEL_TYPE *const end_pos
pointer to the end position of the LED data
Definition pixelset.h:72
const int len
length of the LED data, in PIXEL_TYPE units.
Definition pixelset.h:69

Definition at line 134 of file pixelset.h.

◆ end() [1/2]

template<class PIXEL_TYPE >
iterator CPixelView< PIXEL_TYPE >::end ( )
inline

Makes an iterator instance for the end of the LED set.

Definition at line 440 of file pixelset.h.

◆ end() [2/2]

template<class PIXEL_TYPE >
iterator CPixelView< PIXEL_TYPE >::end ( ) const
inline

Makes an iterator instance for the end of the LED set, const qualified.

Definition at line 443 of file pixelset.h.

◆ fadeLightBy()

template<class PIXEL_TYPE >
CPixelView & CPixelView< PIXEL_TYPE >::fadeLightBy ( uint8_t fadefactor)
inline

Fade every LED down by the given scale.

Definition at line 200 of file pixelset.h.

◆ fadeToBlackBy()

template<class PIXEL_TYPE >
CPixelView & CPixelView< PIXEL_TYPE >::fadeToBlackBy ( uint8_t fade)
inline

Fade every LED down by the given scale.

Definition at line 210 of file pixelset.h.

◆ fill_gradient() [1/3]

template<class PIXEL_TYPE >
CPixelView & CPixelView< PIXEL_TYPE >::fill_gradient ( const CHSV & c1,
const CHSV & c2,
const CHSV & c3,
const CHSV & c4,
TGradientDirectionCode directionCode = SHORTEST_HUES )
inline

Fill all of the LEDs with a smooth HSV gradient between four HSV colors.

Parameters
c1the starting color in the gradient
c2the first middle color for the gradient
c3the second middle color for the gradient
c4the end color for the gradient
directionCodethe direction to travel around the color wheel
See also
fill_gradient(T*, uint16_t, const CHSV&, const CHSV&, const CHSV&, const CHSV&, TGradientDirectionCode)

Definition at line 299 of file pixelset.h.

◆ fill_gradient() [2/3]

template<class PIXEL_TYPE >
CPixelView & CPixelView< PIXEL_TYPE >::fill_gradient ( const CHSV & c1,
const CHSV & c2,
const CHSV & c3,
TGradientDirectionCode directionCode = SHORTEST_HUES )
inline

Fill all of the LEDs with a smooth HSV gradient between three HSV colors.

Parameters
c1the starting color in the gradient
c2the middle color for the gradient
c3the end color for the gradient
directionCodethe direction to travel around the color wheel
See also
fill_gradient(T*, uint16_t, const CHSV&, const CHSV&, const CHSV&, TGradientDirectionCode)

Definition at line 283 of file pixelset.h.

◆ fill_gradient() [3/3]

template<class PIXEL_TYPE >
CPixelView & CPixelView< PIXEL_TYPE >::fill_gradient ( const CHSV & startcolor,
const CHSV & endcolor,
TGradientDirectionCode directionCode = SHORTEST_HUES )
inline

Fill all of the LEDs with a smooth HSV gradient between two HSV colors.

Parameters
startcolorthe starting color in the gradient
endcolorthe end color for the gradient
directionCodethe direction to travel around the color wheel
See also
fill_gradient(T*, uint16_t, const CHSV&, const CHSV&, TGradientDirectionCode)

Definition at line 268 of file pixelset.h.

◆ fill_gradient_RGB() [1/3]

template<class PIXEL_TYPE >
CPixelView & CPixelView< PIXEL_TYPE >::fill_gradient_RGB ( const PIXEL_TYPE & c1,
const PIXEL_TYPE & c2,
const PIXEL_TYPE & c3 )
inline

Fill all of the LEDs with a smooth RGB gradient between three RGB colors.

Parameters
c1the starting color in the gradient
c2the middle color for the gradient
c3the end color for the gradient
See also
fill_gradient_RGB(CRGB*, uint16_t, const CRGB&, const CRGB&, const CRGB&)

Definition at line 328 of file pixelset.h.

◆ fill_gradient_RGB() [2/3]

template<class PIXEL_TYPE >
CPixelView & CPixelView< PIXEL_TYPE >::fill_gradient_RGB ( const PIXEL_TYPE & c1,
const PIXEL_TYPE & c2,
const PIXEL_TYPE & c3,
const PIXEL_TYPE & c4 )
inline

Fill all of the LEDs with a smooth RGB gradient between four RGB colors.

Parameters
c1the starting color in the gradient
c2the first middle color for the gradient
c3the second middle color for the gradient
c4the end color for the gradient
See also
fill_gradient_RGB(CRGB*, uint16_t, const CRGB&, const CRGB&, const CRGB&, const CRGB&)

Definition at line 343 of file pixelset.h.

◆ fill_gradient_RGB() [3/3]

template<class PIXEL_TYPE >
CPixelView & CPixelView< PIXEL_TYPE >::fill_gradient_RGB ( const PIXEL_TYPE & startcolor,
const PIXEL_TYPE & endcolor,
TGradientDirectionCode directionCode = SHORTEST_HUES )
inline

Fill all of the LEDs with a smooth RGB gradient between two RGB colors.

Parameters
startcolorthe starting color in the gradient
endcolorthe end color for the gradient
directionCodethe direction to travel around the color wheel
See also
fill_gradient_RGB(CRGB*, uint16_t, const CRGB&, const CRGB&)

Definition at line 313 of file pixelset.h.

◆ fill_rainbow()

template<class PIXEL_TYPE >
CPixelView & CPixelView< PIXEL_TYPE >::fill_rainbow ( uint8_t initialhue,
uint8_t deltahue = 5 )
inline

Fill all of the LEDs with a rainbow of colors.

Parameters
initialhuethe starting hue for the rainbow
deltahuehow many hue values to advance for each LED
See also
fill_rainbow(struct CRGB*, int, uint8_t, uint8_t)

Definition at line 254 of file pixelset.h.

◆ fill_solid() [1/2]

template<class PIXEL_TYPE >
CPixelView & CPixelView< PIXEL_TYPE >::fill_solid ( const CHSV & color)
inline

Fill all of the LEDs with a solid color.

Parameters
colorthe color to fill with

Definition at line 248 of file pixelset.h.

◆ fill_solid() [2/2]

template<class PIXEL_TYPE >
CPixelView & CPixelView< PIXEL_TYPE >::fill_solid ( const PIXEL_TYPE & color)
inline

Fill all of the LEDs with a solid color.

Parameters
colorthe color to fill with

Definition at line 246 of file pixelset.h.

◆ napplyGamma_video() [1/2]

template<class PIXEL_TYPE >
CPixelView & CPixelView< PIXEL_TYPE >::napplyGamma_video ( float gamma)
inline

Destructively applies a gamma adjustment to all LEDs.

Parameters
gammathe gamma value to apply
See also
napplyGamma_video(CRGB&, float)

Definition at line 380 of file pixelset.h.

◆ napplyGamma_video() [2/2]

template<class PIXEL_TYPE >
CPixelView & CPixelView< PIXEL_TYPE >::napplyGamma_video ( float gammaR,
float gammaG,
float gammaB )
inline

Destructively applies a gamma adjustment to all LEDs.

Parameters
gammaRthe gamma value to apply to the CRGB::red channel
gammaGthe gamma value to apply to the CRGB::green channel
gammaBthe gamma value to apply to the CRGB::blue channel
See also
napplyGamma_video(CRGB&, float, float, float)

Definition at line 394 of file pixelset.h.

◆ nblend() [1/2]

template<class PIXEL_TYPE >
CPixelView & CPixelView< PIXEL_TYPE >::nblend ( const CPixelView< PIXEL_TYPE > & rhs,
fract8 amountOfOverlay )
inline

Destructively blend another set of LEDs into this one.

Parameters
rhsthe set of LEDs to blend into this set
amountOfOverlaythe fraction of each color in the other set to blend in
See also
nblend(CRGB&, const CRGB&, fract8)

Definition at line 362 of file pixelset.h.

◆ nblend() [2/2]

template<class PIXEL_TYPE >
CPixelView & CPixelView< PIXEL_TYPE >::nblend ( const PIXEL_TYPE & overlay,
fract8 amountOfOverlay )
inline

Destructively modifies all LEDs, blending in a given fraction of an overlay color.

Parameters
overlaythe color to blend in
amountOfOverlaythe fraction of overlay to blend in
See also
nblend(CRGB&, const CRGB&, fract8)

Definition at line 356 of file pixelset.h.

◆ nscale8() [1/3]

template<class PIXEL_TYPE >
CPixelView & CPixelView< PIXEL_TYPE >::nscale8 ( CPixelView< PIXEL_TYPE > & rhs)
inline

Scale every LED in this set by every led in the other set.

Definition at line 207 of file pixelset.h.

◆ nscale8() [2/3]

template<class PIXEL_TYPE >
CPixelView & CPixelView< PIXEL_TYPE >::nscale8 ( PIXEL_TYPE & scaledown)
inline

Scale every LED by the given scale.

Definition at line 205 of file pixelset.h.

◆ nscale8() [3/3]

template<class PIXEL_TYPE >
CPixelView & CPixelView< PIXEL_TYPE >::nscale8 ( uint8_t scaledown)
inline

Scale every LED by the given scale.

Definition at line 203 of file pixelset.h.

◆ nscale8_video()

template<class PIXEL_TYPE >
CPixelView & CPixelView< PIXEL_TYPE >::nscale8_video ( uint8_t scaledown)
inline

Scale every LED by the given scale.

Definition at line 196 of file pixelset.h.

◆ operator bool()

template<class PIXEL_TYPE >
CPixelView< PIXEL_TYPE >::operator bool ( )
inline

Returns whether or not any LEDs in this set are non-zero.

Definition at line 238 of file pixelset.h.

◆ operator PIXEL_TYPE *()

template<class PIXEL_TYPE >
CPixelView< PIXEL_TYPE >::operator PIXEL_TYPE * ( ) const
inline

Return a pointer to the first element in this set.

Definition at line 123 of file pixelset.h.

◆ operator!=()

template<class PIXEL_TYPE >
bool CPixelView< PIXEL_TYPE >::operator!= ( const CPixelView< PIXEL_TYPE > & rhs) const
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 103 of file pixelset.h.

◆ operator%=()

template<class PIXEL_TYPE >
CPixelView & CPixelView< PIXEL_TYPE >::operator%= ( uint8_t scaledown)
inline

Scale down every LED by the given scale.

Definition at line 198 of file pixelset.h.

◆ operator&=() [1/3]

template<class PIXEL_TYPE >
CPixelView & CPixelView< PIXEL_TYPE >::operator&= ( const CPixelView< PIXEL_TYPE > & rhs)
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

See also
CRGB::operator&=

Definition at line 229 of file pixelset.h.

◆ operator&=() [2/3]

template<class PIXEL_TYPE >
CPixelView & CPixelView< PIXEL_TYPE >::operator&= ( const PIXEL_TYPE & rhs)
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

See also
CRGB::operator&=

Definition at line 226 of file pixelset.h.

◆ operator&=() [3/3]

template<class PIXEL_TYPE >
CPixelView & CPixelView< PIXEL_TYPE >::operator&= ( uint8_t d)
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

See also
CRGB::operator&=

Definition at line 232 of file pixelset.h.

◆ operator()()

template<class PIXEL_TYPE >
CPixelView CPixelView< PIXEL_TYPE >::operator() ( int start,
int end )
inline

Access an inclusive subset of the LEDs in this set.

Note
The start point can be greater than end, which will result in a reverse ordering for many functions (useful for mirroring).
Parameters
startthe first element from this set for the new subset
endthe last element for the new subset

Definition at line 113 of file pixelset.h.

◆ operator*=()

template<class PIXEL_TYPE >
CPixelView & CPixelView< PIXEL_TYPE >::operator*= ( uint8_t d)
inline

Multiply every LED in this set by the given value.

Definition at line 193 of file pixelset.h.

◆ operator++() [1/2]

template<class PIXEL_TYPE >
CPixelView & CPixelView< PIXEL_TYPE >::operator++ ( )
inline

Increment every pixel value in this set.

Definition at line 167 of file pixelset.h.

◆ operator++() [2/2]

template<class PIXEL_TYPE >
CPixelView & CPixelView< PIXEL_TYPE >::operator++ ( int DUMMY_ARG)
inline

Increment every pixel value in this set.

Definition at line 169 of file pixelset.h.

◆ operator+=()

template<class PIXEL_TYPE >
CPixelView & CPixelView< PIXEL_TYPE >::operator+= ( CPixelView< PIXEL_TYPE > & rhs)
inline

Add every pixel in the other set to this set.

Definition at line 159 of file pixelset.h.

◆ operator-()

template<class PIXEL_TYPE >
CPixelView CPixelView< PIXEL_TYPE >::operator- ( )
inline

Return the reverse ordering of this set.

Definition at line 120 of file pixelset.h.

◆ operator--() [1/2]

template<class PIXEL_TYPE >
CPixelView & CPixelView< PIXEL_TYPE >::operator-- ( )
inline

Decrement every pixel value in this set.

Definition at line 178 of file pixelset.h.

◆ operator--() [2/2]

template<class PIXEL_TYPE >
CPixelView & CPixelView< PIXEL_TYPE >::operator-- ( int DUMMY_ARG)
inline

Decrement every pixel value in this set.

Definition at line 180 of file pixelset.h.

◆ operator-=()

template<class PIXEL_TYPE >
CPixelView & CPixelView< PIXEL_TYPE >::operator-= ( CPixelView< PIXEL_TYPE > & rhs)
inline

Subtract every pixel in the other set from this set.

Definition at line 164 of file pixelset.h.

◆ operator/=()

template<class PIXEL_TYPE >
CPixelView & CPixelView< PIXEL_TYPE >::operator/= ( uint8_t d)
inline

Divide every LED by the given value.

Definition at line 189 of file pixelset.h.

◆ operator=() [1/2]

template<class PIXEL_TYPE >
CPixelView & CPixelView< PIXEL_TYPE >::operator= ( const CPixelView< PIXEL_TYPE > & 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<class PIXEL_TYPE >
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.

◆ operator==()

template<class PIXEL_TYPE >
bool CPixelView< PIXEL_TYPE >::operator== ( const CPixelView< PIXEL_TYPE > & rhs) const
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 100 of file pixelset.h.

◆ operator>>=()

template<class PIXEL_TYPE >
CPixelView & CPixelView< PIXEL_TYPE >::operator>>= ( uint8_t d)
inline

Shift every LED in this set right by the given number of bits.

Definition at line 191 of file pixelset.h.

◆ operator[]()

template<class PIXEL_TYPE >
PIXEL_TYPE & CPixelView< PIXEL_TYPE >::operator[] ( int x) const
inline

Access a single element in this set, just like an array operator.

Definition at line 106 of file pixelset.h.

◆ operator|=() [1/3]

template<class PIXEL_TYPE >
CPixelView & CPixelView< PIXEL_TYPE >::operator|= ( const CPixelView< PIXEL_TYPE > & rhs)
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

See also
CRGB::operator|=

Definition at line 218 of file pixelset.h.

◆ operator|=() [2/3]

template<class PIXEL_TYPE >
CPixelView & CPixelView< PIXEL_TYPE >::operator|= ( const PIXEL_TYPE & rhs)
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

See also
CRGB::operator|=

Definition at line 215 of file pixelset.h.

◆ operator|=() [3/3]

template<class PIXEL_TYPE >
CPixelView & CPixelView< PIXEL_TYPE >::operator|= ( uint8_t d)
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

See also
CRGB::operator|=

Definition at line 221 of file pixelset.h.

◆ reversed()

template<class PIXEL_TYPE >
bool CPixelView< PIXEL_TYPE >::reversed ( )
inline

Whether or not this set goes backwards.

Returns
whether or not the set is backwards

Definition at line 97 of file pixelset.h.

◆ size()

template<class PIXEL_TYPE >
int CPixelView< PIXEL_TYPE >::size ( )
inline

Get the size of this set.

Returns
the size of the set, in number of LEDs

Definition at line 93 of file pixelset.h.

◆ subFromRGB()

template<class PIXEL_TYPE >
CPixelView & CPixelView< PIXEL_TYPE >::subFromRGB ( uint8_t inc)
inline

Subtract the passed in value from all channels for all of the pixels in this set.

Definition at line 162 of file pixelset.h.

Member Data Documentation

◆ dir

template<class PIXEL_TYPE >
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 68 of file pixelset.h.

◆ end_pos

template<class PIXEL_TYPE >
PIXEL_TYPE* const CPixelView< PIXEL_TYPE >::end_pos

pointer to the end position of the LED data

Definition at line 72 of file pixelset.h.

◆ leds

template<class PIXEL_TYPE >
PIXEL_TYPE* const CPixelView< PIXEL_TYPE >::leds

pointer to the LED data

Definition at line 71 of file pixelset.h.

◆ len

template<class PIXEL_TYPE >
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 69 of file pixelset.h.


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