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

◆ PaintVuSpaceInvaders()

void Painter::PaintVuSpaceInvaders ( uint32_t now_ms,
const KeyboardState & keyboard,
const int * led_column_table,
int led_column_table_length,
LedRopeInterface * led_rope )
staticprivate

Definition at line 450 of file Painter.cpp.

453 {
455
456 Color3i black = Color3i::Black();
457
458 for (int i = 0; i < led_column_table_length; ++i) {
459 const Key& key = keyboard.mKeys[i];
460
461 const int pixel_count = led_column_table[i];
462 const int draw_pixel_count = fl::ceil(pixel_count * fl::sqrt(key.mCurrColor.v_));
463
464 const int black_pixel_count = pixel_count - draw_pixel_count;
465
466 // If i is even
467 if (i % 2 == 0) {
468 for (int j = 0; j < black_pixel_count; ++j) {
470 }
471 for (int j = 0; j < draw_pixel_count; ++j) {
472 led_rope->RawDrawPixel(black);
473 }
474 } else {
475
476 for (int j = 0; j < draw_pixel_count; ++j) {
477 led_rope->RawDrawPixel(black);
478 }
479
480 for (int j = 0; j < black_pixel_count; ++j) {
482 }
483 }
484 }
486}
LedRopeTCL led_rope(kNumKeys)
KeyboardState keyboard
Key mKeys[kNumKeys]
Definition Keyboard.h:103
void RawCommitDraw()
void RawDrawPixel(const Color3i &c)
Color3i * GetIterator(int i)
Definition LedRopeTCL.h:58
void RawBeginDraw()
constexpr enable_if< is_fixed_point< T >::value, T >::type ceil(T x) FL_NOEXCEPT
constexpr enable_if< is_fixed_point< T >::value, T >::type sqrt(T x) FL_NOEXCEPT
static Color3i Black()
Definition color.h:7
float v_
Definition color.h:108
ColorHSV mCurrColor
Definition Keyboard.h:48

References Color3i::Black(), fl::ceil(), keyboard, led_rope, Key::mCurrColor, fl::sqrt(), and ColorHSV::v_.

Referenced by Paint().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: