forked from crom83/cromfarplugs
-
Notifications
You must be signed in to change notification settings - Fork 8
/
framebuffer.h
91 lines (79 loc) · 1.51 KB
/
framebuffer.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#pragma once
#define FB_FORMAT_UNKNOWN 0
#define FB_FORMAT_RGB565 1
#define FB_FORMAT_ARGB8888 2
#define FB_FORMAT_RGBA8888 3
#define FB_FORMAT_ABGR8888 4
#define FB_FORMAT_BGRA8888 5
#define FB_FORMAT_RGBX8888 FB_FORMAT_RGBA8888
struct fbinfo {
unsigned int version;
unsigned int bpp;
unsigned int size;
unsigned int width;
unsigned int height;
unsigned int red_offset;
unsigned int red_length;
unsigned int blue_offset;
unsigned int blue_length;
unsigned int green_offset;
unsigned int green_length;
unsigned int alpha_offset;
unsigned int alpha_length;
};
struct fb {
unsigned int bpp;
unsigned int size;
unsigned int width;
unsigned int height;
unsigned int red_offset;
unsigned int red_length;
unsigned int blue_offset;
unsigned int blue_length;
unsigned int green_offset;
unsigned int green_length;
unsigned int alpha_offset;
unsigned int alpha_length;
void* data;
};
typedef struct rgb888 {
char r;
char g;
char b;
} rgb888_t;
typedef rgb888_t rgb24_t;
typedef struct bgr888 {
char b;
char g;
char r;
} bgr888_t;
typedef struct argb8888 {
char a;
char r;
char g;
char b;
} argb8888_t;
typedef struct abgr8888 {
char a;
char b;
char g;
char r;
} abgr8888_t;
typedef struct bgra8888 {
char b;
char g;
char r;
char a;
} bgra8888_t;
typedef struct rgba8888 {
char r;
char g;
char b;
char a;
} rgba8888_t;
typedef struct rgb565 {
short b : 5;
short g : 6;
short r : 5;
} rgb565_t;
int SaveToClipboard(const struct fb* fb);