FastLED 3.9.15
Loading...
Searching...
No Matches

◆ draw()

void fl::ScaleUp::draw ( DrawContext context)
overridevirtual
Parameters
nowThe current time in milliseconds. Fx writers are encouraged to use this instead of millis() directly as this will more deterministic behavior.

Implements fl::Fx.

Definition at line 44 of file scale_up.cpp.

44 {
45 if (mSurface.empty()) {
46 mSurface.resize(mDelegate->getNumLeds());
47 }
48 DrawContext delegateContext = context;
49 delegateContext.leds = mSurface.data();
50 mDelegate->draw(delegateContext);
51
52 uint16_t in_w = mDelegate->getWidth();
53 uint16_t in_h = mDelegate->getHeight();
54 uint16_t out_w = getWidth();
55 uint16_t out_h = getHeight();
56 ;
57 if (in_w == out_w && in_h == out_h) {
58 noExpand(mSurface.data(), context.leds, in_w, in_h);
59 } else {
60 expand(mSurface.data(), context.leds, in_w, in_h, mXyMap);
61 }
62}
XYMap mXyMap
Definition fx2d.h:31
uint16_t getHeight() const
Definition fx2d.h:24
uint16_t getWidth() const
Definition fx2d.h:25
_DrawContext DrawContext
Definition fx.h:21
void expand(const CRGB *input, CRGB *output, uint16_t width, uint16_t height, XYMap mXyMap)
Definition scale_up.cpp:64
fl::vector< CRGB, fl::allocator_psram< CRGB > > mSurface
Definition scale_up.h:59
Fx2dPtr mDelegate
Definition scale_up.h:58
void noExpand(const CRGB *input, CRGB *output, uint16_t width, uint16_t height)
Definition scale_up.cpp:79

References expand(), fl::Fx2d::getHeight(), fl::Fx2d::getWidth(), fl::_DrawContext::leds, mDelegate, mSurface, fl::Fx2d::mXyMap, and noExpand().

+ Here is the call graph for this function: