-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEffect.cpp
More file actions
32 lines (26 loc) · 733 Bytes
/
Effect.cpp
File metadata and controls
32 lines (26 loc) · 733 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*
* The Effect implementation for the TechnocolourDreamcoat project.
*/
#include "Effect.h"
Effect::Effect(CRGB *leds, int width, int height): leds(leds), width(width), height(height) {}
bool Effect::inXRange(int x) {
return x >= 0 && x < width;
}
bool Effect::inYRange(int y) {
return y >= 0 && y < height;
}
struct CRGB& Effect::pixel(int x, int y) {
if (y & 1) {
if ((y * width) + width - x - 1<86){ // tentativo di aggiustare lo shift in plasma
return leds[(y * width) + width - x - 1];
}
else {
return leds[(y * width) + width - x];
}
} else {
return leds[(y * width) + x];
}
}
void Effect::clearLeds() {
memset8(leds, 0, width * height * 3);
}