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

◆ draw()

void fl::FxCompositor::draw ( fl::u32 now,
fl::u32 warpedTime,
fl::span< CRGB > finalBuffer,
float speed = 1.0f,
const AudioBatch * audio = nullptr )
inline

Definition at line 60 of file fx_compositor.h.

62 {
63 if (!mLayers[0]->getFx()) {
64 return;
65 }
66 mLayers[0]->draw(warpedTime, speed, audio);
67 u8 progress = mTransition.getProgress(now);
68 if (!progress) {
69 fl::span<CRGB> surface0 = mLayers[0]->getSurface();
70 fl::memcpy(finalBuffer.data(), surface0.data(), sizeof(CRGB) * mNumLeds);
71 return;
72 }
73 mLayers[1]->draw(warpedTime, speed, audio);
74 fl::span<CRGB> surface0 = mLayers[0]->getSurface();
75 fl::span<CRGB> surface1 = mLayers[1]->getSurface();
76
77 for (fl::u32 i = 0; i < mNumLeds; i++) {
78 const CRGB &p0 = surface0[i];
79 const CRGB &p1 = surface1[i];
80 CRGB out = CRGB::blend(p0, p1, progress);
81 finalBuffer[i] = out;
82 }
83 if (progress == 255) {
85 }
86}
uint16_t speed
Definition Noise.ino:66
FxLayerPtr mLayers[2]
const fl::u32 mNumLeds
void completeTransition()
Transition mTransition
const T * data() const FL_NOEXCEPT
Definition span.h:461
void * memcpy(void *dest, const void *src, size_t n) FL_NOEXCEPT
unsigned char u8
Definition stdint.h:131
fl::CRGB CRGB
Definition video.h:15
static CRGB blend(const CRGB &p1, const CRGB &p2, fract8 amountOfP2) FL_NOEXCEPT
Definition crgb.cpp.hpp:54

References fl::CRGB::blend(), completeTransition(), fl::span< T, Extent >::data(), fl::memcpy(), mLayers, mNumLeds, mTransition, and speed.

+ Here is the call graph for this function: