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 45 of file scale_up.cpp.

45 {
46 if (!mSurface) {
47 mSurface.reset(new CRGB[mDelegate->getNumLeds()]);
48 }
49 DrawContext delegateContext = context;
50 delegateContext.leds = mSurface.get();
51 mDelegate->draw(delegateContext);
52
53 uint16_t in_w = mDelegate->getWidth();
54 uint16_t in_h = mDelegate->getHeight();
55 uint16_t out_w = getWidth();
56 uint16_t out_h = getHeight();
57 ;
58 if (in_w == out_w && in_h == out_h) {
59 noExpand(mSurface.get(), context.leds, in_w, in_h);
60 } else {
61 expand(mSurface.get(), context.leds, in_w, in_h, mXyMap);
62 }
63}
XYMap mXyMap
Definition fx2d.h:29
uint16_t getHeight() const
Definition fx2d.h:23
uint16_t getWidth() const
Definition fx2d.h:24
_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:65
fl::scoped_array< CRGB > mSurface
Definition scale_up.h:58
Fx2dPtr mDelegate
Definition scale_up.h:57
void noExpand(const CRGB *input, CRGB *output, uint16_t width, uint16_t height)
Definition scale_up.cpp:80

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: