- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

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-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
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
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
pdftron::PDF::Shading::GetCoordsAxial
std::vector< double > GetCoordsAxial()
pdftron::PDF::Shading::GetCoords
void GetCoords(double &out_x0, double &out_y0, double &out_x1, double &out_y1)
pdftron::PDF::Shading::GetBackground
ColorPt GetBackground()
pdftron::PDF::ColorPt
Definition: ColorSpace.h:20
pdftron::PDF::ColorSpace
Definition: ColorSpace.h:138
pdftron::PDF::Shading::~Shading
~Shading()
pdftron::PDF::Shading::e_tensor_shading
Definition: Shading.h:83
pdftron::PDF::Shading
Definition: Shading.h:60
pdftron::PDF::Shading::GetMatrix
Common::Matrix2D GetMatrix()
pdftron::PDF::Shading::IsExtendEnd
bool IsExtendEnd()
Matrix2D.h
pdftron::PDF::Shading::operator=
Shading & operator=(const Shading &s)
pdftron::PDF::Shading::GetColor
ColorPt GetColor(double t)
ColorSpace.h
pdftron::PDF::Shading::e_axial_shading
Definition: Shading.h:78
pdftron::PDF::Shading::e_coons_shading
Definition: Shading.h:82
pdftron::PDF::Rect
Definition: Rect.h:28
pdftron::PDF::Shading::GetBaseColorSpace
ColorSpace GetBaseColorSpace()
pdftron::PDF::Shading::GetDomain
std::vector< double > GetDomain()
pdftron::PDF::Shading::Type
Type
Definition: Shading.h:75
pdftron::PDF::Shading::GetType
Shading::Type GetType() const
pdftron::PDF::Shading::e_null
Definition: Shading.h:84
pdftron::Common::Matrix2D
Definition: Matrix2D.h:103
pdftron::PDF::Shading::IsExtendStart
bool IsExtendStart()
pdftron::PDF::Shading::e_free_gouraud_shading
Definition: Shading.h:80
pdftron::PDF::Shading::GetCoordsRadial
std::vector< double > GetCoordsRadial()
pdftron::PDF::Shading::HasBackground
bool HasBackground()
pdftron::PDF::Shading::e_radial_shading
Definition: Shading.h:79
pdftron::PDF::Shading::GetSDFObj
SDF::Obj GetSDFObj()
pdftron::PDF::Shading::HasBBox
bool HasBBox()
pdftron::PDF::Shading::GetBBox
Rect GetBBox()
pdftron::PDF::Shading::e_function_shading
Definition: Shading.h:77
pdftron::PDF::Shading::Destroy
void Destroy()
Rect.h
pdftron::PDF::Shading::e_lattice_gouraud_shading
Definition: Shading.h:81
pdftron::SDF::Obj
Definition: Obj.h:40
pdftron::PDF::Shading::GetAntialias
bool GetAntialias()
pdftron::PDF::Shading::GetParamEnd
double GetParamEnd()
pdftron::PDF::Shading::GetParamStart
double GetParamStart()
pdftron::PDF::Shading::Shading
Shading(SDF::Obj shading_dict=0)