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
13namespace pdftron {
14 namespace PDF {
15
61{
62public:
63
69 Shading (SDF::Obj shading_dict = 0);
70
71 Shading (const Shading& s);
74
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
104
109
116
120 bool HasBBox();
121
134
139
156
162
163
164 // Specific methods ------------------------------------------------------------
165
177
188 double GetParamEnd();
189
197
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
Shading & operator=(const Shading &s)
void GetColor(double t1, double t2, ColorPt &out_color)
std::vector< double > GetCoordsAxial()
void GetColor(double t, ColorPt &out_color)
Common::Matrix2D GetMatrix()
void GetDomain(double &out_xmin, double &out_xmax, double &out_ymin, double &out_ymax)
ColorSpace GetBaseColorSpace()
ColorPt GetColor(double t)
Shading(const Shading &s)
ColorPt GetColor(double t1, double t2)
static Type GetType(SDF::Obj shading_dict)
void GetCoords(double &out_x0, double &out_y0, double &out_x1, double &out_y1)
Shading::Type GetType() const
void GetCoords(double &out_x0, double &out_y0, double &out_r0, double &out_x1, double &out_y1, double &out_r1)
std::vector< double > GetDomain()
Shading(SDF::Obj shading_dict=0)
std::vector< double > GetCoordsRadial()