Coverage Report

Created: 2026-07-30 07:17

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-2026 Albert Astals Cid <aacid@kde.org>
17
// Copyright (C) 2026 Taufeeque Sifat <entity069@protonmail.com>
18
// Copyright (C) 2026 Stefan BrĂ¼ns <stefan.bruens@rwth-aachen.de>
19
//
20
// To see a description of the changes please see the Changelog file that
21
// came with your tarball or type make ChangeLog if you are building from git
22
//
23
//========================================================================
24
25
#ifndef SPLASHSTATE_H
26
#define SPLASHSTATE_H
27
28
#include "SplashTypes.h"
29
30
#include <array>
31
#include <vector>
32
33
class SplashPattern;
34
class SplashScreen;
35
class SplashClip;
36
class SplashBitmap;
37
38
//------------------------------------------------------------------------
39
// SplashState
40
//------------------------------------------------------------------------
41
42
class SplashState
43
{
44
public:
45
    // Create a new state object, initialized with default settings.
46
    SplashState(int width, int height, bool vectorAntialias, const SplashScreen &screenA);
47
48
    // Copy a state object.
49
0
    SplashState *copy() const { return new SplashState(this); }
50
51
    ~SplashState();
52
53
    SplashState(const SplashState &) = delete;
54
    SplashState &operator=(const SplashState &) = delete;
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 line dash pattern.
63
    void setLineDash(std::vector<double> &&lineDashA, double lineDashPhaseA);
64
65
    // Set the soft mask bitmap.
66
    void setSoftMask(SplashBitmap *softMaskA);
67
68
    // Set the overprint parametes.
69
0
    void setFillOverprint(bool fillOverprintA) { fillOverprint = fillOverprintA; }
70
0
    void setStrokeOverprint(bool strokeOverprintA) { strokeOverprint = strokeOverprintA; }
71
0
    void setOverprintMode(int overprintModeA) { overprintMode = overprintModeA; }
72
73
    // Set the transfer function.
74
    void setTransfer(unsigned char *red, unsigned char *green, unsigned char *blue, unsigned char *gray);
75
76
private:
77
    explicit SplashState(const SplashState *state);
78
79
    std::array<double, 6> matrix;
80
    SplashPattern *strokePattern;
81
    SplashPattern *fillPattern;
82
    SplashScreen *screen;
83
    SplashBlendFunc blendFunc;
84
    double strokeAlpha;
85
    double fillAlpha;
86
    bool multiplyPatternAlpha;
87
    double patternStrokeAlpha;
88
    double patternFillAlpha;
89
    double lineWidth;
90
    SplashLineCap lineCap;
91
    SplashLineJoin lineJoin;
92
    double miterLimit;
93
    double flatness;
94
    std::vector<double> lineDash;
95
    double lineDashPhase;
96
    bool strokeAdjust;
97
    std::unique_ptr<SplashClip> clip;
98
    SplashBitmap *softMask;
99
    bool deleteSoftMask;
100
    bool inNonIsolatedGroup;
101
    bool inKnockoutGroup;
102
    bool fillOverprint;
103
    bool strokeOverprint;
104
    int overprintMode;
105
    unsigned char rgbTransferR[256], rgbTransferG[256], rgbTransferB[256];
106
    unsigned char grayTransfer[256];
107
    unsigned char cmykTransferC[256], cmykTransferM[256], cmykTransferY[256], cmykTransferK[256];
108
    unsigned char deviceNTransfer[SPOT_NCOMPS + 4][256];
109
    unsigned int overprintMask;
110
    bool overprintAdditive;
111
112
    SplashState *next; // used by Splash class
113
114
    friend class Splash;
115
};
116
117
#endif