2019-12-08 16:16:33 +01:00
|
|
|
#ifndef IMAGE_HPP
|
|
|
|
#define IMAGE_HPP
|
|
|
|
|
|
|
|
#include <Arduino.h>
|
|
|
|
|
2023-04-24 21:52:33 +02:00
|
|
|
#define MAXIMUM_PANELSIZE 5
|
|
|
|
#define PANEL_WIDTH 32
|
|
|
|
#define PANEL_HEIGHT 40
|
|
|
|
|
|
|
|
#define IMAGE_WIDTH (PANEL_WIDTH * MAXIMUM_PANELSIZE)
|
|
|
|
#define IMAGE_HEIGHT PANEL_HEIGHT
|
2019-12-08 16:16:33 +01:00
|
|
|
|
2023-05-03 22:05:05 +02:00
|
|
|
#define IMAGE_BUFFER (IMAGE_WIDTH * IMAGE_HEIGHT)
|
|
|
|
|
2019-12-08 16:16:33 +01:00
|
|
|
class Image
|
|
|
|
{
|
|
|
|
public:
|
2023-04-24 21:52:33 +02:00
|
|
|
uint8_t get_pixel(int x, int y);
|
|
|
|
void set_pixel(int x, int y, uint8_t value);
|
2023-04-25 21:42:31 +02:00
|
|
|
void set_pixel_offset(int offset, uint8_t value);
|
2019-12-08 16:16:33 +01:00
|
|
|
void clear_pixels();
|
|
|
|
|
|
|
|
private:
|
|
|
|
bool check_bounds(int x, int y);
|
|
|
|
|
2023-05-03 22:05:05 +02:00
|
|
|
uint8_t data[IMAGE_BUFFER];
|
2019-12-08 16:16:33 +01:00
|
|
|
|
|
|
|
};
|
|
|
|
|
2023-04-24 21:52:33 +02:00
|
|
|
#endif
|