root / proj / graphics.h @ 163
History | View | Annotate | Download (2.34 KB)
1 |
#ifndef GRAPHICS_H_INCLUDED
|
---|---|
2 |
#define GRAPHICS_H_INCLUDED
|
3 |
|
4 |
#include <lcom/lcf.h> |
5 |
#include <stdint.h> |
6 |
|
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 SET_ALP(n) (((n)&0xFF) << 24) |
12 |
#define SET_RED(n) (((n)&0xFF) << 16) |
13 |
#define SET_GRE(n) (((n)&0xFF) << 8) |
14 |
#define SET_BLU(n) (((n)&0xFF) ) |
15 |
#define SET_RGB(r,g,b) ( SET_RED(r) | SET_GRE(g) | SET_BLU(b))
|
16 |
#define SET_ARGB(a,r,g,b) (SET_ALP(a) | SET_RED(r) | SET_GRE(g) | SET_BLU(b))
|
17 |
#define FAR2PHYS(n) ((((n)>>12) & 0xFFFFFFF0) + ((n) & 0x0000FFFF)) |
18 |
|
19 |
typedef struct __attribute__((packed)) { |
20 |
|
21 |
char VbeSignature[4] ; |
22 |
uint16_t VbeVersion ; |
23 |
uint32_t OemStringPtr ; |
24 |
uint8_t Capabilities[4] ;
|
25 |
uint32_t VideoModePtr ; |
26 |
uint16_t TotalMemory ; |
27 |
|
28 |
uint16_t OemSoftwareRev ; |
29 |
uint32_t OemVendorNamePtr ; |
30 |
uint32_t OemProductNamePtr ; |
31 |
uint32_t OemProductRevPtr ; |
32 |
char Reserved[222] ; |
33 |
|
34 |
char OemData[256] ; |
35 |
} VbeInfoBlock; |
36 |
|
37 |
int (get_permission)(unsigned int base_addr, unsigned int size); |
38 |
|
39 |
//int (get_permissions_first_mbyte)(void);
|
40 |
|
41 |
int (vbe_get_mode_information)(uint16_t mode);
|
42 |
|
43 |
int (vbe_get_controller_information)(vg_vbe_contr_info_t *info_p);
|
44 |
|
45 |
phys_bytes get_phys_addr(void);
|
46 |
|
47 |
unsigned int get_vram_size(void); |
48 |
|
49 |
uint16_t get_XRes(void);
|
50 |
|
51 |
uint16_t get_YRes(void);
|
52 |
|
53 |
uint16_t get_bits_pixel(void);
|
54 |
|
55 |
uint16_t get_bytes_pixel(void);
|
56 |
|
57 |
uint16_t get_RedMaskSize(void);
|
58 |
|
59 |
uint16_t get_GreenMaskSize(void);
|
60 |
|
61 |
uint16_t get_BlueMaskSize(void);
|
62 |
|
63 |
int (map_vram)(void); |
64 |
|
65 |
int (free_memory_map)(void); |
66 |
|
67 |
int (set_pixel) (uint16_t x, uint16_t y, uint32_t color);
|
68 |
int (set_pixel_alpha)(uint16_t x, uint16_t y, uint32_t color, uint8_t alpha);
|
69 |
|
70 |
/**
|
71 |
* @brief
|
72 |
* @param mode
|
73 |
* @return
|
74 |
*/
|
75 |
int (set_graphics_mode)(uint16_t mode);
|
76 |
|
77 |
int (draw_hline)(uint16_t x, uint16_t y, uint16_t len, uint32_t color);
|
78 |
|
79 |
int (draw_rectangle)(uint16_t x, uint16_t y,uint16_t width, uint16_t height, uint32_t color);
|
80 |
|
81 |
int (paint_screen)(uint32_t color);
|
82 |
|
83 |
int (clear_screen)();
|
84 |
|
85 |
#endif /* end of include guard: GRAPHICS_H_INCLUDED */ |