Project

General

Profile

Statistics
| Revision:

root / proj / include / graph.h @ 224

History | View | Annotate | Download (1.13 KB)

1
#ifndef GRAPH_H_INCLUDED
2
#define GRAPH_H_INCLUDED
3

    
4
#include "graph_macros.h"
5

    
6
/// MACROS
7
#define GET_ALP(n)          (0xFF & ((n) >> 24))
8
#define GET_RED(n)          (0xFF & ((n) >> 16))
9
#define GET_GRE(n)          (0xFF & ((n) >>  8))
10
#define GET_BLU(n)          (0xFF & (n      ))
11
#define GET_COLOR(n)        (0xFFFFFF & (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
uint16_t   (graph_get_bytes_pixel)  (void);
22

    
23
/// INIT
24
int (graph_init)(uint16_t mode);
25

    
26
/// CLEANUP
27
int (graph_cleanup)(void);
28

    
29
/// PIXEL DRAWING
30
int (graph_set_pixel)             (uint16_t x, uint16_t y, uint32_t color);
31
void (graph_set_pixel_pos)         (unsigned pos          , uint32_t color);
32

    
33
/// SCREEN
34
int (graph_clear_screen)(void);
35

    
36
/// DRAW
37
int (graph_draw)(void);
38

    
39
#endif /* end of include guard: GRAPH_H_INCLUDED */