/src/xpdf-4.05/splash/Splash.h
Line | Count | Source (jump to first uncovered line) |
1 | | //======================================================================== |
2 | | // |
3 | | // Splash.h |
4 | | // |
5 | | // Copyright 2003-2013 Glyph & Cog, LLC |
6 | | // |
7 | | //======================================================================== |
8 | | |
9 | | #ifndef SPLASH_H |
10 | | #define SPLASH_H |
11 | | |
12 | | #include <aconf.h> |
13 | | |
14 | | #include "SplashTypes.h" |
15 | | #include "SplashClip.h" |
16 | | |
17 | | class GString; |
18 | | class Splash; |
19 | | class SplashBitmap; |
20 | | struct SplashGlyphBitmap; |
21 | | class SplashState; |
22 | | class SplashPattern; |
23 | | class SplashScreen; |
24 | | class SplashPath; |
25 | | class SplashXPath; |
26 | | class SplashFont; |
27 | | struct SplashPipe; |
28 | | struct SplashDrawImageMaskRowData; |
29 | | class ImageScaler; |
30 | | typedef void (Splash::*SplashDrawImageMaskRowFunc)( |
31 | | SplashDrawImageMaskRowData *data, |
32 | | Guchar *maskData, |
33 | | int x, int y, int width); |
34 | | struct SplashDrawImageRowData; |
35 | | typedef void (Splash::*SplashDrawImageRowFunc)(SplashDrawImageRowData *data, |
36 | | Guchar *colorData, |
37 | | Guchar *alphaData, |
38 | | int x, int y, int width); |
39 | | |
40 | | //------------------------------------------------------------------------ |
41 | | |
42 | | // Retrieves the next line of pixels in an image mask. Normally, |
43 | | // fills in *<line> and returns true. If the image stream is |
44 | | // exhausted, returns false. |
45 | | typedef GBool (*SplashImageMaskSource)(void *data, Guchar *pixel); |
46 | | |
47 | | // Retrieves the next line of pixels in an image. Normally, fills in |
48 | | // *<line> and returns true. If the image stream is exhausted, |
49 | | // returns false. |
50 | | typedef GBool (*SplashImageSource)(void *data, SplashColorPtr colorLine, |
51 | | Guchar *alphaLine); |
52 | | |
53 | | |
54 | | //------------------------------------------------------------------------ |
55 | | |
56 | | enum SplashPipeResultColorCtrl { |
57 | | splashPipeResultColorNoAlphaBlendMono, |
58 | | splashPipeResultColorNoAlphaBlendRGB, |
59 | | #if SPLASH_CMYK |
60 | | splashPipeResultColorNoAlphaBlendCMYK, |
61 | | #endif |
62 | | splashPipeResultColorAlphaNoBlendMono, |
63 | | splashPipeResultColorAlphaNoBlendRGB, |
64 | | #if SPLASH_CMYK |
65 | | splashPipeResultColorAlphaNoBlendCMYK, |
66 | | #endif |
67 | | splashPipeResultColorAlphaBlendMono, |
68 | | splashPipeResultColorAlphaBlendRGB |
69 | | #if SPLASH_CMYK |
70 | | , |
71 | | splashPipeResultColorAlphaBlendCMYK |
72 | | #endif |
73 | | }; |
74 | | |
75 | | //------------------------------------------------------------------------ |
76 | | |
77 | | // Transparency group destination bitmap initialization control. |
78 | | enum SplashGroupDestInitMode { |
79 | | splashGroupDestPreInit, // dest is already initialized |
80 | | splashGroupDestInitZero, // initialize to zero (isolated group) |
81 | | splashGroupDestInitCopy // copy backdrop (non-isolated group) |
82 | | }; |
83 | | |
84 | | //------------------------------------------------------------------------ |
85 | | // SplashImageCache |
86 | | //------------------------------------------------------------------------ |
87 | | |
88 | | // This holds a cached image, and is shared by multiple Splash objects |
89 | | // in the same thread. |
90 | | class SplashImageCache { |
91 | | public: |
92 | | |
93 | | SplashImageCache(); |
94 | | ~SplashImageCache(); |
95 | | GBool match(GString *aTag, int aWidth, int aHeight, |
96 | | SplashColorMode aMode, GBool aAlpha, |
97 | | GBool aInterpolate); |
98 | | void reset(GString *aTag, int aWidth, int aHeight, |
99 | | SplashColorMode aMode, GBool aAlpha, |
100 | | GBool aInterpolate); |
101 | | void incRefCount(); |
102 | | void decRefCount(); |
103 | | |
104 | | GString *tag; |
105 | | int width; |
106 | | int height; |
107 | | SplashColorMode mode; |
108 | | GBool alpha; |
109 | | GBool interpolate; |
110 | | Guchar *colorData; |
111 | | Guchar *alphaData; |
112 | | |
113 | | int refCount; |
114 | | }; |
115 | | |
116 | | //------------------------------------------------------------------------ |
117 | | // Splash |
118 | | //------------------------------------------------------------------------ |
119 | | |
120 | | class Splash { |
121 | | public: |
122 | | |
123 | | // Create a new rasterizer object. |
124 | | Splash(SplashBitmap *bitmapA, GBool vectorAntialiasA, |
125 | | SplashImageCache *imageCacheA, |
126 | | SplashScreenParams *screenParams = NULL); |
127 | | Splash(SplashBitmap *bitmapA, GBool vectorAntialiasA, |
128 | | SplashImageCache *imageCacheA, SplashScreen *screenA); |
129 | | |
130 | | ~Splash(); |
131 | | |
132 | | //----- state read |
133 | | |
134 | | SplashCoord *getMatrix(); |
135 | | SplashPattern *getStrokePattern(); |
136 | | SplashPattern *getFillPattern(); |
137 | | SplashScreen *getScreen(); |
138 | | SplashBlendFunc getBlendFunc(); |
139 | | SplashCoord getStrokeAlpha(); |
140 | | SplashCoord getFillAlpha(); |
141 | | SplashCoord getLineWidth(); |
142 | | int getLineCap(); |
143 | | int getLineJoin(); |
144 | | SplashCoord getMiterLimit(); |
145 | | SplashCoord getFlatness(); |
146 | | SplashCoord *getLineDash(); |
147 | | int getLineDashLength(); |
148 | | SplashCoord getLineDashPhase(); |
149 | | SplashStrokeAdjustMode getStrokeAdjust(); |
150 | | SplashClip *getClip(); |
151 | | SplashBitmap *getSoftMask(); |
152 | | GBool getInNonIsolatedGroup(); |
153 | | GBool getInKnockoutGroup(); |
154 | | |
155 | | //----- state write |
156 | | |
157 | | void setMatrix(SplashCoord *matrix); |
158 | | void setStrokePattern(SplashPattern *strokeColor); |
159 | | void setFillPattern(SplashPattern *fillColor); |
160 | | void setScreen(SplashScreen *screen); |
161 | | void setBlendFunc(SplashBlendFunc func); |
162 | | void setStrokeAlpha(SplashCoord alpha); |
163 | | void setFillAlpha(SplashCoord alpha); |
164 | | void setLineWidth(SplashCoord lineWidth); |
165 | | void setLineCap(int lineCap); |
166 | | void setLineJoin(int lineJoin); |
167 | | void setMiterLimit(SplashCoord miterLimit); |
168 | | void setFlatness(SplashCoord flatness); |
169 | | // the <lineDash> array will be copied |
170 | | void setLineDash(SplashCoord *lineDash, int lineDashLength, |
171 | | SplashCoord lineDashPhase); |
172 | | void setStrokeAdjust(SplashStrokeAdjustMode strokeAdjust); |
173 | | // NB: uses transformed coordinates. |
174 | | void clipResetToRect(SplashCoord x0, SplashCoord y0, |
175 | | SplashCoord x1, SplashCoord y1); |
176 | | // NB: uses transformed coordinates. |
177 | | SplashError clipToRect(SplashCoord x0, SplashCoord y0, |
178 | | SplashCoord x1, SplashCoord y1); |
179 | | // NB: uses untransformed coordinates. |
180 | | SplashError clipToPath(SplashPath *path, GBool eo); |
181 | | void setSoftMask(SplashBitmap *softMask, GBool deleteBitmap = gTrue); |
182 | | void setInTransparencyGroup(SplashBitmap *groupBackBitmapA, |
183 | | int groupBackXA, int groupBackYA, |
184 | | SplashGroupDestInitMode groupDestInitModeA, |
185 | | GBool nonIsolated, GBool knockout); |
186 | | void forceDeferredInit(int y, int h); |
187 | | GBool checkTransparentRect(int x, int y, int w, int h); |
188 | | void setTransfer(Guchar *red, Guchar *green, Guchar *blue, Guchar *gray); |
189 | | void setOverprintMask(Guint overprintMask); |
190 | | void setEnablePathSimplification(GBool en); |
191 | | |
192 | | //----- state save/restore |
193 | | |
194 | | void saveState(); |
195 | | SplashError restoreState(); |
196 | | |
197 | | //----- drawing operations |
198 | | |
199 | | // Fill the bitmap with <color>. This is not subject to clipping. |
200 | | void clear(SplashColorPtr color, Guchar alpha = 0x00); |
201 | | |
202 | | // Stroke a path using the current stroke pattern. |
203 | | SplashError stroke(SplashPath *path); |
204 | | |
205 | | // Fill a path using the current fill pattern. |
206 | | SplashError fill(SplashPath *path, GBool eo); |
207 | | |
208 | | // Draw a character, using the current fill pattern. |
209 | | SplashError fillChar(SplashCoord x, SplashCoord y, int c, SplashFont *font); |
210 | | |
211 | | // Draw a glyph, using the current fill pattern. This function does |
212 | | // not free any data, i.e., it ignores glyph->freeData. |
213 | | SplashError fillGlyph(SplashCoord x, SplashCoord y, |
214 | | SplashGlyphBitmap *glyph); |
215 | | |
216 | | // Draws an image mask using the fill color. This will read <h> |
217 | | // lines of <w> pixels from <src>, starting with the top line. "1" |
218 | | // pixels will be drawn with the current fill color; "0" pixels are |
219 | | // transparent. The matrix: |
220 | | // [ mat[0] mat[1] 0 ] |
221 | | // [ mat[2] mat[3] 0 ] |
222 | | // [ mat[4] mat[5] 1 ] |
223 | | // maps a unit square to the desired destination for the image, in |
224 | | // PostScript style: |
225 | | // [x' y' 1] = [x y 1] * mat |
226 | | // Note that the Splash y axis points downward, and the image source |
227 | | // is assumed to produce pixels in raster order, starting from the |
228 | | // top line. If [interpolate] is false, no filtering is done when |
229 | | // upsampling. If [antialias] is false, no filtering is done when |
230 | | // upsampling (overriding the [interpolate] flag), and threshold |
231 | | // filtering is done when downsampling. |
232 | | SplashError fillImageMask(GString *imageTag, |
233 | | SplashImageMaskSource src, void *srcData, |
234 | | int w, int h, SplashCoord *mat, |
235 | | GBool glyphMode, GBool interpolate, |
236 | | GBool antialias); |
237 | | |
238 | | // Draw an image. This will read <h> lines of <w> pixels from |
239 | | // <src>, starting with the top line. These pixels are assumed to |
240 | | // be in the source mode, <srcMode>. If <srcAlpha> is true, the |
241 | | // alpha values returned by <src> are used; otherwise they are |
242 | | // ignored. The following combinations of source and target modes |
243 | | // are supported: |
244 | | // source target |
245 | | // ------ ------ |
246 | | // Mono8 Mono1 -- with dithering |
247 | | // Mono8 Mono8 |
248 | | // RGB8 RGB8 |
249 | | // BGR8 RGB8 |
250 | | // CMYK8 CMYK8 |
251 | | // The matrix behaves as for fillImageMask. |
252 | | SplashError drawImage(GString *imageTag, |
253 | | SplashImageSource src, void *srcData, |
254 | | SplashColorMode srcMode, GBool srcAlpha, |
255 | | int w, int h, SplashCoord *mat, |
256 | | GBool interpolate); |
257 | | |
258 | | // Composite a rectangular region from <src> onto this Splash |
259 | | // object. |
260 | | SplashError composite(SplashBitmap *src, int xSrc, int ySrc, |
261 | | int xDest, int yDest, int w, int h, |
262 | | GBool noClip, GBool nonIsolated); |
263 | | |
264 | | // Composite a rectangular region from <src> onto this Splash |
265 | | // object, using <srcOverprintMaskBitmap> as the overprint mask per |
266 | | // pixel. This is only supported for CMYK and DeviceN bitmaps. |
267 | | SplashError compositeWithOverprint(SplashBitmap *src, |
268 | | Guint *srcOverprintMaskBitmap, |
269 | | int xSrc, int ySrc, |
270 | | int xDest, int yDest, int w, int h, |
271 | | GBool noClip, GBool nonIsolated); |
272 | | |
273 | | // Composite this Splash object onto a background color. The |
274 | | // background alpha is assumed to be 1. |
275 | | void compositeBackground(SplashColorPtr color); |
276 | | |
277 | | // Copy a rectangular region from <src> onto the bitmap belonging to |
278 | | // this Splash object. The destination alpha values are all set to |
279 | | // zero. |
280 | | SplashError blitTransparent(SplashBitmap *src, int xSrc, int ySrc, |
281 | | int xDest, int yDest, int w, int h); |
282 | | |
283 | | // Copy a rectangular region from the bitmap belonging to this |
284 | | // Splash object to <dest>. The alpha values are corrected for a |
285 | | // non-isolated group. |
286 | | SplashError blitCorrectedAlpha(SplashBitmap *dest, int xSrc, int ySrc, |
287 | | int xDest, int yDest, int w, int h); |
288 | | |
289 | | //----- misc |
290 | | |
291 | | // Construct a path for a stroke, given the path to be stroked and |
292 | | // the line width <w>. All other stroke parameters are taken from |
293 | | // the current state. If <flatten> is true, this function will |
294 | | // first flatten the path and handle the linedash. |
295 | | SplashPath *makeStrokePath(SplashPath *path, SplashCoord w, |
296 | | int lineCap, int lineJoin, |
297 | | GBool flatten = gTrue); |
298 | | |
299 | | // Reduce the size of a rectangle as much as possible by moving any |
300 | | // edges that are completely outside the clip region. Returns the |
301 | | // clipping status of the resulting rectangle. |
302 | | SplashClipResult limitRectToClipRect(int *xMin, int *yMin, |
303 | | int *xMax, int *yMax); |
304 | | |
305 | | // Return the associated bitmap. |
306 | 0 | SplashBitmap *getBitmap() { return bitmap; } |
307 | | |
308 | | // Enable writing the per-pixel overprint mask to a separate bitmap. |
309 | | void setOverprintMaskBitmap(Guint *overprintMaskBitmapA) |
310 | 0 | { overprintMaskBitmap = overprintMaskBitmapA; } |
311 | | |
312 | | // Set the minimum line width. |
313 | 0 | void setMinLineWidth(SplashCoord w) { minLineWidth = w; } |
314 | | |
315 | | // Get a bounding box which includes all modifications since the |
316 | | // last call to clearModRegion. |
317 | | void getModRegion(int *xMin, int *yMin, int *xMax, int *yMax) |
318 | 0 | { *xMin = modXMin; *yMin = modYMin; *xMax = modXMax; *yMax = modYMax; } |
319 | | |
320 | | // Clear the modified region bounding box. |
321 | | void clearModRegion(); |
322 | | |
323 | | // Get clipping status for the last drawing operation subject to |
324 | | // clipping. |
325 | 0 | SplashClipResult getClipRes() { return opClipRes; } |
326 | | |
327 | | // Toggle debug mode on or off. |
328 | 0 | void setDebugMode(GBool debugModeA) { debugMode = debugModeA; } |
329 | | |
330 | 0 | SplashImageCache *getImageCache() { return imageCache; } |
331 | | |
332 | | #if 1 //~tmp: turn off anti-aliasing temporarily |
333 | 0 | void setInShading(GBool sh) { inShading = sh; } |
334 | | #endif |
335 | | |
336 | | |
337 | | private: |
338 | | |
339 | | void pipeInit(SplashPipe *pipe, SplashPattern *pattern, |
340 | | Guchar aInput, GBool usesShape, |
341 | | GBool nonIsolatedGroup, GBool usesSrcOverprint = gFalse); |
342 | | void pipeRun(SplashPipe *pipe, int x0, int x1, int y, |
343 | | Guchar *shapePtr, SplashColorPtr cSrcPtr); |
344 | | void pipeRunSimpleMono1(SplashPipe *pipe, int x0, int x1, int y, |
345 | | Guchar *shapePtr, SplashColorPtr cSrcPtr); |
346 | | void pipeRunSimpleMono8(SplashPipe *pipe, int x0, int x1, int y, |
347 | | Guchar *shapePtr, SplashColorPtr cSrcPtr); |
348 | | void pipeRunSimpleRGB8(SplashPipe *pipe, int x0, int x1, int y, |
349 | | Guchar *shapePtr, SplashColorPtr cSrcPtr); |
350 | | void pipeRunSimpleBGR8(SplashPipe *pipe, int x0, int x1, int y, |
351 | | Guchar *shapePtr, SplashColorPtr cSrcPtr); |
352 | | #if SPLASH_CMYK |
353 | | void pipeRunSimpleCMYK8(SplashPipe *pipe, int x0, int x1, int y, |
354 | | Guchar *shapePtr, SplashColorPtr cSrcPtr); |
355 | | #endif |
356 | | void pipeRunShapeMono1(SplashPipe *pipe, int x0, int x1, int y, |
357 | | Guchar *shapePtr, SplashColorPtr cSrcPtr); |
358 | | void pipeRunShapeMono8(SplashPipe *pipe, int x0, int x1, int y, |
359 | | Guchar *shapePtr, SplashColorPtr cSrcPtr); |
360 | | void pipeRunShapeRGB8(SplashPipe *pipe, int x0, int x1, int y, |
361 | | Guchar *shapePtr, SplashColorPtr cSrcPtr); |
362 | | void pipeRunShapeBGR8(SplashPipe *pipe, int x0, int x1, int y, |
363 | | Guchar *shapePtr, SplashColorPtr cSrcPtr); |
364 | | #if SPLASH_CMYK |
365 | | void pipeRunShapeCMYK8(SplashPipe *pipe, int x0, int x1, int y, |
366 | | Guchar *shapePtr, SplashColorPtr cSrcPtr); |
367 | | #endif |
368 | | void pipeRunShapeNoAlphaMono8(SplashPipe *pipe, int x0, int x1, int y, |
369 | | Guchar *shapePtr, SplashColorPtr cSrcPtr); |
370 | | void pipeRunAAMono1(SplashPipe *pipe, int x0, int x1, int y, |
371 | | Guchar *shapePtr, SplashColorPtr cSrcPtr); |
372 | | void pipeRunAAMono8(SplashPipe *pipe, int x0, int x1, int y, |
373 | | Guchar *shapePtr, SplashColorPtr cSrcPtr); |
374 | | void pipeRunAARGB8(SplashPipe *pipe, int x0, int x1, int y, |
375 | | Guchar *shapePtr, SplashColorPtr cSrcPtr); |
376 | | void pipeRunAABGR8(SplashPipe *pipe, int x0, int x1, int y, |
377 | | Guchar *shapePtr, SplashColorPtr cSrcPtr); |
378 | | #if SPLASH_CMYK |
379 | | void pipeRunAACMYK8(SplashPipe *pipe, int x0, int x1, int y, |
380 | | Guchar *shapePtr, SplashColorPtr cSrcPtr); |
381 | | #endif |
382 | | void pipeRunSoftMaskMono8(SplashPipe *pipe, int x0, int x1, int y, |
383 | | Guchar *shapePtr, SplashColorPtr cSrcPtr); |
384 | | void pipeRunSoftMaskRGB8(SplashPipe *pipe, int x0, int x1, int y, |
385 | | Guchar *shapePtr, SplashColorPtr cSrcPtr); |
386 | | void pipeRunSoftMaskBGR8(SplashPipe *pipe, int x0, int x1, int y, |
387 | | Guchar *shapePtr, SplashColorPtr cSrcPtr); |
388 | | #if SPLASH_CMYK |
389 | | void pipeRunSoftMaskCMYK8(SplashPipe *pipe, int x0, int x1, int y, |
390 | | Guchar *shapePtr, SplashColorPtr cSrcPtr); |
391 | | #endif |
392 | | void pipeRunNonIsoMono8(SplashPipe *pipe, int x0, int x1, int y, |
393 | | Guchar *shapePtr, SplashColorPtr cSrcPtr); |
394 | | void pipeRunNonIsoRGB8(SplashPipe *pipe, int x0, int x1, int y, |
395 | | Guchar *shapePtr, SplashColorPtr cSrcPtr); |
396 | | void pipeRunNonIsoBGR8(SplashPipe *pipe, int x0, int x1, int y, |
397 | | Guchar *shapePtr, SplashColorPtr cSrcPtr); |
398 | | #if SPLASH_CMYK |
399 | | void pipeRunNonIsoCMYK8(SplashPipe *pipe, int x0, int x1, int y, |
400 | | Guchar *shapePtr, SplashColorPtr cSrcPtr); |
401 | | #endif |
402 | | void useDestRow(int y); |
403 | | void copyGroupBackdropRow(int y); |
404 | | void transform(SplashCoord *matrix, SplashCoord xi, SplashCoord yi, |
405 | | SplashCoord *xo, SplashCoord *yo); |
406 | | void updateModX(int x); |
407 | | void updateModY(int y); |
408 | | void strokeNarrow(SplashPath *path); |
409 | | void drawStrokeSpan(SplashPipe *pipe, int x0, int x1, int y, GBool noClip); |
410 | | void strokeWide(SplashPath *path, SplashCoord w, |
411 | | int lineCap, int lineJoin); |
412 | | SplashPath *flattenPath(SplashPath *path, SplashCoord *matrix, |
413 | | SplashCoord flatness); |
414 | | void flattenCurve(SplashCoord x0, SplashCoord y0, |
415 | | SplashCoord x1, SplashCoord y1, |
416 | | SplashCoord x2, SplashCoord y2, |
417 | | SplashCoord x3, SplashCoord y3, |
418 | | SplashCoord *matrix, SplashCoord flatness2, |
419 | | SplashPath *fPath); |
420 | | SplashPath *makeDashedPath(SplashPath *xPath); |
421 | | SplashError fillWithPattern(SplashPath *path, GBool eo, |
422 | | SplashPattern *pattern, SplashCoord alpha); |
423 | | SplashPath *tweakFillPath(SplashPath *path); |
424 | | GBool pathAllOutside(SplashPath *path, GBool stroke); |
425 | | SplashError fillGlyph2(int x0, int y0, SplashGlyphBitmap *glyph); |
426 | | void getImageBounds(SplashCoord xyMin, SplashCoord xyMax, |
427 | | int *xyMinI, int *xyMaxI); |
428 | | void drawImageMaskArbitraryNoInterp(Guchar *scaledMask, |
429 | | SplashDrawImageMaskRowData *dd, |
430 | | SplashDrawImageMaskRowFunc drawRowFunc, |
431 | | SplashCoord *invMat, |
432 | | int scaledWidth, int scaledHeight, |
433 | | int xMin, int yMin, int xMax, int yMax); |
434 | | void drawImageMaskArbitraryInterp(Guchar *scaledMask, |
435 | | SplashDrawImageMaskRowData *dd, |
436 | | SplashDrawImageMaskRowFunc drawRowFunc, |
437 | | SplashCoord *invMat, |
438 | | int scaledWidth, int scaledHeight, |
439 | | int xMin, int yMin, int xMax, int yMax); |
440 | | void mirrorImageMaskRow(Guchar *maskIn, Guchar *maskOut, int width); |
441 | | void drawImageMaskRowNoClip(SplashDrawImageMaskRowData *data, |
442 | | Guchar *maskData, |
443 | | int x, int y, int width); |
444 | | void drawImageMaskRowClipNoAA(SplashDrawImageMaskRowData *data, |
445 | | Guchar *maskData, |
446 | | int x, int y, int width); |
447 | | void drawImageMaskRowClipAA(SplashDrawImageMaskRowData *data, |
448 | | Guchar *maskData, |
449 | | int x, int y, int width); |
450 | | ImageScaler *getImageScaler(GString *imageTag, |
451 | | SplashImageSource src, void *srcData, |
452 | | int w, int h, int nComps, |
453 | | int scaledWidth, int scaledHeight, |
454 | | SplashColorMode srcMode, |
455 | | GBool srcAlpha, GBool interpolate); |
456 | | void getScaledImage(GString *imageTag, |
457 | | SplashImageSource src, void *srcData, |
458 | | int w, int h, int nComps, |
459 | | int scaledWidth, int scaledHeight, |
460 | | SplashColorMode srcMode, |
461 | | GBool srcAlpha, GBool interpolate, |
462 | | Guchar **scaledColor, Guchar **scaledAlpha, |
463 | | GBool *freeScaledImage); |
464 | | void drawImageArbitraryNoInterp(Guchar *scaledColor, Guchar *scaledAlpha, |
465 | | SplashDrawImageRowData *dd, |
466 | | SplashDrawImageRowFunc drawRowFunc, |
467 | | SplashCoord *invMat, |
468 | | int scaledWidth, int scaledHeight, |
469 | | int xMin, int yMin, int xMax, int yMax, |
470 | | int nComps, GBool srcAlpha); |
471 | | void drawImageArbitraryInterp(Guchar *scaledColor, Guchar *scaledAlpha, |
472 | | SplashDrawImageRowData *dd, |
473 | | SplashDrawImageRowFunc drawRowFunc, |
474 | | SplashCoord *invMat, |
475 | | int scaledWidth, int scaledHeight, |
476 | | int xMin, int yMin, int xMax, int yMax, |
477 | | int nComps, GBool srcAlpha); |
478 | | void mirrorImageRow(Guchar *colorIn, Guchar *alphaIn, |
479 | | Guchar *colorOut, Guchar *alphaOut, |
480 | | int width, int nComps, GBool srcAlpha); |
481 | | void drawImageRowNoClipNoAlpha(SplashDrawImageRowData *data, |
482 | | Guchar *colorData, Guchar *alphaData, |
483 | | int x, int y, int width); |
484 | | void drawImageRowNoClipAlpha(SplashDrawImageRowData *data, |
485 | | Guchar *colorData, Guchar *alphaData, |
486 | | int x, int y, int width); |
487 | | void drawImageRowClipNoAlphaNoAA(SplashDrawImageRowData *data, |
488 | | Guchar *colorData, |
489 | | Guchar *alphaData, |
490 | | int x, int y, int width); |
491 | | void drawImageRowClipNoAlphaAA(SplashDrawImageRowData *data, |
492 | | Guchar *colorData, |
493 | | Guchar *alphaData, |
494 | | int x, int y, int width); |
495 | | void drawImageRowClipAlphaNoAA(SplashDrawImageRowData *data, |
496 | | Guchar *colorData, |
497 | | Guchar *alphaData, |
498 | | int x, int y, int width); |
499 | | void drawImageRowClipAlphaAA(SplashDrawImageRowData *data, |
500 | | Guchar *colorData, |
501 | | Guchar *alphaData, |
502 | | int x, int y, int width); |
503 | | void dumpPath(SplashPath *path); |
504 | | void dumpXPath(SplashXPath *path); |
505 | | |
506 | | |
507 | | static SplashPipeResultColorCtrl pipeResultColorNoAlphaBlend[]; |
508 | | static SplashPipeResultColorCtrl pipeResultColorAlphaNoBlend[]; |
509 | | static SplashPipeResultColorCtrl pipeResultColorAlphaBlend[]; |
510 | | static int pipeNonIsoGroupCorrection[]; |
511 | | |
512 | | SplashBitmap *bitmap; |
513 | | int bitmapComps; |
514 | | SplashState *state; |
515 | | Guchar *scanBuf; |
516 | | Guchar *scanBuf2; |
517 | | SplashBitmap // for transparency groups, this is the bitmap |
518 | | *groupBackBitmap; // containing the alpha0/color0 values |
519 | | int groupBackX, groupBackY; // offset within groupBackBitmap |
520 | | SplashGroupDestInitMode groupDestInitMode; |
521 | | int groupDestInitYMin, groupDestInitYMax; |
522 | | Guint *overprintMaskBitmap; |
523 | | SplashCoord minLineWidth; |
524 | | int modXMin, modYMin, modXMax, modYMax; |
525 | | SplashClipResult opClipRes; |
526 | | GBool vectorAntialias; |
527 | | GBool inShading; |
528 | | GBool debugMode; |
529 | | |
530 | | SplashImageCache *imageCache; |
531 | | }; |
532 | | |
533 | | #endif |