Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-11 10:26:10

0001 //========================================================================
0002 //
0003 // SplashState.h
0004 //
0005 //========================================================================
0006 
0007 //========================================================================
0008 //
0009 // Modified under the Poppler project - http://poppler.freedesktop.org
0010 //
0011 // All changes made under the Poppler project to this file are licensed
0012 // under GPL version 2 or later
0013 //
0014 // Copyright (C) 2011, 2012, 2015 Thomas Freitag <Thomas.Freitag@alfa.de>
0015 // Copyright (C) 2017 Adrian Johnson <ajohnson@redneon.com>
0016 // Copyright (C) 2018, 2021, 2022 Albert Astals Cid <aacid@kde.org>
0017 //
0018 // To see a description of the changes please see the Changelog file that
0019 // came with your tarball or type make ChangeLog if you are building from git
0020 //
0021 //========================================================================
0022 
0023 #ifndef SPLASHSTATE_H
0024 #define SPLASHSTATE_H
0025 
0026 #include "SplashTypes.h"
0027 
0028 class SplashPattern;
0029 class SplashScreen;
0030 class SplashClip;
0031 class SplashBitmap;
0032 
0033 //------------------------------------------------------------------------
0034 // line cap values
0035 //------------------------------------------------------------------------
0036 
0037 #define splashLineCapButt 0
0038 #define splashLineCapRound 1
0039 #define splashLineCapProjecting 2
0040 
0041 //------------------------------------------------------------------------
0042 // line join values
0043 //------------------------------------------------------------------------
0044 
0045 #define splashLineJoinMiter 0
0046 #define splashLineJoinRound 1
0047 #define splashLineJoinBevel 2
0048 
0049 //------------------------------------------------------------------------
0050 // SplashState
0051 //------------------------------------------------------------------------
0052 
0053 class SplashState
0054 {
0055 public:
0056     // Create a new state object, initialized with default settings.
0057     SplashState(int width, int height, bool vectorAntialias, SplashScreenParams *screenParams);
0058     SplashState(int width, int height, bool vectorAntialias, SplashScreen *screenA);
0059 
0060     // Copy a state object.
0061     SplashState *copy() const { return new SplashState(this); }
0062 
0063     ~SplashState();
0064 
0065     SplashState(const SplashState &) = delete;
0066     SplashState &operator=(const SplashState &) = delete;
0067 
0068     // Set the stroke pattern.  This does not copy <strokePatternA>.
0069     void setStrokePattern(SplashPattern *strokePatternA);
0070 
0071     // Set the fill pattern.  This does not copy <fillPatternA>.
0072     void setFillPattern(SplashPattern *fillPatternA);
0073 
0074     // Set the screen.  This does not copy <screenA>.
0075     void setScreen(SplashScreen *screenA);
0076 
0077     // Set the line dash pattern.
0078     void setLineDash(std::vector<SplashCoord> &&lineDashA, SplashCoord lineDashPhaseA);
0079 
0080     // Set the soft mask bitmap.
0081     void setSoftMask(SplashBitmap *softMaskA);
0082 
0083     // Set the overprint parametes.
0084     void setFillOverprint(bool fillOverprintA) { fillOverprint = fillOverprintA; }
0085     void setStrokeOverprint(bool strokeOverprintA) { strokeOverprint = strokeOverprintA; }
0086     void setOverprintMode(int overprintModeA) { overprintMode = overprintModeA; }
0087 
0088     // Set the transfer function.
0089     void setTransfer(unsigned char *red, unsigned char *green, unsigned char *blue, unsigned char *gray);
0090 
0091 private:
0092     explicit SplashState(const SplashState *state);
0093 
0094     SplashCoord matrix[6];
0095     SplashPattern *strokePattern;
0096     SplashPattern *fillPattern;
0097     SplashScreen *screen;
0098     SplashBlendFunc blendFunc;
0099     SplashCoord strokeAlpha;
0100     SplashCoord fillAlpha;
0101     bool multiplyPatternAlpha;
0102     SplashCoord patternStrokeAlpha;
0103     SplashCoord patternFillAlpha;
0104     SplashCoord lineWidth;
0105     int lineCap;
0106     int lineJoin;
0107     SplashCoord miterLimit;
0108     SplashCoord flatness;
0109     std::vector<SplashCoord> lineDash;
0110     SplashCoord lineDashPhase;
0111     bool strokeAdjust;
0112     SplashClip *clip;
0113     SplashBitmap *softMask;
0114     bool deleteSoftMask;
0115     bool inNonIsolatedGroup;
0116     bool fillOverprint;
0117     bool strokeOverprint;
0118     int overprintMode;
0119     unsigned char rgbTransferR[256], rgbTransferG[256], rgbTransferB[256];
0120     unsigned char grayTransfer[256];
0121     unsigned char cmykTransferC[256], cmykTransferM[256], cmykTransferY[256], cmykTransferK[256];
0122     unsigned char deviceNTransfer[SPOT_NCOMPS + 4][256];
0123     unsigned int overprintMask;
0124     bool overprintAdditive;
0125 
0126     SplashState *next; // used by Splash class
0127 
0128     friend class Splash;
0129 };
0130 
0131 #endif