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