root / proj / graphics.h @ 167
History | View | Annotate | Download (2.51 KB)
1 | 146 | up20180655 | #ifndef GRAPHICS_H_INCLUDED
|
---|---|---|---|
2 | #define GRAPHICS_H_INCLUDED
|
||
3 | |||
4 | #include <lcom/lcf.h> |
||
5 | #include <stdint.h> |
||
6 | |||
7 | 160 | up20180642 | #define GET_ALP(n) (0xFF & ((n) >> 24)) |
8 | 146 | up20180655 | #define GET_RED(n) (0xFF & ((n) >> 16)) |
9 | #define GET_GRE(n) (0xFF & ((n) >> 8)) |
||
10 | #define GET_BLU(n) (0xFF & (n )) |
||
11 | 160 | up20180642 | #define SET_ALP(n) (((n)&0xFF) << 24) |
12 | 146 | up20180655 | #define SET_RED(n) (((n)&0xFF) << 16) |
13 | #define SET_GRE(n) (((n)&0xFF) << 8) |
||
14 | #define SET_BLU(n) (((n)&0xFF) ) |
||
15 | 160 | up20180642 | #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 | 146 | up20180655 | #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 | 165 | up20180642 | phys_bytes (graph_get_phys_addr) (void);
|
46 | unsigned (graph_get_vram_size) (void); |
||
47 | uint16_t (graph_get_XRes) (void);
|
||
48 | uint16_t (graph_get_YRes) (void);
|
||
49 | uint16_t (graph_get_bits_pixel) (void);
|
||
50 | uint16_t (graph_get_bytes_pixel) (void);
|
||
51 | uint16_t (graph_get_RedMaskSize) (void);
|
||
52 | uint16_t (graph_get_GreenMaskSize)(void);
|
||
53 | uint16_t (graph_get_BlueMaskSize) (void);
|
||
54 | 146 | up20180655 | |
55 | 165 | up20180642 | int (graph_map_vram)(void); |
56 | 146 | up20180655 | |
57 | 165 | up20180642 | int (graph_free_memory_map)(void); |
58 | 146 | up20180655 | |
59 | 165 | up20180642 | int (graph_set_pixel) (uint16_t x, uint16_t y, uint32_t color);
|
60 | int (graph_set_pixel_alpha)(uint16_t x, uint16_t y, uint32_t color, uint8_t alpha);
|
||
61 | 146 | up20180655 | |
62 | /**
|
||
63 | * @brief
|
||
64 | * @param mode
|
||
65 | * @return
|
||
66 | */
|
||
67 | 165 | up20180642 | int (graph_set_mode)(uint16_t mode);
|
68 | 146 | up20180655 | |
69 | 165 | up20180642 | int (graph_draw_hline)(uint16_t x, uint16_t y, uint16_t len, uint32_t color);
|
70 | 146 | up20180655 | |
71 | 165 | up20180642 | int (graph_draw_rectangle)(uint16_t x, uint16_t y,uint16_t width, uint16_t height, uint32_t color);
|
72 | 146 | up20180655 | |
73 | 165 | up20180642 | int (graph_paint_screen)(uint32_t color);
|
74 | 146 | up20180655 | |
75 | 165 | up20180642 | int (graph_clear_screen)(void); |
76 | 146 | up20180655 | |
77 | 165 | up20180642 | int (graph_draw)(void); |
78 | |||
79 | 146 | up20180655 | #endif /* end of include guard: GRAPHICS_H_INCLUDED */ |