FastLED 3.9.15
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages

◆ DrawRepeat()

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

Implements LedRopeInterface.

Definition at line 159 of file LedRopeTCL.cpp.

159 {
160 RawBeginDraw();
161
162 // Make sure that the number of colors to repeat does not exceed the length
163 // of the rope.
164 const int len = min(array_length, frame_buffer_.length());
165
166 for (int i = 0; i < len; ++i) {
167 const Color3i* cur_color = GetIterator(i); // Current color.
168 const int repeat_count = value_array[i];
169 // Repeatedly send the same color down the led rope.
170 for (int k = 0; k < repeat_count; ++k) {
171 RawDrawPixel(cur_color->r_, cur_color->g_, cur_color->b_);
172 }
173 }
174 // Finish the drawing.
176}
void RawCommitDraw()
void RawDrawPixel(const Color3i &c)
FrameBuffer frame_buffer_
Definition LedRopeTCL.h:75
Color3i * GetIterator(int i)
Definition LedRopeTCL.h:59
void RawBeginDraw()
uint8_t b_
Definition color.h:52
uint8_t g_
Definition color.h:52
uint8_t r_
Definition color.h:52

References Color3i::b_, frame_buffer_, Color3i::g_, GetIterator(), Color3i::r_, RawBeginDraw(), RawCommitDraw(), and RawDrawPixel().

+ Here is the call graph for this function: