/src/xpdf-4.05/splash/SplashState.h
Line | Count | Source (jump to first uncovered line) |
1 | | //======================================================================== |
2 | | // |
3 | | // SplashState.h |
4 | | // |
5 | | // Copyright 2003-2013 Glyph & Cog, LLC |
6 | | // |
7 | | //======================================================================== |
8 | | |
9 | | #ifndef SPLASHSTATE_H |
10 | | #define SPLASHSTATE_H |
11 | | |
12 | | #include <aconf.h> |
13 | | |
14 | | #include "SplashTypes.h" |
15 | | |
16 | | class SplashPattern; |
17 | | class SplashScreen; |
18 | | class SplashClip; |
19 | | class SplashBitmap; |
20 | | class SplashPath; |
21 | | |
22 | | //------------------------------------------------------------------------ |
23 | | // line cap values |
24 | | //------------------------------------------------------------------------ |
25 | | |
26 | 0 | #define splashLineCapButt 0 |
27 | 0 | #define splashLineCapRound 1 |
28 | 0 | #define splashLineCapProjecting 2 |
29 | | |
30 | | //------------------------------------------------------------------------ |
31 | | // line join values |
32 | | //------------------------------------------------------------------------ |
33 | | |
34 | 0 | #define splashLineJoinMiter 0 |
35 | 0 | #define splashLineJoinRound 1 |
36 | 0 | #define splashLineJoinBevel 2 |
37 | | |
38 | | //------------------------------------------------------------------------ |
39 | | // SplashState |
40 | | //------------------------------------------------------------------------ |
41 | | |
42 | | class SplashState { |
43 | | public: |
44 | | |
45 | | // Create a new state object, initialized with default settings. |
46 | | SplashState(int width, int height, GBool vectorAntialias, |
47 | | SplashScreenParams *screenParams); |
48 | | SplashState(int width, int height, GBool vectorAntialias, |
49 | | SplashScreen *screenA); |
50 | | |
51 | | // Copy a state object. |
52 | 0 | SplashState *copy() { return new SplashState(this); } |
53 | | |
54 | | ~SplashState(); |
55 | | |
56 | | // Set the stroke pattern. This does not copy <strokePatternA>. |
57 | | void setStrokePattern(SplashPattern *strokePatternA); |
58 | | |
59 | | // Set the fill pattern. This does not copy <fillPatternA>. |
60 | | void setFillPattern(SplashPattern *fillPatternA); |
61 | | |
62 | | // Set the screen. This does not copy <screenA>. |
63 | | void setScreen(SplashScreen *screenA); |
64 | | |
65 | | // Set the line dash pattern. This copies the <lineDashA> array. |
66 | | void setLineDash(SplashCoord *lineDashA, int lineDashLengthA, |
67 | | SplashCoord lineDashPhaseA); |
68 | | |
69 | | // Returns true if the current line dash pattern contains one or |
70 | | // more zero-length "on" sections (dashes). |
71 | | GBool lineDashContainsZeroLengthDashes(); |
72 | | |
73 | | void clipResetToRect(SplashCoord x0, SplashCoord y0, |
74 | | SplashCoord x1, SplashCoord y1); |
75 | | SplashError clipToRect(SplashCoord x0, SplashCoord y0, |
76 | | SplashCoord x1, SplashCoord y1); |
77 | | SplashError clipToPath(SplashPath *path, GBool eo); |
78 | | |
79 | | // Set the soft mask bitmap. |
80 | | void setSoftMask(SplashBitmap *softMaskA, GBool deleteBitmap = gTrue); |
81 | | |
82 | | // Set the transfer function. |
83 | | void setTransfer(Guchar *red, Guchar *green, Guchar *blue, Guchar *gray); |
84 | | |
85 | | |
86 | | private: |
87 | | |
88 | | SplashState(SplashState *state); |
89 | | |
90 | | SplashCoord matrix[6]; |
91 | | SplashPattern *strokePattern; |
92 | | SplashPattern *fillPattern; |
93 | | SplashScreen *screen; |
94 | | SplashBlendFunc blendFunc; |
95 | | SplashCoord strokeAlpha; |
96 | | SplashCoord fillAlpha; |
97 | | SplashCoord lineWidth; |
98 | | int lineCap; |
99 | | int lineJoin; |
100 | | SplashCoord miterLimit; |
101 | | SplashCoord flatness; |
102 | | SplashCoord *lineDash; |
103 | | int lineDashLength; |
104 | | SplashCoord lineDashPhase; |
105 | | SplashStrokeAdjustMode strokeAdjust; |
106 | | SplashClip *clip; |
107 | | GBool clipIsShared; |
108 | | SplashBitmap *softMask; |
109 | | GBool deleteSoftMask; |
110 | | GBool inNonIsolatedGroup; |
111 | | GBool inKnockoutGroup; |
112 | | Guchar *rgbTransferR; |
113 | | Guchar *rgbTransferG; |
114 | | Guchar *rgbTransferB; |
115 | | Guchar *grayTransfer; |
116 | | #if SPLASH_CMYK |
117 | | Guchar *cmykTransferC; |
118 | | Guchar *cmykTransferM; |
119 | | Guchar *cmykTransferY; |
120 | | Guchar *cmykTransferK; |
121 | | #endif |
122 | | GBool transferIsShared; |
123 | | Guint overprintMask; |
124 | | GBool enablePathSimplification; |
125 | | |
126 | | |
127 | | SplashState *next; // used by Splash class |
128 | | |
129 | | friend class Splash; |
130 | | }; |
131 | | |
132 | | #endif |