root / proj / include / graph.h @ 181
History | View | Annotate | Download (1.22 KB)
1 | 168 | up20180642 | #ifndef GRAPH_H_INCLUDED
|
---|---|---|---|
2 | #define GRAPH_H_INCLUDED
|
||
3 | |||
4 | 174 | up20180642 | /// MACROS
|
5 | //#define GET_ALP(n) (0xFF & ((n) >> 24))
|
||
6 | 168 | up20180642 | #define GET_RED(n) (0xFF & ((n) >> 16)) |
7 | #define GET_GRE(n) (0xFF & ((n) >> 8)) |
||
8 | #define GET_BLU(n) (0xFF & (n )) |
||
9 | 174 | up20180642 | //#define SET_ALP(n) (((n)&0xFF) << 24)
|
10 | 168 | up20180642 | #define SET_RED(n) (((n)&0xFF) << 16) |
11 | #define SET_GRE(n) (((n)&0xFF) << 8) |
||
12 | #define SET_BLU(n) (((n)&0xFF) ) |
||
13 | 174 | up20180642 | #define SET_RGB(r,g,b) (SET_RED(r) | SET_GRE(g) | SET_BLU(b))
|
14 | 168 | up20180642 | |
15 | 174 | up20180642 | /// PUBLIC GET
|
16 | uint16_t (graph_get_XRes) (void);
|
||
17 | uint16_t (graph_get_YRes) (void);
|
||
18 | 168 | up20180642 | |
19 | 174 | up20180642 | /// INIT
|
20 | int (graph_init)(uint16_t mode);
|
||
21 | 168 | up20180642 | |
22 | 174 | up20180642 | /// CLEANUP
|
23 | 168 | up20180642 | int (graph_cleanup)(void); |
24 | |||
25 | 174 | up20180642 | /// PIXEL DRAWING
|
26 | int (graph_set_pixel) (uint16_t x, uint16_t y, uint32_t color);
|
||
27 | int (graph_set_pixel_alpha)(uint16_t x, uint16_t y, uint32_t color, uint8_t alpha);
|
||
28 | 168 | up20180642 | |
29 | 174 | up20180642 | /// SCREEN
|
30 | int (graph_clear_screen)(void); |
||
31 | 168 | up20180642 | |
32 | 174 | up20180642 | /// DRAW
|
33 | int (graph_draw)(void); |
||
34 | 168 | up20180642 | |
35 | |||
36 | |||
37 | 174 | up20180642 | /// RECTANGLE
|
38 | 168 | up20180642 | |
39 | |||
40 | int (graph_draw_hline)(uint16_t x, uint16_t y, uint16_t len, uint32_t color);
|
||
41 | int (graph_draw_rectangle)(uint16_t x, uint16_t y,uint16_t width, uint16_t height, uint32_t color);
|
||
42 | |||
43 | #endif /* end of include guard: GRAPH_H_INCLUDED */ |