42 lines
988 B
C++
42 lines
988 B
C++
#ifndef LEDHAL2D_H
|
|
#define LEDHAL2D_H
|
|
|
|
#include "LEDHAL.h"
|
|
|
|
#include "GULLS_GFX.h"
|
|
|
|
class LEDHAL2D : public LEDHAL, public GULLS_GFX {
|
|
public:
|
|
LEDHAL2D(int16_t width, int16_t height, char* ledName, bool isPhysical) :
|
|
LEDHAL(ledName, isPhysical), GULLS_GFX(width, height), _width(width), _height(height) {}
|
|
|
|
virtual uint16_t getNumLEDs() = 0;
|
|
virtual CRGB getColor(int16_t pixel) = 0;
|
|
virtual void drawPixel(int16_t x, int16_t y, CRGB color) = 0;
|
|
virtual CRGB getColor(int16_t x, int16_t y) = 0;
|
|
|
|
virtual int16_t getWidth() {
|
|
return _width;
|
|
}
|
|
|
|
virtual int16_t getHeight() {
|
|
return _height;
|
|
}
|
|
|
|
virtual void clearLEDs() {
|
|
CRGB noColor(0, 0, 0);
|
|
|
|
for(int16_t x = 0; x < getWidth(); x++) {
|
|
for(int16_t y = 0; y < getHeight(); y++) {
|
|
drawPixel(x, y, noColor);
|
|
}
|
|
}
|
|
}
|
|
|
|
private:
|
|
int16_t
|
|
_width,
|
|
_height; //TODO Really need to be getting these values from GFX
|
|
};
|
|
|
|
#endif |