355 {
356
358
359 uint32_t skipped_lights = 0;
360 for (int i = 0; i < led_column_table_length; ++i) {
361 const Key& key = keyboard.
keys_[i];
362 uint32_t painted_lights = 0;
363
364
365 const float active_lights_factor = led_column_table[i] * sqrt(key.
curr_color_.
v_);
366 const float inactive_lights_factor = 1.0f - active_lights_factor;
367 const float taper_point_1 = inactive_lights_factor / 2.0f;
368 const float taper_point_2 = taper_point_1 + active_lights_factor;
369
370 const int taper_idx_1 = static_cast<int>(floor(taper_point_1 * led_column_table[i]));
371 const int taper_idx_2 = static_cast<int>(floor(taper_point_2 * led_column_table[i]));
372
374
375 for (int i = 0; i < taper_idx_1 / 2; ++i) {
377 painted_lights++;
378 }
379
380 int length = taper_idx_2 - taper_idx_1;
381 for (int i = 0; i < min(200, length); ++i) {
383 painted_lights++;
384 }
385
386 length = led_column_table[i] - taper_idx_2;
387 for (int i = 0; i < length; ++i) {
389 painted_lights++;
390 }
391 skipped_lights +=
MAX(0,
static_cast<int32_t
>(led_column_table[i]) -
static_cast<int32_t
>(painted_lights));
392 }
393
394 for (uint32_t i = 0; i < skipped_lights; ++i) {
396 }
397
399}
virtual void RawDrawPixel(const Color3i &c)=0
virtual void RawCommitDraw()=0
virtual void RawBeginDraw()=0