FastLED 3.9.15
Loading...
Searching...
No Matches

◆ draw()

void fl::FxLayer::draw ( fl::u32 now,
float speed = 1.0f,
const AudioBatch * audio = nullptr )

Definition at line 19 of file fx_layer.cpp.hpp.

19 {
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}
uint16_t speed
Definition Noise.ino:66
::fl::DrawContext DrawContext
Definition fx.h:21
fl::shared_ptr< Fx > fx
Definition fx_layer.h:30
fl::shared_ptr< Frame > frame
Definition fx_layer.h:29
fl::u32 mLastNow
Definition fx_layer.h:31
bool running
Definition fx_layer.h:32
unsigned char u8
Definition stdint.h:131
fl::CRGB CRGB
Definition video.h:15
void * memset(void *s, int c, size_t n) FL_NOEXCEPT
shared_ptr< T > make_shared(Args &&... args) FL_NOEXCEPT
Definition shared_ptr.h:414

References frame, fx, fl::make_shared(), fl::memset(), mLastNow, running, and speed.

+ Here is the call graph for this function: