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

Method draw

src/fl/fx/detail/fx_layer.cpp.hpp:19–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17}
18
19void FxLayer::draw(fl::u32 now, float speed, const AudioBatch *audio) {
20 // assert(fx);
21 if (!frame) {
22 frame = fl::make_shared<Frame>(fx->getNumLeds());
23 }
24
25 if (!running) {
26 // Clear the frame
27 fl::memset((u8*)frame->rgb().data(), 0, frame->size() * sizeof(CRGB));
28 fx->resume(now);
29 mLastNow = now;
30 running = true;
31 }
32 u16 frame_time = static_cast<u16>(now - mLastNow);
33 mLastNow = now;
34 Fx::DrawContext context(now, frame->rgb(), frame_time, speed, audio);
35 fx->draw(context);
36}
37
38void FxLayer::pause(fl::u32 now) {
39 if (fx && running) {

Callers

nothing calls this directly

Calls 6

memsetFunction · 0.85
getNumLedsMethod · 0.80
dataMethod · 0.45
rgbMethod · 0.45
sizeMethod · 0.45
resumeMethod · 0.45

Tested by

no test coverage detected