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

◆ renderLed()

void Ripple::renderLed ( byte ledColors[40][14][3],
unsigned long age )
inlineprivate

Definition at line 392 of file ripple.h.

392 {
393 int strip = ledAssignments[position[0]][0];
394 int led = ledAssignments[position[0]][2] + position[1];
395 FL_UNUSED(strip);
396 FL_UNUSED(led);
397
398 int red = ledColors[position[0]][position[1]][0];
399 int green = ledColors[position[0]][position[1]][1];
400 int blue = ledColors[position[0]][position[1]][2];
401
402 ledColors[position[0]][position[1]][0] = byte(min(255, max(0, int(fmap(float(age), 0.0, float(lifespan), (color >> 8) & 0xFF, 0.0)) + red)));
403 ledColors[position[0]][position[1]][1] = byte(min(255, max(0, int(fmap(float(age), 0.0, float(lifespan), (color >> 16) & 0xFF, 0.0)) + green)));
404 ledColors[position[0]][position[1]][2] = byte(min(255, max(0, int(fmap(float(age), 0.0, float(lifespan), color & 0xFF, 0.0)) + blue)));
405
406#ifdef DEBUG_RENDERING
407 Serial.print("Rendering ripple position (");
408 Serial.print(position[0]);
409 Serial.print(',');
410 Serial.print(position[1]);
411 Serial.print(") at Strip ");
412 Serial.print(strip);
413 Serial.print(", LED ");
414 Serial.print(led);
415 Serial.print(", color 0x");
416 for (int i = 0; i < 3; i++) {
417 if (ledColors[position[0]][position[1]][i] <= 0x0F)
418 Serial.print('0');
419 Serial.print(ledColors[position[0]][position[1]][i], HEX);
420 }
421 Serial.println();
422#endif
423 }
int position[2]
Definition ripple.h:49
unsigned long color
Definition ripple.h:43
unsigned long lifespan
Definition ripple.h:375
int ledAssignments[40][3]
Definition mapping.h:95
uint8_t byte
Definition midi_Defs.h:36
float fmap(float x, float in_min, float in_max, float out_min, float out_max)
Definition ripple.h:31
#define FL_UNUSED(x)
Definition unused.h:8

References color, FL_UNUSED, fmap(), ledAssignments, lifespan, and position.

Referenced by advance().

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