4#define FASTLED_INTERNAL
20#define FASTLED_SCALE_UP_ALWAYS_POWER_OF_2 0
23#define FASTLED_SCALE_UP_HIGH_PRECISION 1
28#define FASTLED_SCALE_UP_DECIDE_AT_RUNTIME 2
30#define FASTLED_SCALE_UP_FORCE_FLOATING_POINT 3
32#ifndef FASTLED_SCALE_UP
33#define FASTLED_SCALE_UP FASTLED_SCALE_UP_DECIDE_AT_RUNTIME
42 mDelegate->getXYMap().setRectangularGrid();
58 if (in_w == out_w && in_h == out_h) {
67#if FASTLED_SCALE_UP == FASTLED_SCALE_UP_ALWAYS_POWER_OF_2
69#elif FASTLED_SCALE_UP == FASTLED_SCALE_UP_HIGH_PRECISION
71#elif FASTLED_SCALE_UP == FASTLED_SCALE_UP_DECIDE_AT_RUNTIME
73#elif FASTLED_SCALE_UP == FASTLED_SCALE_UP_FORCE_FLOATING_POINT
76#error "Invalid FASTLED_SCALE_UP"
82 uint16_t n =
mXyMap.getTotal();
83 for (uint16_t w = 0; w < width; w++) {
84 for (uint16_t h = 0; h < height; h++) {
85 uint16_t idx =
mXyMap.mapToIndex(w, h);
87 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)