MCPcopy Create free account
hub / github.com/FastLED/FastLED / draw

Method draw

src/fl/fx/2d/scale_up.cpp.hpp:41–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39}
40
41void ScaleUp::draw(DrawContext context) {
42 if (mSurface.empty()) {
43 mSurface.resize(mDelegate->getNumLeds());
44 }
45 DrawContext delegateContext = context;
46 delegateContext.leds = fl::span<CRGB>(mSurface);
47 mDelegate->draw(delegateContext);
48
49 u16 in_w = mDelegate->getWidth();
50 u16 in_h = mDelegate->getHeight();
51 u16 out_w = getWidth();
52 u16 out_h = getHeight();
53 ;
54 if (in_w == out_w && in_h == out_h) {
55 noExpand(fl::span<const CRGB>(mSurface), context.leds, in_w, in_h);
56 } else {
57 expand(fl::span<const CRGB>(mSurface), context.leds, in_w, in_h, mXyMap);
58 }
59}
60
61void ScaleUp::expand(fl::span<const CRGB> input, fl::span<CRGB> output, u16 width,
62 u16 height, const XYMap& mXyMap) {

Callers

nothing calls this directly

Calls 5

getNumLedsMethod · 0.80
emptyMethod · 0.45
resizeMethod · 0.45
getWidthMethod · 0.45
getHeightMethod · 0.45

Tested by

no test coverage detected