-
Notifications
You must be signed in to change notification settings - Fork 0
/
FastLED_RPIRGBPanel_GFX.cpp
32 lines (26 loc) · 1015 Bytes
/
FastLED_RPIRGBPanel_GFX.cpp
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
/*-------------------------------------------------------------------------
Arduino library based on Adafruit_Neomatrix
by Marc MERLIN <marc_soft@merlins.org>
You should have received a copy of the GNU Lesser General Public
License along with NeoMatrix. If not, see
<http://www.gnu.org/licenses/>.
-------------------------------------------------------------------------*/
#include <FastLED_RPIRGBPanel_GFX.h>
FastLED_RPIRGBPanel_GFX::FastLED_RPIRGBPanel_GFX(CRGB *__fb, const uint16_t fbw, const uint16_t fbh):
Framebuffer_GFX(__fb, fbw, fbh, NULL), _fbw(fbw), _fbh(fbh) {
}
void FastLED_RPIRGBPanel_GFX::show() {
Framebuffer_GFX::showfps();
for (uint16_t y = 0; y < _fbh; y++) {
for (uint16_t x = 0; x < _fbw; x++) {
CRGB pixel = _fb[y*matrixWidth + x];
uint8_t r = pixel.r;
uint8_t g = pixel.g;
uint8_t b = pixel.b;
_matrix->SetPixel(x, y, r, g, b);
// 90 degree rotation test
//_matrix->SetPixel(191-y, x, r, g, b);
}
}
}
// vim:sts=4:sw=4