00001
00002
00003
00004
00005
00006 #ifndef H_CPPPDFShading
00007 #define H_CPPPDFShading
00008
00009 #include <PDF/ColorSpace.h>
00010 #include <PDF/Rect.h>
00011 #include <Common/Matrix2D.h>
00012 #include <C/PDF/TRN_Shading.h>
00013
00014 namespace pdftron {
00015 namespace PDF {
00016
00061 class Shading
00062 {
00063 public:
00064
00070 Shading (SDF::Obj shading_dict = 0);
00071
00072 Shading (const Shading& s);
00073 Shading& operator=(const Shading& s);
00074 ~Shading();
00075
00076 enum Type
00077 {
00078 e_function_shading,
00079 e_axial_shading,
00080 e_radial_shading,
00081 e_free_gouraud_shading,
00082 e_lattice_gouraud_shading,
00083 e_coons_shading,
00084 e_tensor_shading,
00085 e_null
00086 };
00087
00088
00089
00090 #ifndef SWIG
00091
00097 static Type GetType(SDF::Obj shading_dict);
00098 #endif
00099
00100
00101
00105 Shading::Type GetType() const;
00106
00110 SDF::Obj GetSDFObj ();
00111
00117 ColorSpace GetBaseColorSpace();
00118
00122 bool HasBBox();
00123
00135 Rect GetBBox();
00136
00140 bool HasBackground();
00141
00157 ColorPt GetBackground();
00158
00163 bool GetAntialias();
00164
00165
00166
00167
00178 double GetParamStart();
00179
00190 double GetParamEnd();
00191
00198 bool IsExtendStart();
00199
00206 bool IsExtendEnd();
00207
00213 ColorPt GetColor(double t);
00214
00215 #ifndef SWIG
00216 void GetColor(double t, ColorPt& out_color);
00217 #endif
00218
00219
00220
00221
00229 std::vector<double> GetCoordsAxial();
00230
00231 #ifndef SWIG
00232 void GetCoords(double& out_x0, double& out_y0, double& out_x1, double& out_y1);
00233 #endif
00234
00235
00236
00246 std::vector<double> GetCoordsRadial();
00247
00248 #ifndef SWIG
00249 void GetCoords(double& out_x0, double& out_y0, double& out_r0,
00250 double& out_x1, double& out_y1, double& out_r1);
00251 #endif
00252
00253
00254
00255
00263 std::vector<double> GetDomain();
00264
00265 #ifndef SWIG
00266 void GetDomain(double& out_xmin, double& out_xmax, double& out_ymin, double& out_ymax);
00267 #endif
00268
00275 Common::Matrix2D GetMatrix();
00276
00282 ColorPt GetColor(double t1, double t2);
00283
00284 #ifndef SWIG
00285 void GetColor(double t1, double t2, ColorPt& out_color);
00286 #endif
00287
00291 void Destroy();
00292
00294 #ifndef SWIGHIDDEN
00295 Shading(TRN_Shading impl);
00296 TRN_Shading mp_shade;
00297 #endif
00299 };
00300
00301
00302 #include <Impl/Shading.inl>
00303
00304 };
00305 };
00306
00307 #endif
00308