1 //========================================================================
5 //========================================================================
7 //========================================================================
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) 2010, 2011, 2014 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 SPLASHPATTERN_H
22 #define SPLASHPATTERN_H
24 #ifdef USE_GCC_PRAGMAS
28 #include "SplashTypes.h"
32 //------------------------------------------------------------------------
34 //------------------------------------------------------------------------
41 virtual SplashPattern
*copy() = 0;
43 virtual ~SplashPattern();
45 // Return the color value for a specific pixel.
46 virtual GBool
getColor(int x
, int y
, SplashColorPtr c
) = 0;
48 // Test if x,y-position is inside pattern.
49 virtual GBool
testPosition(int x
, int y
) = 0;
51 // Returns true if this pattern object will return the same color
52 // value for all pixels.
53 virtual GBool
isStatic() = 0;
55 // Returns true if this pattern colorspace is CMYK.
56 virtual GBool
isCMYK() = 0;
60 //------------------------------------------------------------------------
62 //------------------------------------------------------------------------
64 class SplashSolidColor
: public SplashPattern
{
67 SplashSolidColor(SplashColorPtr colorA
);
69 virtual SplashPattern
*copy() { return new SplashSolidColor(color
); }
71 virtual ~SplashSolidColor();
73 virtual GBool
getColor(int x
, int y
, SplashColorPtr c
);
75 virtual GBool
testPosition(int x
, int y
) { return gFalse
; }
77 virtual GBool
isStatic() { return gTrue
; }
79 virtual GBool
isCMYK() { return gFalse
; }
86 //------------------------------------------------------------------------
87 // SplashGouraudColor (needed for gouraudTriangleShadedFill)
88 //------------------------------------------------------------------------
90 class SplashGouraudColor
: public SplashPattern
{
93 virtual GBool
isParameterized() = 0;
95 virtual int getNTriangles() = 0;
97 virtual void getTriangle(int i
, double *x0
, double *y0
, double *color0
,
98 double *x1
, double *y1
, double *color1
,
99 double *x2
, double *y2
, double *color2
) = 0;
101 virtual void getParameterizedColor(double t
, SplashColorMode mode
, SplashColorPtr c
) = 0;