4#define FASTLED_INTERNAL
30 const CRGB &colorTemperature) {
31#if defined(NO_CORRECTION) && (NO_CORRECTION == 1)
36 for (
fl::u8 i = 0; i < 3; ++i) {
37 fl::u8 cc = colorCorrection.raw[i];
38 fl::u8 ct = colorTemperature.raw[i];
39 if (cc > 0 && ct > 0) {
42 fl::u32 work = (((fl::u16)cc) + 1);
43 work *= (((fl::u16)ct) + 1);
46 adj.raw[i] = work & 0xFF;
55 return CRGB(fl::blend8(p1.r, p2.r, amountOfP2), fl::blend8(p1.g, p2.g, amountOfP2),
56 fl::blend8(p1.b, p2.b, amountOfP2));
62 for (
int i = 0; i < 3; ++i) {
63 if (upper.raw[i] > max_component) {
64 max_component = upper.raw[i];
69 fl::u8 amountOf2 = 255 - max_component;
82 "Upscaling only works with a src matrix that is rectangular");
89 nscale8x3(r, g, b, scaledown);
104 ret.r =
lerp8by8(r, other.r, amountOf2);
105 ret.g =
lerp8by8(g, other.g, amountOf2);
106 ret.b =
lerp8by8(b, other.b, amountOf2);
112 nscale8x3(r, g, b, 255 - fadefactor);
fl::UISlider scale("Scale", 4,.1, 4,.1)
u16 getWidth() const FL_NOEXCEPT
u16 getHeight() const FL_NOEXCEPT
XyMapType getType() const FL_NOEXCEPT
string & append(const bitset_fixed< N > &bs) FL_NOEXCEPT
Legacy compatibility header for 8-bit math functions.
Internal FastLED header for implementation files.
LIB8STATIC fl::u8 lerp8by8(fl::u8 a, fl::u8 b, fract8 frac)
Linear interpolation between two unsigned 8-bit values, with 8-bit fraction.
#define FL_WARN_IF(COND, MSG)
u8 fract8
Fixed-Point Fractional Types.
void downscale(const CRGB *src, const XYMap &srcXY, CRGB *dst, const XYMap &dstXY)
void upscale(const CRGB *input, CRGB *output, u16 inputWidth, u16 inputHeight, const fl::XYMap &xyMap)
CRGB & operator+=(const CRGB &rhs) FL_NOEXCEPT
Add one CRGB to another, saturating at 0xFF for each channel.
static CRGB blend(const CRGB &p1, const CRGB &p2, fract8 amountOfP2) FL_NOEXCEPT
static CRGB blendAlphaMaxChannel(const CRGB &upper, const CRGB &lower) FL_NOEXCEPT
static CRGB computeAdjustment(u8 scale, const CRGB &colorCorrection, const CRGB &colorTemperature) FL_NOEXCEPT
Calculates the combined color adjustment to the LEDs at a given scale, color correction,...
static void upscale(const CRGB *src, const XYMap &srcXY, CRGB *dst, const XYMap &dstXY) FL_NOEXCEPT
CRGB & nscale8(u8 scaledown) FL_NOEXCEPT
Scale down a RGB to N/256ths of its current brightness, using "plain math" dimming rules.
CRGB & fadeToBlackBy(u8 fadefactor) FL_NOEXCEPT
fadeToBlackBy is a synonym for nscale8(), as a fade instead of a scale
static void downscale(const CRGB *src, const XYMap &srcXY, CRGB *dst, const XYMap &dstXY) FL_NOEXCEPT
Downscale a CRGB matrix (or strip) to the smaller size.
string toString() const FL_NOEXCEPT
FASTLED_FORCE_INLINE CRGB() FL_NOEXCEPT
Default constructor.
CRGB lerp8(const CRGB &other, fract8 amountOf2) const FL_NOEXCEPT
Return a new CRGB object after performing a linear interpolation between this object and the passed i...