1 | //======================================================================== |
2 | // |
3 | // SplashState.h |
4 | // |
5 | //======================================================================== |
6 | |
7 | //======================================================================== |
8 | // |
9 | // Modified under the Poppler project - http://poppler.freedesktop.org |
10 | // |
11 | // All changes made under the Poppler project to this file are licensed |
12 | // under GPL version 2 or later |
13 | // |
14 | // Copyright (C) 2011, 2012, 2015 Thomas Freitag <Thomas.Freitag@alfa.de> |
15 | // Copyright (C) 2017 Adrian Johnson <ajohnson@redneon.com> |
16 | // Copyright (C) 2018, 2021, 2022 Albert Astals Cid <aacid@kde.org> |
17 | // |
18 | // To see a description of the changes please see the Changelog file that |
19 | // came with your tarball or type make ChangeLog if you are building from git |
20 | // |
21 | //======================================================================== |
22 | |
23 | #ifndef SPLASHSTATE_H |
24 | #define SPLASHSTATE_H |
25 | |
26 | #include "SplashTypes.h" |
27 | |
28 | class SplashPattern; |
29 | class SplashScreen; |
30 | class SplashClip; |
31 | class SplashBitmap; |
32 | |
33 | //------------------------------------------------------------------------ |
34 | // line cap values |
35 | //------------------------------------------------------------------------ |
36 | |
37 | #define splashLineCapButt 0 |
38 | #define splashLineCapRound 1 |
39 | #define splashLineCapProjecting 2 |
40 | |
41 | //------------------------------------------------------------------------ |
42 | // line join values |
43 | //------------------------------------------------------------------------ |
44 | |
45 | #define splashLineJoinMiter 0 |
46 | #define splashLineJoinRound 1 |
47 | #define splashLineJoinBevel 2 |
48 | |
49 | //------------------------------------------------------------------------ |
50 | // SplashState |
51 | //------------------------------------------------------------------------ |
52 | |
53 | class SplashState |
54 | { |
55 | public: |
56 | // Create a new state object, initialized with default settings. |
57 | SplashState(int width, int height, bool vectorAntialias, SplashScreenParams *screenParams); |
58 | SplashState(int width, int height, bool vectorAntialias, SplashScreen *screenA); |
59 | |
60 | // Copy a state object. |
61 | SplashState *copy() const { return new SplashState(this); } |
62 | |
63 | ~SplashState(); |
64 | |
65 | SplashState(const SplashState &) = delete; |
66 | SplashState &operator=(const SplashState &) = delete; |
67 | |
68 | // Set the stroke pattern. This does not copy <strokePatternA>. |
69 | void setStrokePattern(SplashPattern *strokePatternA); |
70 | |
71 | // Set the fill pattern. This does not copy <fillPatternA>. |
72 | void setFillPattern(SplashPattern *fillPatternA); |
73 | |
74 | // Set the screen. This does not copy <screenA>. |
75 | void setScreen(SplashScreen *screenA); |
76 | |
77 | // Set the line dash pattern. |
78 | void setLineDash(std::vector<SplashCoord> &&lineDashA, SplashCoord lineDashPhaseA); |
79 | |
80 | // Set the soft mask bitmap. |
81 | void setSoftMask(SplashBitmap *softMaskA); |
82 | |
83 | // Set the overprint parametes. |
84 | void setFillOverprint(bool fillOverprintA) { fillOverprint = fillOverprintA; } |
85 | void setStrokeOverprint(bool strokeOverprintA) { strokeOverprint = strokeOverprintA; } |
86 | void setOverprintMode(int overprintModeA) { overprintMode = overprintModeA; } |
87 | |
88 | // Set the transfer function. |
89 | void setTransfer(unsigned char *red, unsigned char *green, unsigned char *blue, unsigned char *gray); |
90 | |
91 | private: |
92 | explicit SplashState(const SplashState *state); |
93 | |
94 | SplashCoord matrix[6]; |
95 | SplashPattern *strokePattern; |
96 | SplashPattern *fillPattern; |
97 | SplashScreen *screen; |
98 | SplashBlendFunc blendFunc; |
99 | SplashCoord strokeAlpha; |
100 | SplashCoord fillAlpha; |
101 | bool multiplyPatternAlpha; |
102 | SplashCoord patternStrokeAlpha; |
103 | SplashCoord patternFillAlpha; |
104 | SplashCoord lineWidth; |
105 | int lineCap; |
106 | int lineJoin; |
107 | SplashCoord miterLimit; |
108 | SplashCoord flatness; |
109 | std::vector<SplashCoord> lineDash; |
110 | SplashCoord lineDashPhase; |
111 | bool strokeAdjust; |
112 | SplashClip *clip; |
113 | SplashBitmap *softMask; |
114 | bool deleteSoftMask; |
115 | bool inNonIsolatedGroup; |
116 | bool fillOverprint; |
117 | bool strokeOverprint; |
118 | int overprintMode; |
119 | unsigned char rgbTransferR[256], rgbTransferG[256], rgbTransferB[256]; |
120 | unsigned char grayTransfer[256]; |
121 | unsigned char cmykTransferC[256], cmykTransferM[256], cmykTransferY[256], cmykTransferK[256]; |
122 | unsigned char deviceNTransfer[SPOT_NCOMPS + 4][256]; |
123 | unsigned int overprintMask; |
124 | bool overprintAdditive; |
125 | |
126 | SplashState *next; // used by Splash class |
127 | |
128 | friend class Splash; |
129 | }; |
130 | |
131 | #endif |
132 | |