beta-0.89.2
[luatex.git] / source / libs / poppler / poppler-src / splash / SplashState.h
blobfea7603500edf6849dec401cefb94c19a0071b35
1 //========================================================================
2 //
3 // SplashState.h
4 //
5 //========================================================================
7 //========================================================================
8 //
9 // Modified under the Poppler project - http://poppler.freedesktop.org
11 // All changes made under the Poppler project to this file are licensed
12 // under GPL version 2 or later
14 // Copyright (C) 2011, 2012, 2015 Thomas Freitag <Thomas.Freitag@alfa.de>
16 // To see a description of the changes please see the Changelog file that
17 // came with your tarball or type make ChangeLog if you are building from git
19 //========================================================================
21 #ifndef SPLASHSTATE_H
22 #define SPLASHSTATE_H
24 #ifdef USE_GCC_PRAGMAS
25 #pragma interface
26 #endif
28 #include "SplashTypes.h"
30 class SplashPattern;
31 class SplashScreen;
32 class SplashClip;
33 class SplashBitmap;
35 //------------------------------------------------------------------------
36 // line cap values
37 //------------------------------------------------------------------------
39 #define splashLineCapButt 0
40 #define splashLineCapRound 1
41 #define splashLineCapProjecting 2
43 //------------------------------------------------------------------------
44 // line join values
45 //------------------------------------------------------------------------
47 #define splashLineJoinMiter 0
48 #define splashLineJoinRound 1
49 #define splashLineJoinBevel 2
51 //------------------------------------------------------------------------
52 // SplashState
53 //------------------------------------------------------------------------
55 class SplashState {
56 public:
58 // Create a new state object, initialized with default settings.
59 SplashState(int width, int height, GBool vectorAntialias,
60 SplashScreenParams *screenParams);
61 SplashState(int width, int height, GBool vectorAntialias,
62 SplashScreen *screenA);
64 // Copy a state object.
65 SplashState *copy() { return new SplashState(this); }
67 ~SplashState();
69 // Set the stroke pattern. This does not copy <strokePatternA>.
70 void setStrokePattern(SplashPattern *strokePatternA);
72 // Set the fill pattern. This does not copy <fillPatternA>.
73 void setFillPattern(SplashPattern *fillPatternA);
75 // Set the screen. This does not copy <screenA>.
76 void setScreen(SplashScreen *screenA);
78 // Set the line dash pattern. This copies the <lineDashA> array.
79 void setLineDash(SplashCoord *lineDashA, int lineDashLengthA,
80 SplashCoord lineDashPhaseA);
82 // Set the soft mask bitmap.
83 void setSoftMask(SplashBitmap *softMaskA);
85 // Set the overprint parametes.
86 void setFillOverprint(GBool fillOverprintA) { fillOverprint = fillOverprintA; }
87 void setStrokeOverprint(GBool strokeOverprintA) { strokeOverprint = strokeOverprintA; }
88 void setOverprintMode(int overprintModeA) { overprintMode = overprintModeA; }
90 // Set the transfer function.
91 void setTransfer(Guchar *red, Guchar *green, Guchar *blue, Guchar *gray);
93 private:
95 SplashState(SplashState *state);
97 SplashCoord matrix[6];
98 SplashPattern *strokePattern;
99 SplashPattern *fillPattern;
100 SplashScreen *screen;
101 SplashBlendFunc blendFunc;
102 SplashCoord strokeAlpha;
103 SplashCoord fillAlpha;
104 GBool multiplyPatternAlpha;
105 SplashCoord patternStrokeAlpha;
106 SplashCoord patternFillAlpha;
107 SplashCoord lineWidth;
108 int lineCap;
109 int lineJoin;
110 SplashCoord miterLimit;
111 SplashCoord flatness;
112 SplashCoord *lineDash;
113 int lineDashLength;
114 SplashCoord lineDashPhase;
115 GBool strokeAdjust;
116 SplashClip *clip;
117 SplashBitmap *softMask;
118 GBool deleteSoftMask;
119 GBool inNonIsolatedGroup;
120 GBool fillOverprint;
121 GBool strokeOverprint;
122 int overprintMode;
123 Guchar rgbTransferR[256],
124 rgbTransferG[256],
125 rgbTransferB[256];
126 Guchar grayTransfer[256];
127 #if SPLASH_CMYK
128 Guchar cmykTransferC[256],
129 cmykTransferM[256],
130 cmykTransferY[256],
131 cmykTransferK[256];
132 Guchar deviceNTransfer[SPOT_NCOMPS+4][256];
133 #endif
134 Guint overprintMask;
135 GBool overprintAdditive;
137 SplashState *next; // used by Splash class
139 friend class Splash;
142 #endif