27 lines
938 B
C
27 lines
938 B
C
|
#pragma once
|
||
|
#include "my_fastled.h"
|
||
|
#include "config.h"
|
||
|
#include "prototypes.h"
|
||
|
|
||
|
class Window {
|
||
|
public:
|
||
|
const uint8_t x, y;
|
||
|
const uint8_t width, height;
|
||
|
static Window* getFullWindow();
|
||
|
|
||
|
Window(): Window(0, 0, LED_WIDTH, LED_HEIGHT) {};
|
||
|
Window(uint8_t x, uint8_t y) : Window(x, y, LED_WIDTH-x, LED_HEIGHT-y) {};
|
||
|
Window(uint8_t x, uint8_t y, uint8_t width, uint8_t height) : x(x), y(y), width(width), height(height) {};
|
||
|
|
||
|
void clear();
|
||
|
void clear(CRGB* color);
|
||
|
void setPixel(uint8_t x, uint8_t y, CRGB* color);
|
||
|
void setPixelByIndex(uint16_t index, CRGB* color);
|
||
|
void line(uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2, CRGB* color, bool antialias=false);
|
||
|
uint16_t coordsToGlobalIndex(uint8_t x, uint8_t y);
|
||
|
uint16_t localToGlobalIndex(uint16_t);
|
||
|
void drawChar(Font* f, uint8_t x, uint8_t y, const char c, CRGB* color, bool mask=false);
|
||
|
void addPixelColor(uint16_t index, CRGB* color);
|
||
|
void fadeToBlackBy(fract8 speed);
|
||
|
};
|