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
00096 static Type GetType(SDF::Obj shading_dict);
00097
00098
00099
00103 Shading::Type GetType() const;
00104
00108 SDF::Obj GetSDFObj ();
00109
00115 ColorSpace GetBaseColorSpace();
00116
00120 bool HasBBox();
00121
00133 Rect GetBBox();
00134
00138 bool HasBackground();
00139
00155 ColorPt GetBackground();
00156
00161 bool GetAntialias();
00162
00163
00164
00165
00176 double GetParamStart();
00177
00188 double GetParamEnd();
00189
00196 bool IsExtendStart();
00197
00204 bool IsExtendEnd();
00205
00211 void GetColor(double t, ColorPt& out_color);
00212
00213
00214
00215
00223 void GetCoords(double& out_x0, double& out_y0, double& out_x1, double& out_y1);
00224
00225
00226
00227
00237 void GetCoords(double& out_x0, double& out_y0, double& out_r0,
00238 double& out_x1, double& out_y1, double& out_r1);
00239
00240
00241
00242
00250 void GetDomain(double& out_xmin, double& out_xmax, double& out_ymin, double& out_ymax);
00251
00258 Common::Matrix2D GetMatrix();
00259
00265 void GetColor(double t1, double t2, ColorPt& out_color);
00266
00268 Shading(TRN_Shading impl);
00269 TRN_Shading mp_shade;
00271 };
00272
00273
00274 #include <Impl/Shading.inl>
00275
00276 };
00277 };
00278
00279 #endif
00280