root / proj / include / graph.h @ 266
History | View | Annotate | Download (1.55 KB)
1 | 168 | up20180642 | #ifndef GRAPH_H_INCLUDED
|
---|---|---|---|
2 | #define GRAPH_H_INCLUDED
|
||
3 | |||
4 | 261 | up20180642 | // Graphics modes
|
5 | #define INDEXED_1024_768 0x105 |
||
6 | #define DIRECT_640_480_888 0x110 |
||
7 | #define DIRECT_800_600_888 0x115 |
||
8 | #define DIRECT_1024_768_888 0x118 |
||
9 | #define DIRECT_1280_1024_565 0x11A |
||
10 | #define DIRECT_1280_1024_888 0x11B |
||
11 | #define LINEAR_FRAME_BUFFER_MD BIT(14) |
||
12 | |||
13 | 253 | up20180642 | // Colors in RBG (8 bit)
|
14 | #define GRAPH_BLACK 0x000000 |
||
15 | #define GRAPH_WHITE 0xFFFFFF |
||
16 | |||
17 | // Alpha
|
||
18 | #define ALPHA_THRESHOLD 0x7F |
||
19 | |||
20 | 174 | up20180642 | /// MACROS
|
21 | 183 | up20180642 | #define GET_ALP(n) (0xFF & ((n) >> 24)) |
22 | 168 | up20180642 | #define GET_RED(n) (0xFF & ((n) >> 16)) |
23 | #define GET_GRE(n) (0xFF & ((n) >> 8)) |
||
24 | #define GET_BLU(n) (0xFF & (n )) |
||
25 | 183 | up20180642 | #define GET_COLOR(n) (0xFFFFFF & (n)) |
26 | #define SET_ALP(n) (((n)&0xFF) << 24) |
||
27 | 168 | up20180642 | #define SET_RED(n) (((n)&0xFF) << 16) |
28 | #define SET_GRE(n) (((n)&0xFF) << 8) |
||
29 | #define SET_BLU(n) (((n)&0xFF) ) |
||
30 | 174 | up20180642 | #define SET_RGB(r,g,b) (SET_RED(r) | SET_GRE(g) | SET_BLU(b))
|
31 | 168 | up20180642 | |
32 | 174 | up20180642 | /// PUBLIC GET
|
33 | uint16_t (graph_get_XRes) (void);
|
||
34 | uint16_t (graph_get_YRes) (void);
|
||
35 | 208 | up20180642 | uint16_t (graph_get_bytes_pixel) (void);
|
36 | 168 | up20180642 | |
37 | 174 | up20180642 | /// INIT
|
38 | int (graph_init)(uint16_t mode);
|
||
39 | 168 | up20180642 | |
40 | 174 | up20180642 | /// CLEANUP
|
41 | 168 | up20180642 | int (graph_cleanup)(void); |
42 | |||
43 | 174 | up20180642 | /// PIXEL DRAWING
|
44 | 183 | up20180642 | int (graph_set_pixel) (uint16_t x, uint16_t y, uint32_t color);
|
45 | 208 | up20180642 | void (graph_set_pixel_pos) (unsigned pos , uint32_t color); |
46 | 168 | up20180642 | |
47 | 174 | up20180642 | /// SCREEN
|
48 | int (graph_clear_screen)(void); |
||
49 | 168 | up20180642 | |
50 | 174 | up20180642 | /// DRAW
|
51 | int (graph_draw)(void); |
||
52 | 168 | up20180642 | |
53 | #endif /* end of include guard: GRAPH_H_INCLUDED */ |