FastLED 3.10.8
Loading...
Searching...
No Matches

◆ draw()

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

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

20 {
21 // assert(fx);
22 if (!frame) {
23 frame = fl::make_shared<Frame>(fx->getNumLeds());
24 }
25
26 if (!running) {
27 // Clear the frame
28 fl::memset((u8*)frame->rgb().data(), 0, frame->size() * sizeof(CRGB));
29 fx->resume(now);
30 mLastNow = now;
31 running = true;
32 }
33 u16 frame_time = static_cast<u16>(now - mLastNow);
34 mLastNow = now;
35 Fx::DrawContext context(now, frame->rgb(), frame_time, speed, audio);
36 fx->draw(context);
37}
uint16_t speed
Definition Noise.ino:72
::fl::DrawContext DrawContext
Definition fx.h:21
fl::shared_ptr< Fx > fx
Definition fx_layer.h:31
fl::shared_ptr< Frame > frame
Definition fx_layer.h:30
fl::u32 mLastNow
Definition fx_layer.h:32
bool running
Definition fx_layer.h:33
shared_ptr< T > make_shared(Args &&... args) FL_NO_EXCEPT
Definition shared_ptr.h:423
unsigned char u8
Definition stdint.h:131
fl::CRGB CRGB
Definition video.h:18
FASTLED_FORCE_INLINE void * memset(void *s, int c, size_t n) FL_NO_EXCEPT
Definition cstring.h:148

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

+ Here is the call graph for this function: