File indexing completed on 2025-12-11 10:26:10
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027 #ifndef SPLASHTYPES_H
0028 #define SPLASHTYPES_H
0029
0030 #include <cstddef>
0031
0032
0033
0034
0035
0036 #if defined(USE_FLOAT)
0037 typedef float SplashCoord;
0038 #else
0039 typedef double SplashCoord;
0040 #endif
0041
0042
0043
0044
0045
0046 #define splashAASize 4
0047
0048 #ifndef SPOT_NCOMPS
0049 # define SPOT_NCOMPS 4
0050 #endif
0051
0052
0053
0054
0055
0056 enum SplashColorMode
0057 {
0058 splashModeMono1,
0059
0060 splashModeMono8,
0061 splashModeRGB8,
0062
0063 splashModeBGR8,
0064
0065 splashModeXBGR8,
0066
0067 splashModeCMYK8,
0068
0069 splashModeDeviceN8
0070
0071
0072 };
0073
0074 enum SplashThinLineMode
0075 {
0076 splashThinLineDefault,
0077
0078 splashThinLineSolid,
0079 splashThinLineShape
0080 };
0081
0082
0083 extern int splashColorModeNComps[];
0084
0085
0086 constexpr std::size_t splashMaxColorComps = SPOT_NCOMPS + 4;
0087
0088 typedef unsigned char SplashColor[splashMaxColorComps];
0089 typedef unsigned char *SplashColorPtr;
0090 typedef const unsigned char *SplashColorConstPtr;
0091
0092
0093 static inline unsigned char splashRGB8R(SplashColorPtr rgb8)
0094 {
0095 return rgb8[0];
0096 }
0097 static inline unsigned char splashRGB8G(SplashColorPtr rgb8)
0098 {
0099 return rgb8[1];
0100 }
0101 static inline unsigned char splashRGB8B(SplashColorPtr rgb8)
0102 {
0103 return rgb8[2];
0104 }
0105
0106
0107 static inline unsigned char splashBGR8R(SplashColorPtr bgr8)
0108 {
0109 return bgr8[2];
0110 }
0111 static inline unsigned char splashBGR8G(SplashColorPtr bgr8)
0112 {
0113 return bgr8[1];
0114 }
0115 static inline unsigned char splashBGR8B(SplashColorPtr bgr8)
0116 {
0117 return bgr8[0];
0118 }
0119
0120
0121 static inline unsigned char splashCMYK8C(SplashColorPtr cmyk8)
0122 {
0123 return cmyk8[0];
0124 }
0125 static inline unsigned char splashCMYK8M(SplashColorPtr cmyk8)
0126 {
0127 return cmyk8[1];
0128 }
0129 static inline unsigned char splashCMYK8Y(SplashColorPtr cmyk8)
0130 {
0131 return cmyk8[2];
0132 }
0133 static inline unsigned char splashCMYK8K(SplashColorPtr cmyk8)
0134 {
0135 return cmyk8[3];
0136 }
0137
0138
0139 static inline unsigned char splashDeviceN8C(SplashColorPtr deviceN8)
0140 {
0141 return deviceN8[0];
0142 }
0143 static inline unsigned char splashDeviceN8M(SplashColorPtr deviceN8)
0144 {
0145 return deviceN8[1];
0146 }
0147 static inline unsigned char splashDeviceN8Y(SplashColorPtr deviceN8)
0148 {
0149 return deviceN8[2];
0150 }
0151 static inline unsigned char splashDeviceN8K(SplashColorPtr deviceN8)
0152 {
0153 return deviceN8[3];
0154 }
0155 static inline unsigned char splashDeviceN8S(SplashColorPtr deviceN8, int nSpot)
0156 {
0157 return deviceN8[4 + nSpot];
0158 }
0159
0160 static inline void splashClearColor(SplashColorPtr dest)
0161 {
0162 dest[0] = 0;
0163 dest[1] = 0;
0164 dest[2] = 0;
0165 dest[3] = 0;
0166 for (int i = 4; i < SPOT_NCOMPS + 4; i++) {
0167 dest[i] = 0;
0168 }
0169 }
0170
0171 static inline void splashColorCopy(SplashColorPtr dest, SplashColorConstPtr src)
0172 {
0173 dest[0] = src[0];
0174 dest[1] = src[1];
0175 dest[2] = src[2];
0176 dest[3] = src[3];
0177 for (int i = 4; i < SPOT_NCOMPS + 4; i++) {
0178 dest[i] = src[i];
0179 }
0180 }
0181
0182 static inline bool splashColorEqual(SplashColorConstPtr dest, SplashColorConstPtr src)
0183 {
0184 for (int i = 0; i < SPOT_NCOMPS + 4; i++) {
0185 if (dest[i] != src[i]) {
0186 return false;
0187 }
0188 }
0189 return true;
0190 }
0191
0192 static inline void splashColorXor(SplashColorPtr dest, SplashColorConstPtr src)
0193 {
0194 dest[0] ^= src[0];
0195 dest[1] ^= src[1];
0196 dest[2] ^= src[2];
0197 dest[3] ^= src[3];
0198 for (int i = 4; i < SPOT_NCOMPS + 4; i++) {
0199 dest[i] ^= src[i];
0200 }
0201 }
0202
0203
0204
0205
0206
0207 typedef void (*SplashBlendFunc)(SplashColorPtr src, SplashColorPtr dest, SplashColorPtr blend, SplashColorMode cm);
0208
0209
0210
0211
0212
0213 enum SplashScreenType
0214 {
0215 splashScreenDispersed,
0216 splashScreenClustered,
0217 splashScreenStochasticClustered
0218 };
0219
0220 struct SplashScreenParams
0221 {
0222 SplashScreenType type;
0223 int size;
0224 int dotRadius;
0225 SplashCoord gamma;
0226 SplashCoord blackThreshold;
0227 SplashCoord whiteThreshold;
0228 };
0229
0230
0231
0232
0233
0234 typedef int SplashError;
0235
0236
0237
0238
0239
0240 enum SplashImageFileFormat
0241 {
0242 splashFormatJpeg,
0243 splashFormatPng,
0244 splashFormatTiff,
0245 splashFormatJpegCMYK
0246 };
0247
0248 #endif