17#define FASTLED_SCALE_UP_ALWAYS_POWER_OF_2 0
20#define FASTLED_SCALE_UP_HIGH_PRECISION 1
25#define FASTLED_SCALE_UP_DECIDE_AT_RUNTIME 2
27#define FASTLED_SCALE_UP_FORCE_FLOATING_POINT 3
29#ifndef FASTLED_SCALE_UP
30#define FASTLED_SCALE_UP FASTLED_SCALE_UP_DECIDE_AT_RUNTIME
39 mDelegate->getXYMap().setRectangularGrid();
55 if (in_w == out_w && in_h == out_h) {
64#if FASTLED_SCALE_UP == FASTLED_SCALE_UP_ALWAYS_POWER_OF_2
66#elif FASTLED_SCALE_UP == FASTLED_SCALE_UP_HIGH_PRECISION
68#elif FASTLED_SCALE_UP == FASTLED_SCALE_UP_DECIDE_AT_RUNTIME
70#elif FASTLED_SCALE_UP == FASTLED_SCALE_UP_FORCE_FLOATING_POINT
73#error "Invalid FASTLED_SCALE_UP"
80 for (u16 w = 0; w <
width; w++) {
81 for (u16 h = 0; h <
height; h++) {
82 u16 idx =
mXyMap.mapToIndex(w, h);
84 output[idx] = input[w *
height + h];
u16 getWidth() const FL_NO_EXCEPT
Fx2d(const XYMap &xyMap) FL_NO_EXCEPT
u16 getHeight() const FL_NO_EXCEPT
ScaleUp(const XYMap &xymap, Fx2dPtr fx) FL_NO_EXCEPT
Construct a ScaleUp effect wrapper.
void noExpand(fl::span< const CRGB > input, fl::span< CRGB > output, u16 width, u16 height) FL_NO_EXCEPT
Direct copy without expansion (used when resolutions match)
void draw(DrawContext context) FL_NO_EXCEPT override
Render the effect by drawing delegate at low-res and scaling up.
fl::vector_psram< CRGB > mSurface
Low-resolution render buffer.
Fx2dPtr mDelegate
The wrapped effect that renders at low resolution.
void expand(fl::span< const CRGB > input, fl::span< CRGB > output, u16 width, u16 height, const XYMap &mXyMap) FL_NO_EXCEPT
Expand a low-resolution buffer to high-resolution using bilinear interpolation.
u8 u8 fract8 blur_amount FL_NO_EXCEPT
void upscale(const CRGB *input, CRGB *output, u16 inputWidth, u16 inputHeight, const fl::XYMap &xyMap) FL_NO_EXCEPT
u8 upscaleFloat(u8 v00, u8 v10, u8 v01, u8 v11, float dx, float dy) FL_NO_EXCEPT
void upscaleArbitrary(const CRGB *input, CRGB *output, u16 inputWidth, u16 inputHeight, const XYMap &xyMap) FL_NO_EXCEPT
Performs bilinear interpolation for upscaling an image.
void upscalePowerOf2(const CRGB *input, CRGB *output, u8 inputWidth, u8 inputHeight, const XYMap &xyMap) FL_NO_EXCEPT
Performs bilinear interpolation for upscaling an image.
Base definition for an LED controller.
Expands a grid using bilinear interpolation for upscaling effects.