FastLED 3.10.8
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 61 of file fx_compositor.h.

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

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

+ Here is the call graph for this function: