Project

General

Profile

Statistics
| Revision:

root / proj / include / graph.h @ 253

History | View | Annotate | Download (1.29 KB)

1
#ifndef GRAPH_H_INCLUDED
2
#define GRAPH_H_INCLUDED
3

    
4
#include "graph_macros.h"
5

    
6
// Colors in RBG (8 bit)
7
#define GRAPH_BLACK               0x000000
8
#define GRAPH_WHITE               0xFFFFFF
9

    
10
// Alpha
11
#define ALPHA_THRESHOLD     0x7F
12

    
13
/// MACROS
14
#define GET_ALP(n)          (0xFF & ((n) >> 24))
15
#define GET_RED(n)          (0xFF & ((n) >> 16))
16
#define GET_GRE(n)          (0xFF & ((n) >>  8))
17
#define GET_BLU(n)          (0xFF & (n      ))
18
#define GET_COLOR(n)        (0xFFFFFF & (n))
19
#define SET_ALP(n)          (((n)&0xFF) << 24)
20
#define SET_RED(n)          (((n)&0xFF) << 16)
21
#define SET_GRE(n)          (((n)&0xFF) <<  8)
22
#define SET_BLU(n)          (((n)&0xFF)      )
23
#define SET_RGB(r,g,b)      (SET_RED(r) | SET_GRE(g) | SET_BLU(b))
24

    
25
/// PUBLIC GET
26
uint16_t   (graph_get_XRes)         (void);
27
uint16_t   (graph_get_YRes)         (void);
28
uint16_t   (graph_get_bytes_pixel)  (void);
29

    
30
/// INIT
31
int (graph_init)(uint16_t mode);
32

    
33
/// CLEANUP
34
int (graph_cleanup)(void);
35

    
36
/// PIXEL DRAWING
37
int (graph_set_pixel)             (uint16_t x, uint16_t y, uint32_t color);
38
void (graph_set_pixel_pos)         (unsigned pos          , uint32_t color);
39

    
40
/// SCREEN
41
int (graph_clear_screen)(void);
42

    
43
/// DRAW
44
int (graph_draw)(void);
45

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