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
396 int red = ledColors[position[0]][position[1]][0];
397 int green = ledColors[position[0]][position[1]][1];
398 int blue = ledColors[position[0]][position[1]][2];
399
400 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)));
401 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)));
402 ledColors[position[0]][position[1]][2] = byte(min(255, max(0, int(fmap(float(age), 0.0, float(lifespan), color & 0xFF, 0.0)) + blue)));
403
404#ifdef DEBUG_RENDERING
405 Serial.print("Rendering ripple position (");
406 Serial.print(position[0]);
407 Serial.print(',');
408 Serial.print(position[1]);
409 Serial.print(") at Strip ");
410 Serial.print(strip);
411 Serial.print(", LED ");
412 Serial.print(led);
413 Serial.print(", color 0x");
414 for (int i = 0; i < 3; i++) {
415 if (ledColors[position[0]][position[1]][i] <= 0x0F)
416 Serial.print('0');
417 Serial.print(ledColors[position[0]][position[1]][i], HEX);
418 }
419 Serial.println();
420#endif
421 }
byte ledColors[40][14][3]
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

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

Referenced by advance().

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