00001
00002
00003
00004
00005
00006 #ifndef PDFRasterizer_H
00007 #define PDFRasterizer_H
00008
00009 #include <PDF/Page.h>
00010 #include <C/PDF/TRN_PDFRasterizer.h>
00011 #include <PDF/OCG/Context.h>
00012
00013 namespace pdftron {
00014 namespace PDF {
00015
00027 class PDFRasterizer
00028 {
00029 public:
00030
00044 enum Type {
00045 e_BuiltIn,
00046 e_GDIPlus
00047 };
00048
00052 PDFRasterizer(Type type = e_BuiltIn);
00053 ~PDFRasterizer();
00054
00108 void Rasterize(Page& page, UChar* in_out_image_buffer,
00109 int width, int height, int stride, int num_comps,
00110 const Common::Matrix2D& device_mtx,
00111 const Rect* clip = 0,
00112 const Rect* scrl_clp_regions = 0,
00113 volatile bool* cancel = 0);
00114
00140 #ifdef _WIN32
00141 void Rasterize(Page& page, void* hdc,
00142 const Common::Matrix2D& device_mtx,
00143 const Rect* clip = 0,
00144 int dpi = -1,
00145 volatile bool* cancel = 0);
00146 #endif
00147
00153 void SetDrawAnnotations(bool render_annots);
00154
00164 void SetAntiAliasing(bool enable_aa);
00165
00179 void SetImageSmoothing(bool smoothing_enabled = true);
00180
00187 void SetCaching(bool enabled = true);
00188
00201 void SetGamma(double exp);
00202
00212 void SetOCGContext(OCG::Context* ctx);
00213
00223 void SetPrintMode(bool is_printing);
00224
00235 void SetOverprint(bool overprint);
00236
00242 typedef void (*ErrorReportProc) (const char* message, void* data);
00243
00251 void SetErrorReportProc(ErrorReportProc error_proc, void* data);
00252
00261 void SetRasterizerType (Type type);
00262
00266 Type GetRasterizerType ();
00267
00269 TRN_PDFRasterizer mp_rast;
00271 };
00272
00273
00274 #include <Impl/PDFRasterizer.inl>
00275
00276
00277 };
00278 };
00279
00280 #endif
00281
00282
00283