FastLED 3.10.10
Loading...
Searching...
No Matches

◆ DrawRepeat()

void LedRopeTCL::DrawRepeat ( const int * value_array,
int array_length )
virtual

Implements LedRopeInterface.

Definition at line 178 of file LedRopeTCL.cpp.

178 {
179 RawBeginDraw();
180
181 // Make sure that the number of colors to repeat does not exceed the length
182 // of the rope.
183 const int len = fl::min(array_length, mFrameBuffer.length());
184
185 for (int i = 0; i < len; ++i) {
186 const Color3i* cur_color = GetIterator(i); // Current color.
187 const int repeat_count = value_array[i];
188 // Repeatedly send the same color down the led rope.
189 for (int k = 0; k < repeat_count; ++k) {
190 RawDrawPixel(cur_color->r_, cur_color->g_, cur_color->b_);
191 }
192 }
193 // Finish the drawing.
195}
FrameBuffer mFrameBuffer
Definition LedRopeTCL.h:74
void RawCommitDraw()
void RawDrawPixel(const Color3i &c)
Color3i * GetIterator(int i)
Definition LedRopeTCL.h:58
void RawBeginDraw()
FL_DISABLE_WARNING_PUSH U constexpr common_type_t< T, U > min(T a, U b) FL_NO_EXCEPT
Definition math.h:71
uint8_t b_
Definition color.h:56
uint8_t g_
Definition color.h:56
uint8_t r_
Definition color.h:56

References Color3i::b_, Color3i::g_, GetIterator(), mFrameBuffer, fl::min(), Color3i::r_, RawBeginDraw(), RawCommitDraw(), and RawDrawPixel().

+ Here is the call graph for this function: