Loading...
Searching...
No Matches
Shading.h
Go to the documentation of this file.
1//---------------------------------------------------------------------------------------
2// Copyright (c) 2001-2025 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 {
77 e_function_shading,
78 e_axial_shading,
79 e_radial_shading,
80 e_free_gouraud_shading,
81 e_lattice_gouraud_shading,
82 e_coons_shading,
83 e_tensor_shading,
84 e_null
85 };
86
87 // Common Static/Global methods -------------------------------------------------
88
89#ifndef SWIG
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
115 ColorSpace GetBaseColorSpace();
116
120 bool HasBBox();
121
133 Rect GetBBox();
134
138 bool HasBackground();
139
155 ColorPt GetBackground();
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
273 Common::Matrix2D GetMatrix();
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
ColorSpace.h
Matrix2D.h
Rect.h
pdftron::Common::Matrix2D
Definition Matrix2D.h:104
pdftron::PDF::ColorPt
Definition ColorSpace.h:21
pdftron::PDF::ColorSpace
Definition ColorSpace.h:139
pdftron::PDF::Rect
Definition Rect.h:29
pdftron::PDF::Shading::GetParamEnd
double GetParamEnd()
pdftron::PDF::Shading::operator=
Shading & operator=(const Shading &s)
pdftron::PDF::Shading::GetParamStart
double GetParamStart()
pdftron::PDF::Shading::GetColor
void GetColor(double t1, double t2, ColorPt &out_color)
pdftron::PDF::Shading::GetCoordsAxial
std::vector< double > GetCoordsAxial()
pdftron::PDF::Shading::Destroy
void Destroy()
pdftron::PDF::Shading::GetColor
void GetColor(double t, ColorPt &out_color)
pdftron::PDF::Shading::GetMatrix
Common::Matrix2D GetMatrix()
pdftron::PDF::Shading::GetDomain
void GetDomain(double &out_xmin, double &out_xmax, double &out_ymin, double &out_ymax)
pdftron::PDF::Shading::~Shading
~Shading()
pdftron::PDF::Shading::GetBaseColorSpace
ColorSpace GetBaseColorSpace()
pdftron::PDF::Shading::GetAntialias
bool GetAntialias()
pdftron::PDF::Shading::GetColor
ColorPt GetColor(double t)
pdftron::PDF::Shading::Shading
Shading(const Shading &s)
pdftron::PDF::Shading::HasBBox
bool HasBBox()
pdftron::PDF::Shading::GetColor
ColorPt GetColor(double t1, double t2)
pdftron::PDF::Shading::Type
Type
Definition Shading.h:76
pdftron::PDF::Shading::e_tensor_shading
@ e_tensor_shading
Definition Shading.h:83
pdftron::PDF::Shading::e_lattice_gouraud_shading
@ e_lattice_gouraud_shading
Definition Shading.h:81
pdftron::PDF::Shading::e_coons_shading
@ e_coons_shading
Definition Shading.h:82
pdftron::PDF::Shading::e_radial_shading
@ e_radial_shading
Definition Shading.h:79
pdftron::PDF::Shading::e_null
@ e_null
Definition Shading.h:84
pdftron::PDF::Shading::e_function_shading
@ e_function_shading
Definition Shading.h:77
pdftron::PDF::Shading::e_axial_shading
@ e_axial_shading
Definition Shading.h:78
pdftron::PDF::Shading::e_free_gouraud_shading
@ e_free_gouraud_shading
Definition Shading.h:80
pdftron::PDF::Shading::GetType
static Type GetType(SDF::Obj shading_dict)
pdftron::PDF::Shading::GetSDFObj
SDF::Obj GetSDFObj()
pdftron::PDF::Shading::GetBackground
ColorPt GetBackground()
pdftron::PDF::Shading::GetCoords
void GetCoords(double &out_x0, double &out_y0, double &out_x1, double &out_y1)
pdftron::PDF::Shading::IsExtendStart
bool IsExtendStart()
pdftron::PDF::Shading::GetType
Shading::Type GetType() const
pdftron::PDF::Shading::GetBBox
Rect GetBBox()
pdftron::PDF::Shading::GetCoords
void GetCoords(double &out_x0, double &out_y0, double &out_r0, double &out_x1, double &out_y1, double &out_r1)
pdftron::PDF::Shading::HasBackground
bool HasBackground()
pdftron::PDF::Shading::GetDomain
std::vector< double > GetDomain()
pdftron::PDF::Shading::Shading
Shading(SDF::Obj shading_dict=0)
pdftron::PDF::Shading::IsExtendEnd
bool IsExtendEnd()
pdftron::PDF::Shading::GetCoordsRadial
std::vector< double > GetCoordsRadial()
pdftron::SDF::Obj
Definition Obj.h:41
pdftron::PDF
Definition Action.h:15
pdftron
Definition BasicTypes.h:10