xine-lib  1.2.10
goom_graphic.h
Go to the documentation of this file.
1 #ifndef GRAPHIC_H
2 #define GRAPHIC_H
3 
4 typedef unsigned int Uint;
5 
6 typedef struct
7 {
8  unsigned short r, v, b;
9 }
10 Color;
11 
12 extern const Color BLACK;
13 extern const Color WHITE;
14 extern const Color RED;
15 extern const Color BLUE;
16 extern const Color GREEN;
17 extern const Color YELLOW;
18 extern const Color ORANGE;
19 extern const Color VIOLET;
20 
21 
22 #ifdef COLOR_BGRA
23 
24 #define B_CHANNEL 0xFF000000
25 #define G_CHANNEL 0x00FF0000
26 #define R_CHANNEL 0x0000FF00
27 #define A_CHANNEL 0x000000FF
28 #define B_OFFSET 24
29 #define G_OFFSET 16
30 #define R_OFFSET 8
31 #define A_OFFSET 0
32 
33 typedef union _PIXEL {
34  struct {
35  unsigned char b;
36  unsigned char g;
37  unsigned char r;
38  unsigned char a;
39  } channels;
40  unsigned int val;
41  unsigned char cop[4];
42 } Pixel;
43 
44 #else
45 
46 #define A_CHANNEL 0xFF000000
47 #define R_CHANNEL 0x00FF0000
48 #define G_CHANNEL 0x0000FF00
49 #define B_CHANNEL 0x000000FF
50 #define A_OFFSET 24
51 #define R_OFFSET 16
52 #define G_OFFSET 8
53 #define B_OFFSET 0
54 
55 typedef union _PIXEL {
56  struct {
57  unsigned char a;
58  unsigned char r;
59  unsigned char g;
60  unsigned char b;
61  } channels;
62  unsigned int val;
63  unsigned char cop[4];
64 } Pixel;
65 
66 #endif /* COLOR_BGRA */
67 
68 /*
69 inline void setPixelRGB (Pixel * buffer, Uint x, Uint y, Color c);
70 inline void getPixelRGB (Pixel * buffer, Uint x, Uint y, Color * c);
71 */
72 
73 
74 #endif /* GRAPHIC_H */
BLUE
const Color BLUE
Definition: graphic.c:7
_PIXEL::r
unsigned char r
Definition: goom_graphic.h:58
YELLOW
const Color YELLOW
Definition: graphic.c:8
Pixel
union _PIXEL Pixel
RED
const Color RED
Definition: graphic.c:5
_PIXEL
Definition: goom_graphic.h:55
_PIXEL::channels
struct _PIXEL::@36 channels
Uint
unsigned int Uint
Definition: goom_graphic.h:4
Color::v
unsigned short v
Definition: goom_graphic.h:8
ORANGE
const Color ORANGE
Definition: graphic.c:9
GREEN
const Color GREEN
Definition: graphic.c:6
VIOLET
const Color VIOLET
Definition: graphic.c:10
_PIXEL::g
unsigned char g
Definition: goom_graphic.h:59
WHITE
const Color WHITE
Definition: graphic.c:4
_PIXEL::b
unsigned char b
Definition: goom_graphic.h:60
_PIXEL::cop
unsigned char cop[4]
Definition: goom_graphic.h:63
_PIXEL::a
unsigned char a
Definition: goom_graphic.h:57
BLACK
const Color BLACK
Definition: graphic.c:3
Color
Definition: goom_graphic.h:6
_PIXEL::val
unsigned int val
Definition: goom_graphic.h:62