Coverage Report

Created: 2025-09-27 07:50

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/poppler/splash/SplashState.h
Line
Count
Source
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, 2024 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
#include <vector>
29
30
class SplashPattern;
31
class SplashScreen;
32
class SplashClip;
33
class SplashBitmap;
34
35
//------------------------------------------------------------------------
36
// line cap values
37
//------------------------------------------------------------------------
38
39
10.6M
#define splashLineCapButt 0
40
2.13M
#define splashLineCapRound 1
41
1.14M
#define splashLineCapProjecting 2
42
43
//------------------------------------------------------------------------
44
// line join values
45
//------------------------------------------------------------------------
46
47
24.4M
#define splashLineJoinMiter 0
48
13.2M
#define splashLineJoinRound 1
49
#define splashLineJoinBevel 2
50
51
//------------------------------------------------------------------------
52
// SplashState
53
//------------------------------------------------------------------------
54
55
class SplashState
56
{
57
public:
58
    // Create a new state object, initialized with default settings.
59
    SplashState(int width, int height, bool vectorAntialias, SplashScreenParams *screenParams);
60
    SplashState(int width, int height, bool vectorAntialias, SplashScreen *screenA);
61
62
    // Copy a state object.
63
4.24M
    SplashState *copy() const { return new SplashState(this); }
64
65
    ~SplashState();
66
67
    SplashState(const SplashState &) = delete;
68
    SplashState &operator=(const SplashState &) = delete;
69
70
    // Set the stroke pattern.  This does not copy <strokePatternA>.
71
    void setStrokePattern(SplashPattern *strokePatternA);
72
73
    // Set the fill pattern.  This does not copy <fillPatternA>.
74
    void setFillPattern(SplashPattern *fillPatternA);
75
76
    // Set the screen.  This does not copy <screenA>.
77
    void setScreen(SplashScreen *screenA);
78
79
    // Set the line dash pattern.
80
    void setLineDash(std::vector<SplashCoord> &&lineDashA, SplashCoord lineDashPhaseA);
81
82
    // Set the soft mask bitmap.
83
    void setSoftMask(SplashBitmap *softMaskA);
84
85
    // Set the overprint parametes.
86
0
    void setFillOverprint(bool fillOverprintA) { fillOverprint = fillOverprintA; }
87
0
    void setStrokeOverprint(bool strokeOverprintA) { strokeOverprint = strokeOverprintA; }
88
0
    void setOverprintMode(int overprintModeA) { overprintMode = overprintModeA; }
89
90
    // Set the transfer function.
91
    void setTransfer(unsigned char *red, unsigned char *green, unsigned char *blue, unsigned char *gray);
92
93
private:
94
    explicit SplashState(const SplashState *state);
95
96
    SplashCoord matrix[6];
97
    SplashPattern *strokePattern;
98
    SplashPattern *fillPattern;
99
    SplashScreen *screen;
100
    SplashBlendFunc blendFunc;
101
    SplashCoord strokeAlpha;
102
    SplashCoord fillAlpha;
103
    bool multiplyPatternAlpha;
104
    SplashCoord patternStrokeAlpha;
105
    SplashCoord patternFillAlpha;
106
    SplashCoord lineWidth;
107
    int lineCap;
108
    int lineJoin;
109
    SplashCoord miterLimit;
110
    SplashCoord flatness;
111
    std::vector<SplashCoord> lineDash;
112
    SplashCoord lineDashPhase;
113
    bool strokeAdjust;
114
    SplashClip *clip;
115
    SplashBitmap *softMask;
116
    bool deleteSoftMask;
117
    bool inNonIsolatedGroup;
118
    bool fillOverprint;
119
    bool strokeOverprint;
120
    int overprintMode;
121
    unsigned char rgbTransferR[256], rgbTransferG[256], rgbTransferB[256];
122
    unsigned char grayTransfer[256];
123
    unsigned char cmykTransferC[256], cmykTransferM[256], cmykTransferY[256], cmykTransferK[256];
124
    unsigned char deviceNTransfer[SPOT_NCOMPS + 4][256];
125
    unsigned int overprintMask;
126
    bool overprintAdditive;
127
128
    SplashState *next; // used by Splash class
129
130
    friend class Splash;
131
};
132
133
#endif