Debian Codegraph @

include/graphics.h

raw symbols SCIP
1 // include/graphics.h
2
3 /*
4 Archtecture Graphics Size Definations
5
6 Low-level definations for blitting functions and other
7 things related to graphics.
8
9 Do not adjust these values unless you are specifically
10 told to or know what you are doing.
11
12
13 */
14
15 #ifndef GRAPHICS_H
16 #define GRAPHICS_H
17
18 #include <sys/types.h>
19 #include "../include/os.h"
20
21
22 /*
23 * Bytes per pixel sizes:
24 */
25 #ifndef BYTES_PER_PIXEL8
26 # define BYTES_PER_PIXEL8 1
27 #endif
28
29 #ifndef BYTES_PER_PIXEL15
30 # define BYTES_PER_PIXEL15 2
31 #endif
32
33 #ifndef BYTES_PER_PIXEL16
34 # define BYTES_PER_PIXEL16 2
35 #endif
36
37 #ifndef BYTES_PER_PIXEL24
38 # define BYTES_PER_PIXEL24 4 /* Same as BYTES_PER_PIXEL32 */
39 #endif
40
41 #ifndef BYTES_PER_PIXEL32
42 # define BYTES_PER_PIXEL32 4
43 #endif
44
45
46 /*
47 * Lookup table system.
48 */
49 extern u_int16_t gRLookup[256];
50 extern u_int16_t gGLookup[256];
51 extern u_int16_t gBLookup[256];
52
53
54
55 /*
56 * Bit packing macros:
57 */
58 #ifndef PACK8TO8
59 //-KB-// #define PACK8TO8(r,g,b) (u_int8_t)((r>>5)<<5)+((g>>5)<<2)+(b>>6)
60 # define PACK8TO8(r,g,b) (u_int8_t)(((r)&0xE0)+(((g)&0xE0)>>3)+((b)>>6))
61 #endif
62
63 #ifndef PACK8TO15
64 //-KB-// #define PACK8TO15(r,g,b) (u_int16_t)((r>>3)<<10)+((g>>3)<<5)+(b>>3)
65 # define PACK8TO15(r,g,b) (u_int16_t)(gRLookup[(r)]+gGLookup[(g)]+gBLookup[(b)])
66 #endif
67
68 #ifndef PACK8TO16
69 //-KB-// #define PACK8TO16(r,g,b) (u_int16_t)((r>>3)<<11)+((g>>2)<<5)+(b>>3)
70 # define PACK8TO16(r,g,b) (u_int16_t)(gRLookup[(r)]+gGLookup[(g)]+gBLookup[(b)])
71 #endif
72
73 #ifndef PACK8TO32
74 //-KB-// #define PACK8TO32(a,r,g,b) (u_int32_t)((a<<24)|(r<<16)|(g<<8)|(b))
75 # define PACK8TO32(a,r,g,b) (u_int32_t)(((a)<<24)|((r)<<16)|((g)<<8)|(b))
76 #endif
77
78
79
80
81
82
83 #endif /* GRAPHICS_H */