23#if FASTLED_IS_USING_NAMESPACE
24#define FUNCTION_SCALE8(a,b) FASTLED_NAMESPACE::scale8(a,b)
26#define FUNCTION_SCALE8(a,b) ::scale8(a,b)
133 nscale8x3( out.r, out.g, out.b, scaledown);
152 scale8_LEAVING_R1_DIRTY( g, 183) + \
153 scale8_LEAVING_R1_DIRTY( b, 18);
159#if FASTLED_SCALE8_FIXED == 1
160 const uint8_t eightyfive = 85;
162 const uint8_t eightyfive = 86;
165 scale8_LEAVING_R1_DIRTY( g, eightyfive) + \
166 scale8_LEAVING_R1_DIRTY( b, eightyfive);
219#undef FUNCTION_SCALE8
Defines the hue, saturation, and value (HSV) pixel struct.
#define FL_DISABLE_WARNING_RETURN_TYPE
#define FL_DISABLE_WARNING_IMPLICIT_INT_CONVERSION
#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
Defines the red, green, and blue (RGB) pixel struct.
FASTLED_FORCE_INLINE CRGB operator%(const CRGB &p1, uint8_t d)
Scale using CRGB::nscale8_video()
FASTLED_FORCE_INLINE CRGB operator-(const CRGB &p1, const CRGB &p2)
Subtract one CRGB from another, saturating at 0x00 for each channel.
#define FUNCTION_SCALE8(a, b)
FASTLED_FORCE_INLINE CRGB operator*(const CRGB &p1, uint8_t d)
Multiply each of the channels by a constant, saturating each channel at 0xFF.
FASTLED_FORCE_INLINE CRGB operator+(const CRGB &p1, const CRGB &p2)
Add one CRGB to another, saturating at 0xFF for each channel.
#define FASTLED_FORCE_INLINE
LIB8STATIC uint16_t lerp16by16(uint16_t a, uint16_t b, fract16 frac)
Linear interpolation between two unsigned 16-bit values, with 16-bit fraction.
LIB8STATIC_ALWAYS_INLINE uint8_t qadd8(uint8_t i, uint8_t j)
Add one byte to another, saturating at 0xFF.
LIB8STATIC_ALWAYS_INLINE uint8_t qmul8(uint8_t i, uint8_t j)
8x8 bit multiplication with 8-bit result, saturating at 0xFF.
LIB8STATIC_ALWAYS_INLINE uint8_t qsub8(uint8_t i, uint8_t j)
Subtract one byte from another, saturating at 0x00.
LIB8STATIC_ALWAYS_INLINE void cleanup_R1()
Clean up the r1 register after a series of *LEAVING_R1_DIRTY calls.
LIB8STATIC_ALWAYS_INLINE uint8_t scale8_LEAVING_R1_DIRTY(uint8_t i, fract8 scale)
This version of scale8() does not clean up the R1 register on AVR.
LIB8STATIC void nscale8x3(uint8_t &r, uint8_t &g, uint8_t &b, fract8 scale)
Scale three one-byte values by a fourth one, which is treated as the numerator of a fraction whose de...
constexpr uint8_t scale8_constexpr(uint8_t i, fract8 scale)
LIB8STATIC void nscale8x3_video(uint8_t &r, uint8_t &g, uint8_t &b, fract8 scale)
Scale three one-byte values by a fourth one, which is treated as the numerator of a fraction whose de...
Fast, efficient 8-bit math functions specifically designed for high-performance LED programming.
#define FASTLED_NAMESPACE_END
#define FASTLED_NAMESPACE_BEGIN
Implements the FastLED namespace macros.
u16 fract16
ANSI: unsigned _Fract.
fl::u8 getLuma() const
Get the "luma" of a CRGB object.
FASTLED_FORCE_INLINE CRGB & operator%=(fl::u8 scaledown)
%= is a synonym for nscale8_video().
FASTLED_FORCE_INLINE CRGB & subtractFromRGB(fl::u8 d)
Subtract a constant from each channel, saturating at 0x00.
CRGB & nscale8(fl::u8 scaledown)
Scale down a RGB to N/256ths of its current brightness, using "plain math" dimming rules.
FASTLED_FORCE_INLINE CRGB & operator*=(fl::u8 d)
Multiply each of the channels by a constant, saturating each channel at 0xFF.
FASTLED_FORCE_INLINE CRGB & operator++()
Add a constant of '1' from each channel, saturating at 0xFF.
FASTLED_FORCE_INLINE CRGB()
Default constructor.
FASTLED_FORCE_INLINE CRGB & fadeLightBy(fl::u8 fadefactor)
fadeLightBy is a synonym for nscale8_video(), as a fade instead of a scale
FASTLED_FORCE_INLINE CRGB lerp16(const CRGB &other, fract16 frac) const
Return a new CRGB object after performing a linear interpolation between this object and the passed i...
FASTLED_FORCE_INLINE CRGB & operator-=(const CRGB &rhs)
Subtract one CRGB from another, saturating at 0x00 for each channel.
FASTLED_FORCE_INLINE CRGB & operator--()
Subtract a constant of '1' from each channel, saturating at 0x00.
FASTLED_FORCE_INLINE CRGB scale8(fl::u8 scaledown) const
Return a CRGB object that is a scaled down version of this object.
FASTLED_FORCE_INLINE fl::u8 getAverageLight() const
Get the average of the R, G, and B values.
FASTLED_FORCE_INLINE CRGB & addToRGB(fl::u8 d)
Add a constant to each channel, saturating at 0xFF.
FASTLED_FORCE_INLINE CRGB & nscale8_video(fl::u8 scaledown)
Scale down a RGB to N/256ths of it's current brightness using "video" dimming rules.
constexpr CRGB nscale8_constexpr(const CRGB scaledown) const
Representation of an RGB pixel (Red, Green, Blue)