xine-lib 1.2.11
goom_graphic.h
Go to the documentation of this file.
1#ifndef GRAPHIC_H
2#define GRAPHIC_H
3
4typedef unsigned int Uint;
5
6typedef struct
7{
8 unsigned short r, v, b;
9}
10Color;
11
12extern const Color BLACK;
13extern const Color WHITE;
14extern const Color RED;
15extern const Color BLUE;
16extern const Color GREEN;
17extern const Color YELLOW;
18extern const Color ORANGE;
19extern 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
33typedef 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
55typedef union _PIXEL {
56 struct {
57 unsigned char a;
58 unsigned char r;
59 unsigned char g;
60 unsigned char b;
62 unsigned int val;
63 unsigned char cop[4];
65
66#endif /* COLOR_BGRA */
67
68/*
69inline void setPixelRGB (Pixel * buffer, Uint x, Uint y, Color c);
70inline void getPixelRGB (Pixel * buffer, Uint x, Uint y, Color * c);
71*/
72
73
74#endif /* GRAPHIC_H */
const Color VIOLET
Definition: graphic.c:10
const Color BLUE
Definition: graphic.c:7
const Color YELLOW
Definition: graphic.c:8
unsigned int Uint
Definition: goom_graphic.h:4
const Color RED
Definition: graphic.c:5
union _PIXEL Pixel
const Color WHITE
Definition: graphic.c:4
const Color ORANGE
Definition: graphic.c:9
const Color BLACK
Definition: graphic.c:3
const Color GREEN
Definition: graphic.c:6
Definition: goom_graphic.h:7
unsigned short b
Definition: goom_graphic.h:8
Definition: goom_graphic.h:55
unsigned char r
Definition: goom_graphic.h:58
unsigned int val
Definition: goom_graphic.h:62
unsigned char g
Definition: goom_graphic.h:59
unsigned char a
Definition: goom_graphic.h:57
struct _PIXEL::@38 channels
unsigned char b
Definition: goom_graphic.h:60
unsigned char cop[4]
Definition: goom_graphic.h:63