All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Shading.h
Go to the documentation of this file.
1 //---------------------------------------------------------------------------------------
2 // Copyright (c) 2001-2024 by Apryse Software Inc. All Rights Reserved.
3 // Consult legal.txt regarding legal and license information.
4 //---------------------------------------------------------------------------------------
5 #ifndef PDFTRON_H_CPPPDFShading
6 #define PDFTRON_H_CPPPDFShading
7 
8 #include <PDF/ColorSpace.h>
9 #include <PDF/Rect.h>
10 #include <Common/Matrix2D.h>
11 #include <C/PDF/TRN_Shading.h>
12 
13 namespace pdftron {
14  namespace PDF {
15 
60 class Shading
61 {
62 public:
63 
69  Shading (SDF::Obj shading_dict = 0);
70 
71  Shading (const Shading& s);
72  Shading& operator=(const Shading& s);
73  ~Shading();
74 
75  enum Type
76  {
85  };
86 
87  // Common Static/Global methods -------------------------------------------------
88 
89 #ifndef SWIG
90 
95  static Type GetType(SDF::Obj shading_dict);
96 #endif
97 
98  // Common methods ------------------------------------------------------------------
99 
103  Shading::Type GetType() const;
104 
108  SDF::Obj GetSDFObj ();
109 
116 
120  bool HasBBox();
121 
133  Rect GetBBox();
134 
138  bool HasBackground();
139 
156 
161  bool GetAntialias();
162 
163 
164  // Specific methods ------------------------------------------------------------
165 
176  double GetParamStart();
177 
188  double GetParamEnd();
189 
196  bool IsExtendStart();
197 
204  bool IsExtendEnd();
205 
211  ColorPt GetColor(double t);
212 
213 #ifndef SWIG
214  void GetColor(double t, ColorPt& out_color);
215 #endif
216 
217 
218  // Specific AxialShading methods -----------------------------------------------
219 
227  std::vector<double> GetCoordsAxial();
228 
229 #ifndef SWIG
230  void GetCoords(double& out_x0, double& out_y0, double& out_x1, double& out_y1);
231 #endif
232 
233  // Specific RadialShading methods ----------------------------------------------
234 
244  std::vector<double> GetCoordsRadial();
245 
246 #ifndef SWIG
247  void GetCoords(double& out_x0, double& out_y0, double& out_r0,
248  double& out_x1, double& out_y1, double& out_r1);
249 #endif
250 
251 
252  // Specific FunctionShading methods --------------------------------------------
253 
261  std::vector<double> GetDomain();
262 
263 #ifndef SWIG
264  void GetDomain(double& out_xmin, double& out_xmax, double& out_ymin, double& out_ymax);
265 #endif
266 
274 
280  ColorPt GetColor(double t1, double t2);
281 
282 #ifndef SWIG
283  void GetColor(double t1, double t2, ColorPt& out_color);
284 #endif
285 
289  void Destroy();
290 
291 // @cond PRIVATE_DOC
292 #ifndef SWIGHIDDEN
293  Shading(TRN_Shading impl);
294  TRN_Shading mp_shade;
295 #endif
296 // @endcond
297 };
298 
299 
300 #include <Impl/Shading.inl>
301 
302  }; // namespace PDF
303 }; // namespace pdftron
304 
305 #endif // PDFTRON_H_CPPPDFShading
std::vector< double > GetCoordsAxial()
void GetCoords(double &out_x0, double &out_y0, double &out_x1, double &out_y1)
Common::Matrix2D GetMatrix()
Shading & operator=(const Shading &s)
ColorPt GetColor(double t)
ColorSpace GetBaseColorSpace()
std::vector< double > GetDomain()
Shading::Type GetType() const
std::vector< double > GetCoordsRadial()
Shading(SDF::Obj shading_dict=0)