FastLED 3.9.15
Loading...
Searching...
No Matches
scale_up.h File Reference

Detailed Description

Expands a grid using bilinear interpolation for upscaling effects.

This effect wrapper allows rendering at a lower resolution and then scaling up to the display resolution using bilinear interpolation. This is useful for:

  • Underpowered devices that can't handle full resolution rendering
  • Dynamic resolution scaling when grid size changes
  • Optimizing performance by rendering complex effects at lower resolution

Definition in file scale_up.h.

#include "fl/stl/stdint.h"
#include "fl/stl/span.h"
#include "fl/math/xymap.h"
#include "fl/fx/fx2d.h"
+ Include dependency graph for scale_up.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  fl::ScaleUp
 Effect wrapper that upscales delegate effects using bilinear interpolation. More...
 

Namespaces

namespace  fl
 Base definition for an LED controller.
 

Macros

#define FASTLED_SCALE_UP   FASTLED_SCALE_UP_DECIDE_AT_RUNTIME
 
ScaleUp Precision Modes

These constants configure the scaling algorithm's precision and performance tradeoffs.

Set FASTLED_SCALE_UP to one of these values to control behavior.

Note
To override FASTLED_SCALE_UP, it must be defined via build system flags (e.g., platformio.ini with build_flags = -DFASTLED_SCALE_UP=0). Including it in source files will not work as this header will already be included. This optimization is only necessary for sketches at maximum memory capacity; normal usage does not require overriding the default DECIDE_AT_RUNTIME mode.
#define FASTLED_SCALE_UP_ALWAYS_POWER_OF_2   0
 Optimized for power-of-2 grid sizes (fastest, lowest memory) Uses bit-shifting operations for division.
 
#define FASTLED_SCALE_UP_DECIDE_AT_RUNTIME   2
 Runtime selection based on grid size (adaptive) Uses more executable memory as both POWER_OF_2 and HIGH_PRECISION implementations are compiled in.
 
#define FASTLED_SCALE_UP_FORCE_FLOATING_POINT   3
 Floating-point implementation (slowest, not recommended) Provided for completeness but offers no performance benefits over integer versions.
 
#define FASTLED_SCALE_UP_HIGH_PRECISION   1
 High-precision mode for arbitrary grid sizes Uses more memory than POWER_OF_2 mode but handles any grid dimensions correctly.
 

Functions

 fl::FASTLED_SHARED_PTR (ScaleUp)