15#define FUNCTION_SCALE8(a,b) fl::scale8(a,b)
35 r = fl::qsub8( r, rhs.r);
36 g = fl::qsub8( g, rhs.g);
37 b = fl::qsub8( b, rhs.b);
74 nscale8x3_video( r, g, b, scaledown);
80 nscale8x3_video( r, g, b, scaledown);
86 nscale8x3_video( r, g, b, 255 - fadefactor);
109 (((fl::u16)r) * (1 + (fl::u16)(scaledown.r))) >> 8,
110 (((fl::u16)g) * (1 + (fl::u16)(scaledown.g))) >> 8,
111 (((fl::u16)b) * (1 + (fl::u16)(scaledown.b))) >> 8
127 fl::nscale8x3( out.r, out.g, out.b, scaledown);
145 fl::u8 luma = scale8_LEAVING_R1_DIRTY( r, 54) + \
146 scale8_LEAVING_R1_DIRTY( g, 183) + \
147 scale8_LEAVING_R1_DIRTY( b, 18);
153#if FASTLED_SCALE8_FIXED == 1
154 const fl::u8 eightyfive = 85;
156 const fl::u8 eightyfive = 86;
158 fl::u8 avg = scale8_LEAVING_R1_DIRTY( r, eightyfive) + \
159 scale8_LEAVING_R1_DIRTY( g, eightyfive) + \
160 scale8_LEAVING_R1_DIRTY( b, eightyfive);
184 return CRGB( fl::qadd8( p1.r, p2.r),
185 fl::qadd8( p1.g, p2.g),
186 fl::qadd8( p1.b, p2.b));
192 return CRGB( fl::qsub8( p1.r, p2.r),
193 fl::qsub8( p1.g, p2.g),
194 fl::qsub8( p1.b, p2.b));
200 return CRGB( qmul8( p1.r, d),
216#undef FUNCTION_SCALE8
Defines the hue, saturation, and value (HSV) pixel struct.
#define FUNCTION_SCALE8(a, b)
Legacy compatibility header for 8-bit scaling functions.
LIB8STATIC fl::u16 lerp16by16(fl::u16 a, fl::u16 b, fract16 frac)
Linear interpolation between two unsigned 16-bit values, with 16-bit fraction.
Fast, efficient 8-bit math functions specifically designed for high-performance LED programming.
u16 fract16
ANSI: unsigned _Fract.
FASTLED_FORCE_INLINE CRGB operator*(const CRGB &p1, u8 d) FL_NOEXCEPT
Multiply each of the channels by a constant, saturating each channel at 0xFF.
FASTLED_FORCE_INLINE CRGB operator+(const CRGB &p1, const CRGB &p2) FL_NOEXCEPT
Add one CRGB to another, saturating at 0xFF for each channel.
FASTLED_FORCE_INLINE CRGB operator-(const CRGB &p1, const CRGB &p2) FL_NOEXCEPT
Subtract one CRGB from another, saturating at 0x00 for each channel.
FASTLED_FORCE_INLINE CRGB operator%(const CRGB &p1, u8 d) FL_NOEXCEPT
Scale using CRGB::nscale8_video()
Base definition for an LED controller.
#define FL_DISABLE_WARNING_RETURN_TYPE
#define FL_DISABLE_WARNING_IMPLICIT_INT_CONVERSION
#define FASTLED_FORCE_INLINE
#define FL_DISABLE_WARNING_PUSH
#define FL_DISABLE_WARNING_SIGN_CONVERSION
#define FL_DISABLE_WARNING_POP
#define FL_DISABLE_WARNING_UNUSED_PARAMETER
#define FL_DISABLE_WARNING_FLOAT_CONVERSION
constexpr CRGB nscale8_constexpr(const CRGB scaledown) const FL_NOEXCEPT
FASTLED_FORCE_INLINE CRGB & operator-=(const CRGB &rhs) FL_NOEXCEPT
Subtract one CRGB from another, saturating at 0x00 for each channel.
FASTLED_FORCE_INLINE CRGB scale8(u8 scaledown) const FL_NOEXCEPT
Return a CRGB object that is a scaled down version of this object.
FASTLED_FORCE_INLINE CRGB & addToRGB(u8 d) FL_NOEXCEPT
Add a constant to each channel, saturating at 0xFF.
FASTLED_FORCE_INLINE CRGB & operator--() FL_NOEXCEPT
Subtract a constant of '1' from each channel, saturating at 0x00.
u8 getLuma() const FL_NOEXCEPT
Get the "luma" of a CRGB object.
FASTLED_FORCE_INLINE CRGB & fadeLightBy(u8 fadefactor) FL_NOEXCEPT
fadeLightBy is a synonym for nscale8_video(), as a fade instead of a scale
FASTLED_FORCE_INLINE CRGB & operator*=(u8 d) FL_NOEXCEPT
Multiply each of the channels by a constant, saturating each channel at 0xFF.
FASTLED_FORCE_INLINE CRGB & operator++() FL_NOEXCEPT
Add a constant of '1' from each channel, saturating at 0xFF.
FASTLED_FORCE_INLINE u8 getAverageLight() const FL_NOEXCEPT
Get the average of the R, G, and B values.
FASTLED_FORCE_INLINE CRGB lerp16(const CRGB &other, fract16 frac) const FL_NOEXCEPT
Return a new CRGB object after performing a linear interpolation between this object and the passed i...
FASTLED_FORCE_INLINE CRGB & operator%=(u8 scaledown) FL_NOEXCEPT
%= is a synonym for nscale8_video().
CRGB & nscale8(u8 scaledown) FL_NOEXCEPT
Scale down a RGB to N/256ths of its current brightness, using "plain math" dimming rules.
FASTLED_FORCE_INLINE CRGB() FL_NOEXCEPT
Default constructor.
FASTLED_FORCE_INLINE CRGB & nscale8_video(u8 scaledown) FL_NOEXCEPT
Scale down a RGB to N/256ths of it's current brightness using "video" dimming rules.
FASTLED_FORCE_INLINE CRGB & subtractFromRGB(u8 d) FL_NOEXCEPT
Subtract a constant from each channel, saturating at 0x00.
Representation of an 8-bit RGB pixel (Red, Green, Blue)