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

Method flush

src/fl/fx/2d/wave.cpp.hpp:50–59  ·  view source on GitHub ↗

@brief Process all accumulated entries and update LEDs Performs a single gradient fill operation for all accumulated alphas, then writes the resulting colors to their corresponding LEDs. Clears the batch after processing.

Source from the content-addressed store, hash-verified

48 /// alphas, then writes the resulting colors to their corresponding LEDs.
49 /// Clears the batch after processing.
50 void flush() {
51 span<const u8> alphas(mAlphas);
52 CRGB rgb[kMaxBatchSize] = {};
53 mGradient->fill(mAlphas, rgb);
54 for (size_t i = 0; i < mIndices.size(); i++) {
55 mLeds[mIndices[i]] = rgb[i];
56 }
57 mAlphas.clear();
58 mIndices.clear();
59 }
60
61 static const size_t kMaxBatchSize = 32; ///< Maximum batch size before forced flush
62 using ArrayIndices = fl::FixedVector<fl::u32, kMaxBatchSize>;

Callers 1

mapWaveToLEDsMethod · 0.45

Calls 3

fillMethod · 0.45
sizeMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected