FastLED 3.9.15
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 68 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)
 Construct a ScaleUp effect wrapper.
 
void draw (DrawContext context) 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)
 Expand a low-resolution buffer to high-resolution using bilinear interpolation.
 
fl::string fxName () const override
 
- Public Member Functions inherited from fl::Fx2d
 Fx2d (const XYMap &xyMap)
 
u16 getHeight () const
 
u16 getWidth () const
 
XYMapgetXYMap ()
 
const XYMapgetXYMap () const
 
void setXYMap (const XYMap &xyMap)
 
u16 xyMap (u16 x, u16 y) const
 
- Public Member Functions inherited from fl::Fx
 Fx (u16 numLeds)
 
u16 getNumLeds () const
 
virtual bool hasFixedFrameRate (float *fps) const
 
virtual void pause (fl::u32 now)
 
virtual void resume (fl::u32 now)
 

Private Member Functions

void noExpand (fl::span< const CRGB > input, fl::span< CRGB > output, u16 width, u16 height)
 Direct copy without expansion (used when resolutions match)
 

Private Attributes

Fx2dPtr mDelegate
 The wrapped effect that renders at low resolution.
 
fl::vector_psram< CRGBmSurface
 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_NOEXCEPT
 
- 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: