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

Method draw

src/fl/fx/frame.cpp.hpp:49–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47}
48
49void Frame::draw(fl::span<CRGB> leds, DrawMode draw_mode) const {
50 if (!mRgb.empty()) {
51 switch (draw_mode) {
52 case DrawMode::DRAW_MODE_BLEND: // DRAW_MODE_BLEND is for gfx primitives; treat as overwrite for Frame
53 case DrawMode::DRAW_MODE_OVERWRITE: {
54 fl::memcpy(leds.data(), mRgb.data(), mPixelsCount * sizeof(CRGB));
55 break;
56 }
57 case DrawMode::DRAW_MODE_BLEND_BY_MAX_BRIGHTNESS: {
58 for (size_t i = 0; i < mPixelsCount; ++i) {
59 leds[i] = CRGB::blendAlphaMaxChannel(mRgb[i], leds[i]);
60 }
61 break;
62 }
63 }
64 }
65}
66
67void Frame::drawXY(fl::span<CRGB> leds, const XYMap &xyMap, DrawMode draw_mode) const {
68 const u16 width = xyMap.getWidth();

Callers

nothing calls this directly

Calls 3

memcpyFunction · 0.50
emptyMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected