root / proj / include / graph.h @ 181
History | View | Annotate | Download (1.22 KB)
1 |
#ifndef GRAPH_H_INCLUDED
|
---|---|
2 |
#define GRAPH_H_INCLUDED
|
3 |
|
4 |
/// MACROS
|
5 |
//#define GET_ALP(n) (0xFF & ((n) >> 24))
|
6 |
#define GET_RED(n) (0xFF & ((n) >> 16)) |
7 |
#define GET_GRE(n) (0xFF & ((n) >> 8)) |
8 |
#define GET_BLU(n) (0xFF & (n )) |
9 |
//#define SET_ALP(n) (((n)&0xFF) << 24)
|
10 |
#define SET_RED(n) (((n)&0xFF) << 16) |
11 |
#define SET_GRE(n) (((n)&0xFF) << 8) |
12 |
#define SET_BLU(n) (((n)&0xFF) ) |
13 |
#define SET_RGB(r,g,b) (SET_RED(r) | SET_GRE(g) | SET_BLU(b))
|
14 |
|
15 |
/// PUBLIC GET
|
16 |
uint16_t (graph_get_XRes) (void);
|
17 |
uint16_t (graph_get_YRes) (void);
|
18 |
|
19 |
/// INIT
|
20 |
int (graph_init)(uint16_t mode);
|
21 |
|
22 |
/// CLEANUP
|
23 |
int (graph_cleanup)(void); |
24 |
|
25 |
/// 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 |
|
29 |
/// SCREEN
|
30 |
int (graph_clear_screen)(void); |
31 |
|
32 |
/// DRAW
|
33 |
int (graph_draw)(void); |
34 |
|
35 |
|
36 |
|
37 |
/// RECTANGLE
|
38 |
|
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 */ |