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 172 of file LedRopeTCL.cpp.

172 {
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.
189}
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_NOEXCEPT
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: