1 //========================================================================
5 //========================================================================
10 #include "goo/gtypes.h"
12 //------------------------------------------------------------------------
14 //------------------------------------------------------------------------
17 #include "goo/FixedPoint.h"
18 typedef FixedPoint SplashCoord
;
20 typedef double SplashCoord
;
23 //------------------------------------------------------------------------
25 //------------------------------------------------------------------------
27 enum SplashColorMode
{
28 splashModeMono1
, // 1 bit per component, 8 pixels per byte,
29 // MSbit is on the left
30 splashModeMono8
, // 1 byte per component, 1 byte per pixel
31 splashModeAMono8
, // 1 byte per component, 2 bytes per pixel:
33 splashModeRGB8
, // 1 byte per component, 3 bytes per pixel:
35 splashModeBGR8
, // 1 byte per component, 3 bytes per pixel:
37 splashModeARGB8
, // 1 byte per component, 4 bytes per pixel:
39 splashModeRGB8Qt
, // 1 byte per component, 4 bytes per pixel:
40 // Specially hacked to use in Qt frontends
41 splashModeBGRA8
// 1 byte per component, 4 bytes per pixel:
45 splashModeCMYK8
, // 1 byte per component, 4 bytes per pixel:
47 splashModeACMYK8
// 1 byte per component, 5 bytes per pixel:
52 // number of components in each color mode
53 // (defined in SplashState.cc)
54 extern int splashColorModeNComps
[];
56 // max number of components in any SplashColor
58 # define splashMaxColorComps 5
60 # define splashMaxColorComps 4
63 typedef Guchar SplashColor
[splashMaxColorComps
];
64 typedef Guchar
*SplashColorPtr
;
67 static inline Guchar
splashAMono8A(SplashColorPtr am8
) { return am8
[0]; }
68 static inline Guchar
splashAMono8M(SplashColorPtr am8
) { return am8
[1]; }
71 static inline Guchar
splashRGB8R(SplashColorPtr rgb8
) { return rgb8
[0]; }
72 static inline Guchar
splashRGB8G(SplashColorPtr rgb8
) { return rgb8
[1]; }
73 static inline Guchar
splashRGB8B(SplashColorPtr rgb8
) { return rgb8
[2]; }
76 static inline Guchar
splashBGR8R(SplashColorPtr bgr8
) { return bgr8
[2]; }
77 static inline Guchar
splashBGR8G(SplashColorPtr bgr8
) { return bgr8
[1]; }
78 static inline Guchar
splashBGR8B(SplashColorPtr bgr8
) { return bgr8
[0]; }
81 static inline Guchar
splashARGB8A(SplashColorPtr argb8
) { return argb8
[0]; }
82 static inline Guchar
splashARGB8R(SplashColorPtr argb8
) { return argb8
[1]; }
83 static inline Guchar
splashARGB8G(SplashColorPtr argb8
) { return argb8
[2]; }
84 static inline Guchar
splashARGB8B(SplashColorPtr argb8
) { return argb8
[3]; }
87 static inline Guchar
splashBGRA8A(SplashColorPtr bgra8
) { return bgra8
[3]; }
88 static inline Guchar
splashBGRA8R(SplashColorPtr bgra8
) { return bgra8
[2]; }
89 static inline Guchar
splashBGRA8G(SplashColorPtr bgra8
) { return bgra8
[1]; }
90 static inline Guchar
splashBGRA8B(SplashColorPtr bgra8
) { return bgra8
[0]; }
94 static inline Guchar
splashCMYK8C(SplashColorPtr cmyk8
) { return cmyk8
[0]; }
95 static inline Guchar
splashCMYK8M(SplashColorPtr cmyk8
) { return cmyk8
[1]; }
96 static inline Guchar
splashCMYK8Y(SplashColorPtr cmyk8
) { return cmyk8
[2]; }
97 static inline Guchar
splashCMYK8K(SplashColorPtr cmyk8
) { return cmyk8
[3]; }
100 static inline Guchar
splashACMYK8A(SplashColorPtr acmyk8
) { return acmyk8
[0]; }
101 static inline Guchar
splashACMYK8C(SplashColorPtr acmyk8
) { return acmyk8
[1]; }
102 static inline Guchar
splashACMYK8M(SplashColorPtr acmyk8
) { return acmyk8
[2]; }
103 static inline Guchar
splashACMYK8Y(SplashColorPtr acmyk8
) { return acmyk8
[3]; }
104 static inline Guchar
splashACMYK8K(SplashColorPtr acmyk8
) { return acmyk8
[4]; }
107 static inline void splashColorCopy(SplashColorPtr dest
, SplashColorPtr src
) {
117 static inline void splashColorXor(SplashColorPtr dest
, SplashColorPtr src
) {
127 //------------------------------------------------------------------------
129 //------------------------------------------------------------------------
131 typedef void (*SplashBlendFunc
)(SplashColorPtr src
, SplashColorPtr dest
,
132 SplashColorPtr blend
, SplashColorMode cm
);
134 //------------------------------------------------------------------------
136 //------------------------------------------------------------------------
138 typedef int SplashError
;