-
Notifications
You must be signed in to change notification settings - Fork 0
/
headers.h~
56 lines (50 loc) · 1.31 KB
/
headers.h~
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef headers_h_
#define headers_h_
#include <linux/fb.h>
#include <sys/mman.h>
#include <sys/ioctl.h>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <vector>
#include <math.h>
#include <iostream>
#include <termios.h>
#include <cstring>
class framebuffer {
private:
struct fb_var_screeninfo vinfo;
struct fb_fix_screeninfo finfo;
char *fbp = 0;
long int screensize = 0;
int fbfd = 0;
int x = 0, y = 0;
long int location = 0;
uint8_t* fb_ptr;
uint8_t* framebuffer_ptr;
public:
framebuffer();
char* getfbp();
struct fb_var_screeninfo getvinfo();
struct fb_fix_screeninfo getfinfo();
void frameclose();
void render();
void clear();
};
class polygon {
private:
std::vector<int> points;
int poros[2];
public:
polygon(std::vector<int> _points);
void draw_fill(framebuffer f, int x, int y, int red, int green, int blue);
int *get_color(framebuffer f, int x, int y);
void block(framebuffer f, int startX, int startY, int height, int width, int red, int green, int blue);
void line(framebuffer f, int x0, int y0, int x1, int y1);
void *draw(framebuffer f, int scale);
void translation(int x, int y);
void rotation(float alpha);
void clip(framebuffer f, int xmin, int ymin, int xmax, int ymax);
};
#endif