@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.
| 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>; |
no test coverage detected