beta-0.89.2
[luatex.git] / source / libs / poppler / poppler-src / splash / SplashPattern.h
blobe678c9e20e67368a409d6192ec8b4d2da9fb0430
1 //========================================================================
2 //
3 // SplashPattern.h
4 //
5 //========================================================================
7 //========================================================================
8 //
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
25 #pragma interface
26 #endif
28 #include "SplashTypes.h"
30 class SplashScreen;
32 //------------------------------------------------------------------------
33 // SplashPattern
34 //------------------------------------------------------------------------
36 class SplashPattern {
37 public:
39 SplashPattern();
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;
57 private:
60 //------------------------------------------------------------------------
61 // SplashSolidColor
62 //------------------------------------------------------------------------
64 class SplashSolidColor: public SplashPattern {
65 public:
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; }
81 private:
83 SplashColor color;
86 //------------------------------------------------------------------------
87 // SplashGouraudColor (needed for gouraudTriangleShadedFill)
88 //------------------------------------------------------------------------
90 class SplashGouraudColor: public SplashPattern {
91 public:
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;
104 #endif