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)
27template<
class PIXEL_TYPE>
101template<
class PIXEL_TYPE>
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) {}
159 inline operator PIXEL_TYPE* ()
const {
return leds; }
164 for(
iterator pixel =
begin(), _end =
end(); pixel != _end; ++pixel) { (*pixel) = color; }
183 for(
iterator pixel =
begin(), rhspixel = rhs.
begin(), _end =
end(), rhs_end = rhs.
end(); (pixel != _end) && (rhspixel != rhs_end); ++pixel, ++rhspixel) {
184 (*pixel) = (*rhspixel);
274 inline operator bool() {
for(
iterator pixel =
begin(), _end =
end(); pixel != _end; ++pixel) {
if((*pixel))
return true; }
return false; }
472 typedef pixelset_iterator_base<PIXEL_TYPE>
iterator;
501 using CPixelView::operator=;
504 size_t size()
const {
return SIZE; }
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
FASTLED_FORCE_INLINE bool operator==(pixelset_iterator_base &other) const
Check if iterator is at the same position.
FASTLED_FORCE_INLINE pixelset_iterator_base & operator++()
Increment LED pointer in data direction.
FASTLED_FORCE_INLINE pixelset_iterator_base operator++(int)
Increment LED pointer in data direction.
FASTLED_FORCE_INLINE pixelset_iterator_base(const pixelset_iterator_base &rhs)
Copy constructor.
FASTLED_FORCE_INLINE pixelset_iterator_base(T *_leds, const char _dir)
Base constructor.
FASTLED_FORCE_INLINE PIXEL_TYPE & operator*() const
Dereference operator, to get underlying pointer to the LEDs.
FASTLED_FORCE_INLINE bool operator!=(pixelset_iterator_base &other) const
Check if iterator is not at the same position.
CPixelView(PIXEL_TYPE *_leds, int _len)
PixelSet constructor for a pixel set starting at the given PIXEL_TYPE* and going for _len leds.
CPixelView & nscale8(PIXEL_TYPE &scaledown)
Scale every LED by the given scale.
CPixelView & operator/=(fl::u8 d)
Divide every LED by the given 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%=(fl::u8 scaledown)
Scale down every LED by the given scale.
CPixelView & fadeToBlackBy(fl::u8 fade)
Fade every LED down by the given scale.
CPixelView & operator-=(CPixelView &rhs)
Subtract every pixel in the other set from this set.
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 & operator--()
Decrement every pixel value in this set.
const_iterator cbegin() const
Makes a const iterator instance for the start of the LED set, const qualified.
CPixelView & operator&=(fl::u8 d)
Apply the PIXEL_TYPE &= operator to every pixel in this set with the passed in value.
const_iterator cend() const
Makes a const iterator instance for the end of the LED set, const qualified.
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.
CPixelView & operator|=(const PIXEL_TYPE &rhs)
Apply the PIXEL_TYPE |= operator to every pixel in this set with the given PIXEL_TYPE value.
bool reversed()
Whether or not this set goes backwards.
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.
CPixelView & operator--(int DUMMY_ARG)
Decrement every pixel value in this set.
CPixelView & nscale8(fl::u8 scaledown)
Scale every LED by the given scale.
CPixelView & fadeLightBy(fl::u8 fadefactor)
Fade every LED down by the given scale.
CPixelView & fill_solid(const CHSV &color)
Fill all of the LEDs with a solid color.
CPixelView & nscale8_video(fl::u8 scaledown)
Scale every LED by the given scale.
CPixelView & fill_rainbow(fl::u8 initialhue, fl::u8 deltahue=5)
Fill all of the LEDs with a rainbow of colors.
CPixelView & operator=(const CPixelView &rhs)
Copy the contents of the passed-in set to our set.
CPixelView & operator*=(fl::u8 d)
Multiply every LED in this set by the given value.
CPixelView & operator++(int DUMMY_ARG)
Increment every pixel value in this set.
CPixelView & operator+=(CPixelView &rhs)
Add every pixel in the other set to this set.
CPixelView & subFromRGB(fl::u8 inc)
Subtract the passed in value from all channels for all of the pixels in this set.
CPixelView & operator=(const PIXEL_TYPE &color)
Assign the passed in color to all elements in this set.
CPixelView & operator|=(fl::u8 d)
Apply the PIXEL_TYPE |= operator to every pixel in this set.
CPixelView & operator++()
Increment every pixel value in this set.
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.
void dump() const
Print debug data to serial, disabled for release.
CPixelView & blur1d(fract8 blur_amount)
One-dimensional blur filter.
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.
CPixelView & nblend(const PIXEL_TYPE &overlay, fract8 amountOfOverlay)
Destructively modifies all LEDs, blending in a given fraction of an overlay color.
CPixelView & operator&=(const PIXEL_TYPE &rhs)
Apply the PIXEL_TYPE &= operator to every pixel in this set with the given PIXEL_TYPE value.
pixelset_iterator_base< CRGB > iterator
CPixelView operator()(int start, int end)
Access an inclusive subset of the LEDs in this set.
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...
CPixelView & napplyGamma_video(float gamma)
Destructively applies a gamma adjustment to all LEDs.
PIXEL_TYPE & operator[](int x) const
Access a single element in this set, just like an array operator.
CPixelView & operator|=(const CPixelView &rhs)
Apply the PIXEL_TYPE |= operator to every pixel in this set with every pixel in the passed in set.
pixelset_iterator_base< const CRGB > const_iterator
CPixelView & nscale8(CPixelView &rhs)
Scale every LED in this set by every led in the other set.
CPixelView operator-()
Return the reverse ordering of this set.
CPixelView & fill_solid(const PIXEL_TYPE &color)
Fill all of the LEDs with a solid color.
CPixelView(PIXEL_TYPE *_leds, int _start, int _end)
PixelSet constructor for the given set of LEDs, with start and end boundaries.
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...
CPixelView & nblend(const CPixelView &rhs, fract8 amountOfOverlay)
Destructively blend another set of LEDs into this one.
iterator begin() const
Makes an iterator instance for the start of the LED set, const qualified.
CPixelView & addToRGB(fl::u8 inc)
Add the passed in value to all channels for all of the pixels in this set.
iterator begin()
Makes an iterator instance for the start of the LED set.
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.
CPixelView & operator>>=(fl::u8 d)
Shift every LED in this set right by the given number of bits.
iterator end() const
Makes an iterator instance for the end of the LED set, const qualified.
CPixelView & napplyGamma_video(float gammaR, float gammaG, float gammaB)
Destructively applies a gamma adjustment to all LEDs.
CPixelView(const CPixelView &other)
PixelSet copy constructor.
int size()
Get the size of this set.
Represents a view/window into a set of LED pixels, providing array-like access and rich color operati...
CRGB rawleds[SIZE]
the LED data
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.
FASTLED_FORCE_INLINE CRGB * operator+(const CRGBSet &pixels, int offset)
Retrieve a pointer to a CRGB array, using a CRGBSet and an LED offset.
u8 fract8
Fixed-Point Fractional Types.
TGradientDirectionCode
Hue direction for calculating fill gradients.
@ SHORTEST_HUES
Hue goes whichever way is shortest.
constexpr enable_if< is_fixed_point< T >::value, T >::type abs(T x) FL_NOEXCEPT
#define FUNCTION_NBLEND(a, b, c)
#define FUNCTION_FILL_GRADIENT3(a, b, c, d, e, f)
#define FUNCTION_FILL_GRADIENT_RGB3(a, b, c, d, e)
#define FUNCTION_FILL_GRADIENT4(a, b, c, d, e, f, g)
#define FUNCTION_FILL_GRADIENT(a, b, c, d, e)
#define FUNCTION_FILL_GRADIENT_RGB(a, b, c, d)
#define FUNCTION_FILL_GRADIENT_RGB4(a, b, c, d, e, f)
#define FUNCTION_BLUR1D(a, b, c)
#define FUNCTION_NAPPLY_GAMMA_RGB(a, b, c, d, e)
#define FUNCTION_NAPPLY_GAMMA(a, b, c)
CPixelView< CRGB > CRGBSet
CPixelView specialized for CRGB pixel arrays - the most commonly used pixel view type.
#define FUNCTION_FILL_RAINBOW(a, b, c, d)
#define FASTLED_FORCE_INLINE
#define FASTLED_UNUSED(x)