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