4#define FASTLED_INTERNAL
31 const CRGB &colorTemperature) {
32#if defined(NO_CORRECTION) && (NO_CORRECTION == 1)
37 for (uint8_t i = 0; i < 3; ++i) {
38 uint8_t cc = colorCorrection.raw[i];
39 uint8_t ct = colorTemperature.raw[i];
40 if (cc > 0 && ct > 0) {
43 fl::u32 work = (((fl::u16)cc) + 1);
44 work *= (((fl::u16)ct) + 1);
47 adj.raw[i] = work & 0xFF;
57 blend8(p1.b, p2.b, amountOfP2));
62 uint8_t max_component = 0;
63 for (
int i = 0; i < 3; ++i) {
64 if (upper.raw[i] > max_component) {
65 max_component = upper.raw[i];
70 uint8_t amountOf2 = 255 - max_component;
83 "Upscaling only works with a src matrix that is rectangular");
105 ret.r =
lerp8by8(r, other.r, amountOf2);
106 ret.g =
lerp8by8(g, other.g, amountOf2);
107 ret.b =
lerp8by8(b, other.b, amountOf2);
central include file for FastLED, defines the CFastLED class/object
XyMapType getType() const
string & append(const BitsetFixed< N > &bs)
Defines the red, green, and blue (RGB) pixel struct.
LIB8STATIC uint8_t lerp8by8(uint8_t a, uint8_t b, fract8 frac)
Linear interpolation between two unsigned 8-bit values, with 8-bit fraction.
LIB8STATIC_ALWAYS_INLINE uint8_t qadd8(uint8_t i, uint8_t j)
Add one byte to another, saturating at 0xFF.
LIB8STATIC uint8_t blend8(uint8_t a, uint8_t b, uint8_t amountOfB)
Blend a variable proportion (0-255) of one byte to another.
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...
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.
void downscale(const CRGB *src, const XYMap &srcXY, CRGB *dst, const XYMap &dstXY)
u8 fract8
Fixed-Point Fractional Types.
void upscale(const CRGB *input, CRGB *output, u16 inputWidth, u16 inputHeight, const fl::XYMap &xyMap)
static void downscale(const CRGB *src, const fl::XYMap &srcXY, CRGB *dst, const fl::XYMap &dstXY)
Downscale an CRGB matrix (or strip) to the smaller size.
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()
Default constructor.
CRGB & operator+=(const CRGB &rhs)
Add one CRGB to another, saturating at 0xFF for each channel.
fl::string toString() const
static CRGB blend(const CRGB &p1, const CRGB &p2, fract8 amountOfP2)
CRGB lerp8(const CRGB &other, fract8 amountOf2) const
Return a new CRGB object after performing a linear interpolation between this object and the passed i...
CRGB & fadeToBlackBy(fl::u8 fadefactor)
fadeToBlackBy is a synonym for nscale8(), as a fade instead of a scale
static void upscale(const CRGB *src, const fl::XYMap &srcXY, CRGB *dst, const fl::XYMap &dstXY)
static CRGB blendAlphaMaxChannel(const CRGB &upper, const CRGB &lower)
static CRGB computeAdjustment(fl::u8 scale, const CRGB &colorCorrection, const CRGB &colorTemperature)
Calculates the combined color adjustment to the LEDs at a given scale, color correction,...
Representation of an RGB pixel (Red, Green, Blue)