| 39 | } |
| 40 | |
| 41 | void 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 | |
| 61 | void ScaleUp::expand(fl::span<const CRGB> input, fl::span<CRGB> output, u16 width, |
| 62 | u16 height, const XYMap& mXyMap) { |
nothing calls this directly
no test coverage detected