4#define FASTLED_INTERNAL
19#define FASTLED_SCALE_UP_ALWAYS_POWER_OF_2 0
22#define FASTLED_SCALE_UP_HIGH_PRECISION 1
27#define FASTLED_SCALE_UP_DECIDE_AT_RUNTIME 2
29#define FASTLED_SCALE_UP_FORCE_FLOATING_POINT 3
31#ifndef FASTLED_SCALE_UP
32#define FASTLED_SCALE_UP FASTLED_SCALE_UP_DECIDE_AT_RUNTIME
41 mDelegate->getXYMap().setRectangularGrid();
57 if (in_w == out_w && in_h == out_h) {
66#if FASTLED_SCALE_UP == FASTLED_SCALE_UP_ALWAYS_POWER_OF_2
68#elif FASTLED_SCALE_UP == FASTLED_SCALE_UP_HIGH_PRECISION
70#elif FASTLED_SCALE_UP == FASTLED_SCALE_UP_DECIDE_AT_RUNTIME
72#elif FASTLED_SCALE_UP == FASTLED_SCALE_UP_FORCE_FLOATING_POINT
75#error "Invalid FASTLED_SCALE_UP"
81 uint16_t n =
mXyMap.getTotal();
82 for (uint16_t w = 0; w < width; w++) {
83 for (uint16_t h = 0; h < height; h++) {
84 uint16_t idx =
mXyMap.mapToIndex(w, h);
86 output[idx] = input[w * height + h];
XYMap xymap(WIDTH, HEIGHT, SERPENTINE)
central include file for FastLED, defines the CFastLED class/object
Demonstrates how to mix noise generation with color palettes on a 2D LED matrix.
uint16_t getHeight() const
uint16_t getWidth() const
void expand(const CRGB *input, CRGB *output, uint16_t width, uint16_t height, XYMap mXyMap)
ScaleUp(XYMap xymap, Fx2dPtr fx)
void draw(DrawContext context) override
fl::scoped_array< CRGB > mSurface
void noExpand(const CRGB *input, CRGB *output, uint16_t width, uint16_t height)
void bilinearExpand(const CRGB *input, CRGB *output, uint16_t inputWidth, uint16_t inputHeight, fl::XYMap xyMap)
void bilinearExpandFloat(const CRGB *input, CRGB *output, uint8_t inputWidth, uint8_t inputHeight, XYMap xyMap)
void bilinearExpandArbitrary(const CRGB *input, CRGB *output, uint16_t inputWidth, uint16_t inputHeight, XYMap xyMap)
Performs bilinear interpolation for upscaling an image.
void bilinearExpandPowerOf2(const CRGB *input, CRGB *output, uint8_t inputWidth, uint8_t inputHeight, XYMap xyMap)
Performs bilinear interpolation for upscaling an image.
Implements a simple red square effect for 2D LED grids.
Functions to generate and fill arrays with noise.
Fast, efficient random number generators specifically designed for high-performance LED programming.
Expands a grid using bilinear interpolation and scaling up.
Representation of an RGB pixel (Red, Green, Blue)