]> www.fi.muni.cz Git - evince.git/blob - pdf/splash/SplashTypes.h
Fix several bugs with find
[evince.git] / pdf / splash / SplashTypes.h
1 //========================================================================
2 //
3 // SplashTypes.h
4 //
5 //========================================================================
6
7 #ifndef SPLASHTYPES_H
8 #define SPLASHTYPES_H
9
10 #include <aconf.h>
11 #include "gtypes.h"
12
13 //------------------------------------------------------------------------
14 // coordinates
15 //------------------------------------------------------------------------
16
17 typedef double SplashCoord;
18
19 //------------------------------------------------------------------------
20 // colors
21 //------------------------------------------------------------------------
22
23 enum SplashColorMode {
24   splashModeMono1,
25   splashModeMono8,
26   splashModeRGB8,
27   splashModeRGB8Packed,
28   splashModeBGR8Packed
29 };
30
31 // max number of components in any SplashColor
32 #define splashMaxColorComps 3
33
34 // 1-bit gray or alpha
35 typedef Guchar SplashMono1;
36 typedef Guchar SplashMono1P; // packed
37
38 // 8-bit gray or alpha
39 typedef Guchar SplashMono8;
40
41 // 3x8-bit RGB: (MSB) 00RRGGBB (LSB)
42 typedef Guint SplashRGB8;
43 #define splashRGB8R(rgb8) (((rgb8) >> 16) & 0xff)
44 #define splashRGB8G(rgb8) (((rgb8) >> 8) & 0xff)
45 #define splashRGB8B(rgb8) ((rgb8) & 0xff)
46 #define splashMakeRGB8(r, g, b) \
47   ((((r) & 0xff) << 16) | (((g) & 0xff) << 8) | ((b) & 0xff))
48
49 typedef Guchar SplashRGB8P; // packed
50
51 // 3x8-bit RGB: (MSB) 00BBGGRR (LSB)
52 typedef Guint SplashBGR8;
53 typedef Guchar SplashBGR8P; // packed
54 #define splashBGR8R(bgr8) ((bgr8) & 0xff)
55 #define splashBGR8G(bgr8) (((bgr8) >> 8) & 0xff)
56 #define splashBGR8B(bgr8) (((bgr8) >> 16) & 0xff)
57 #define splashMakeBGR8(r, g, b) \
58   ((((b) & 0xff) << 16) | (((g) & 0xff) << 8) | ((r) & 0xff))
59
60 union SplashColor {
61   SplashMono1 mono1;
62   SplashMono8 mono8;
63   SplashRGB8 rgb8;
64   SplashBGR8 bgr8;
65 };
66
67 union SplashColorPtr {
68   SplashMono1P *mono1;
69   SplashMono8 *mono8;
70   SplashRGB8 *rgb8;
71   SplashRGB8P *rgb8p;
72   SplashBGR8P *bgr8;
73 };
74
75 //------------------------------------------------------------------------
76 // error results
77 //------------------------------------------------------------------------
78
79 typedef int SplashError;
80
81 #endif