2019-06-11 17:48:09 +00:00
|
|
|
#pragma once
|
|
|
|
#include "my_fastled.h"
|
|
|
|
#include "config.h"
|
|
|
|
#include "prototypes.h"
|
|
|
|
|
|
|
|
class Window {
|
2019-09-04 03:58:36 +00:00
|
|
|
private:
|
|
|
|
void _circle_point(int x0, int y0, int x1, int y1, CRGB* color);
|
2019-06-11 17:48:09 +00:00
|
|
|
public:
|
|
|
|
const uint8_t x, y;
|
|
|
|
const uint8_t width, height;
|
2019-06-14 03:32:17 +00:00
|
|
|
uint16_t count;
|
2019-06-11 17:48:09 +00:00
|
|
|
static Window* getFullWindow();
|
2019-06-19 20:22:37 +00:00
|
|
|
|
2019-06-11 17:48:09 +00:00
|
|
|
Window(): Window(0, 0, LED_WIDTH, LED_HEIGHT) {};
|
|
|
|
Window(uint8_t x, uint8_t y) : Window(x, y, LED_WIDTH-x, LED_HEIGHT-y) {};
|
2019-06-14 03:32:17 +00:00
|
|
|
Window(uint8_t x, uint8_t y, uint8_t width, uint8_t height) : x(x), y(y), width(width), height(height) { count = width*height; };
|
2019-06-11 17:48:09 +00:00
|
|
|
|
|
|
|
void clear();
|
|
|
|
void clear(CRGB* color);
|
|
|
|
void setPixel(uint8_t x, uint8_t y, CRGB* color);
|
2019-09-25 04:27:43 +00:00
|
|
|
void setSubPixel(accum88 x, accum88 y, CRGB* color);
|
2019-06-11 17:48:09 +00:00
|
|
|
void setPixelByIndex(uint16_t index, CRGB* color);
|
2019-06-19 20:22:37 +00:00
|
|
|
void raisePixel(uint8_t x, uint8_t y, CRGB* color);
|
2019-06-15 12:16:27 +00:00
|
|
|
void line(uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2, CRGB* color);
|
|
|
|
void lineWithAngle(uint8_t x, uint8_t y, uint8_t angle, uint8_t length, CRGB* color);
|
|
|
|
void lineWithAngle(uint8_t x, uint8_t y, uint8_t angle, uint8_t startdist, uint8_t length, CRGB* color);
|
|
|
|
void circle(uint8_t x, uint8_t y, uint8_t r, CRGB* color);
|
2019-06-11 17:48:09 +00:00
|
|
|
uint16_t coordsToGlobalIndex(uint8_t x, uint8_t y);
|
|
|
|
uint16_t localToGlobalIndex(uint16_t);
|
2019-09-25 04:27:43 +00:00
|
|
|
void drawChar(Font* f, accum88 x, accum88 y, const char c, CRGB* color, bool mask=false);
|
|
|
|
void drawText(Font* f, uint16_t x, uint16_t y, String s, CRGB* color);
|
|
|
|
void drawSubText(Font* f, accum88 x, accum88 y, String s, CRGB* color);
|
2019-06-11 17:48:09 +00:00
|
|
|
void addPixelColor(uint16_t index, CRGB* color);
|
2019-09-25 04:27:43 +00:00
|
|
|
void addPixelColor(uint8_t x, uint8_t y, CRGB* color);
|
|
|
|
CRGB get_pixel(uint8_t x, uint8_t y);
|
2019-06-11 17:48:09 +00:00
|
|
|
void fadeToBlackBy(fract8 speed);
|
2019-09-25 04:27:43 +00:00
|
|
|
void shift_down();
|
|
|
|
void shift_down_and_blur();
|
|
|
|
void clear_row(uint8_t y);
|
|
|
|
void blur(fract8 intensity);
|
|
|
|
void blur_rows(fract8 intensity);
|
|
|
|
void blur_row(uint8_t y, fract8 intensity);
|
|
|
|
void blur_columns(fract8 intensity);
|
|
|
|
void blur_column(uint8_t x, fract8 intensity);
|
2019-06-11 17:48:09 +00:00
|
|
|
};
|