Back to home page

EIC code displayed by LXR

 
 

    


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

0001 //========================================================================
0002 //
0003 // SplashPattern.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) 2010, 2011, 2014 Thomas Freitag <Thomas.Freitag@alfa.de>
0015 // Copyright (C) 2018, 2020, 2021 Albert Astals Cid <aacid@kde.org>
0016 //
0017 // To see a description of the changes please see the Changelog file that
0018 // came with your tarball or type make ChangeLog if you are building from git
0019 //
0020 //========================================================================
0021 
0022 #ifndef SPLASHPATTERN_H
0023 #define SPLASHPATTERN_H
0024 
0025 #include "SplashTypes.h"
0026 #include "poppler_private_export.h"
0027 
0028 class SplashScreen;
0029 
0030 //------------------------------------------------------------------------
0031 // SplashPattern
0032 //------------------------------------------------------------------------
0033 
0034 class POPPLER_PRIVATE_EXPORT SplashPattern
0035 {
0036 public:
0037     SplashPattern();
0038 
0039     virtual SplashPattern *copy() const = 0;
0040 
0041     virtual ~SplashPattern();
0042 
0043     SplashPattern(const SplashPattern &) = delete;
0044     SplashPattern &operator=(const SplashPattern &) = delete;
0045 
0046     // Return the color value for a specific pixel.
0047     virtual bool getColor(int x, int y, SplashColorPtr c) = 0;
0048 
0049     // Test if x,y-position is inside pattern.
0050     virtual bool testPosition(int x, int y) = 0;
0051 
0052     // Returns true if this pattern object will return the same color
0053     // value for all pixels.
0054     virtual bool isStatic() = 0;
0055 
0056     // Returns true if this pattern colorspace is CMYK.
0057     virtual bool isCMYK() = 0;
0058 
0059 private:
0060 };
0061 
0062 //------------------------------------------------------------------------
0063 // SplashSolidColor
0064 //------------------------------------------------------------------------
0065 
0066 class POPPLER_PRIVATE_EXPORT SplashSolidColor : public SplashPattern
0067 {
0068 public:
0069     explicit SplashSolidColor(SplashColorConstPtr colorA);
0070 
0071     SplashPattern *copy() const override { return new SplashSolidColor(color); }
0072 
0073     ~SplashSolidColor() override;
0074 
0075     bool getColor(int x, int y, SplashColorPtr c) override;
0076 
0077     bool testPosition(int x, int y) override { return false; }
0078 
0079     bool isStatic() override { return true; }
0080 
0081     bool isCMYK() override { return false; }
0082 
0083 private:
0084     SplashColor color;
0085 };
0086 
0087 //------------------------------------------------------------------------
0088 // SplashGouraudColor (needed for gouraudTriangleShadedFill)
0089 //------------------------------------------------------------------------
0090 
0091 class SplashGouraudColor : public SplashPattern
0092 {
0093 public:
0094     ~SplashGouraudColor() override;
0095 
0096     virtual bool isParameterized() = 0;
0097 
0098     virtual int getNTriangles() = 0;
0099 
0100     virtual void getParametrizedTriangle(int i, double *x0, double *y0, double *color0, double *x1, double *y1, double *color1, double *x2, double *y2, double *color2) = 0;
0101 
0102     virtual void getNonParametrizedTriangle(int i, SplashColorMode mode, double *x0, double *y0, SplashColorPtr color0, double *x1, double *y1, SplashColorPtr color1, double *x2, double *y2, SplashColorPtr color2) = 0;
0103 
0104     virtual void getParameterizedColor(double t, SplashColorMode mode, SplashColorPtr c) = 0;
0105 };
0106 
0107 #endif