mirror of
https://github.com/usatiuk/cardboy.git
synced 2025-10-28 23:27:49 +01:00
49 lines
1.1 KiB
C++
49 lines
1.1 KiB
C++
//
|
|
// Created by Stepan Usatiuk on 02.03.2025.
|
|
//
|
|
|
|
#ifndef CB_DISP_TOOLS_HPP
|
|
#define CB_DISP_TOOLS_HPP
|
|
#include <display.hpp>
|
|
|
|
|
|
class DispTools {
|
|
public:
|
|
static DispTools& get();
|
|
|
|
void clear() {
|
|
for (int y = 0; y < DISP_HEIGHT; y++) {
|
|
for (int x = 0; x < DISP_WIDTH; x++) {
|
|
disp_frame[y][x] = 1;
|
|
}
|
|
}
|
|
}
|
|
bool get_pixel(int x, int y) {
|
|
// if (x < 0 || x >= DISP_WIDTH || y < 0 || y >= DISP_HEIGHT)
|
|
// assert(false);
|
|
return disp_frame[y][x];
|
|
}
|
|
void reset_pixel(int x, int y) {
|
|
// if (x < 0 || x >= DISP_WIDTH || y < 0 || y >= DISP_HEIGHT)
|
|
// assert(false);
|
|
|
|
disp_frame[y][x] = true;
|
|
}
|
|
void set_pixel(int x, int y) {
|
|
// if (x < 0 || x >= DISP_WIDTH || y < 0 || y >= DISP_HEIGHT)
|
|
// assert(false);
|
|
//
|
|
disp_frame[y][x] = false;
|
|
}
|
|
void draw_rectangle(int x1, int y1, int x2, int y2);
|
|
void draw_line(int x1, int y1, int x2, int y2);
|
|
void draw_circle(int x, int y, int r);
|
|
void draw_to_display();
|
|
|
|
private:
|
|
SMD::disp_frame_t disp_frame;
|
|
};
|
|
|
|
|
|
#endif // DISP_TOOLS_HPP
|