FastLED 3.9.15
Loading...
Searching...
No Matches

◆ DrawRepeat()

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

Implements LedRopeInterface.

Definition at line 161 of file LedRopeTCL.cpp.

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

+ Here is the call graph for this function: