FastLED 3.10.8
Loading...
Searching...
No Matches
fl::ScaleUp Class Reference

Detailed Description

Effect wrapper that upscales delegate effects using bilinear interpolation.

ScaleUp renders a delegate effect at a lower resolution and then scales the result up to the target display size using bilinear filtering. This creates smooth interpolation between pixels, making the upscaling less noticeable than nearest-neighbor scaling.

Note
The delegate effect is rendered at the lower resolution defined by the XYMap passed to the constructor, then expanded to the display resolution.

Definition at line 69 of file scale_up.h.

#include <scale_up.h>

+ Inheritance diagram for fl::ScaleUp:
+ Collaboration diagram for fl::ScaleUp:

Public Member Functions

 ScaleUp (const XYMap &xymap, Fx2dPtr fx) FL_NO_EXCEPT
 Construct a ScaleUp effect wrapper.
 
void draw (DrawContext context) FL_NO_EXCEPT override
 Render the effect by drawing delegate at low-res and scaling up.
 
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.
 
fl::string fxName () const FL_NO_EXCEPT override
 
- Public Member Functions inherited from fl::Fx2d
 Fx2d (const XYMap &xyMap) FL_NO_EXCEPT
 
u16 getHeight () const FL_NO_EXCEPT
 
u16 getWidth () const FL_NO_EXCEPT
 
const XYMap & getXYMap () const FL_NO_EXCEPT
 
XYMap & getXYMap () FL_NO_EXCEPT
 
void setXYMap (const XYMap &xyMap) FL_NO_EXCEPT
 
u16 xyMap (u16 x, u16 y) const FL_NO_EXCEPT
 
- Public Member Functions inherited from fl::Fx
 Fx (u16 numLeds) FL_NO_EXCEPT
 
u16 getNumLeds () const FL_NO_EXCEPT
 
virtual bool hasFixedFrameRate (float *fps) const FL_NO_EXCEPT
 
virtual void pause (fl::u32 now) FL_NO_EXCEPT
 
virtual void resume (fl::u32 now) FL_NO_EXCEPT
 

Private Member Functions

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)
 

Private Attributes

Fx2dPtr mDelegate
 The wrapped effect that renders at low resolution.
 
fl::vector_psram< CRGB > mSurface
 Low-resolution render buffer.
 

Additional Inherited Members

- Public Types inherited from fl::Fx
using DrawContext = ::fl::DrawContext
 
- Protected Member Functions inherited from fl::Fx
virtual ~Fx () FL_NO_EXCEPT
 
- Protected Attributes inherited from fl::Fx2d
XYMap mXyMap
 
- Protected Attributes inherited from fl::Fx
u16 mNumLeds
 

The documentation for this class was generated from the following files: