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

Method DrawRepeat

examples/LuminescentGrand/arduino/LedRopeTCL.cpp:172–189  ·  view source on GitHub ↗

//////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

170
171///////////////////////////////////////////////////////////////////////////////
172void LedRopeTCL::DrawRepeat(const int* value_array, int array_length) {
173 RawBeginDraw();
174
175 // Make sure that the number of colors to repeat does not exceed the length
176 // of the rope.
177 const int len = fl::min(array_length, mFrameBuffer.length());
178
179 for (int i = 0; i < len; ++i) {
180 const Color3i* cur_color = GetIterator(i); // Current color.
181 const int repeat_count = value_array[i];
182 // Repeatedly send the same color down the led rope.
183 for (int k = 0; k < repeat_count; ++k) {
184 RawDrawPixel(cur_color->r_, cur_color->g_, cur_color->b_);
185 }
186 }
187 // Finish the drawing.
188 RawCommitDraw();
189}
190

Callers 1

PaintMethod · 0.80

Calls 1

lengthMethod · 0.45

Tested by

no test coverage detected