All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PDFRasterizer.h
Go to the documentation of this file.
1 //---------------------------------------------------------------------------------------
2 // Copyright (c) 2001-2018 by PDFTron Systems Inc. All Rights Reserved.
3 // Consult legal.txt regarding legal and license information.
4 //---------------------------------------------------------------------------------------
5 #ifndef PDFTRON_H_CPPPDFRasterizer
6 #define PDFTRON_H_CPPPDFRasterizer
7 
8 #include <PDF/PDFDoc.h>
9 #include <PDF/Page.h>
10 #include <C/PDF/TRN_PDFRasterizer.h>
11 #include <PDF/OCG/Context.h>
12 #ifdef SWIG
13 #include <PDF/Callback.h>
14 #endif
15 
16 namespace pdftron {
17  namespace PDF {
18 
21 {
36 };
37 
43 typedef void (*DownloadReportHandler) (DownloadedType type, PDFDoc* doc, int page_num, int obj_num, const char* message, void* data);
44 
57 {
58 public:
59 
73  enum Type {
76  };
77 
85  e_op_off = 0,
88  };
89 
95 
149 #ifndef SWIG
150  std::vector<unsigned char> Rasterize(Page& page,
151  int width, int height, int stride,
152  int num_comps, bool demult,
153  const Common::Matrix2D& device_mtx,
154  const Rect* clip = 0,
155  const Rect* scrl_clip_regions = 0,
156  bool* cancel = 0);
157 
158  void Rasterize(Page& page, UChar* in_out_image_buffer,
159  int width, int height, int stride,
160  int num_comps, bool demult,
161  const Common::Matrix2D& device_mtx,
162  const Rect* clip = 0,
163  const Rect* scrl_clip_regions = 0,
164  bool* cancel = 0);
165 #else // SWIG
166  std::vector<unsigned char> Rasterize(
167  Page& page,
168  int width,
169  int height,
170  int stride,
171  int num_comps,
172  bool demult,
173  const Common::Matrix2D& device_mtx,
174  const Rect* clip = 0,
175  const Rect* scrl_clip_regions = 0
176  );
177 #endif // SWIG
178 
204 #ifdef _WIN32
205  void Rasterize(Page& page, void* hdc,
206  const Common::Matrix2D& device_mtx,
207  const Rect* clip = 0,
208  int dpi = -1,
209  bool* cancel = 0);
210 #endif
211 
217  void SetDrawAnnotations(bool render_annots);
218 
224  void SetHighlightFields(bool highlight_fields);
225 
235  void SetAntiAliasing(bool enable_aa);
236 
245  void SetPathHinting(bool enable_hinting);
246 
257  void SetThinLineAdjustment(bool pixel_grid_fit, bool stroke_adjust);
258 
273  void SetImageSmoothing(bool smoothing_enabled = true, bool hq_image_resampling = false);
274 
281  void SetCaching(bool enabled = true);
282 
295  void SetGamma(double expgamma);
296 
306  void SetOCGContext(OCG::Context* ctx);
307 
317  void SetPrintMode(bool is_printing);
318 
329 
335  typedef void (*ErrorReportProc) (const char* message, void* data);
336 
344 #ifdef SWIG
345  void SetErrorReportProc(Callback* instance);
346 #else
347  void SetErrorReportProc(ErrorReportProc error_proc, void* data);
348 #endif
349 
358  void SetRasterizerType (Type type);
359 
364 
369  {
374  };
375 
386 
391 
397  void UpdateBuffer();
398 
402  void Destroy();
403 
405 #ifndef SWIGHIDDEN
406  TRN_PDFRasterizer mp_rast;
407 private:
409  PDFRasterizer& operator= (const PDFRasterizer&);
410 #endif
411 };
413 
414 
415 
416 #include <Impl/PDFRasterizer.inl>
417 
418 
419  }; // namespace PDF
420 }; // namespace pdftron
421 
422 #endif // PDFTRON_H_CPPPDFRasterizer
void SetCaching(bool enabled=true)
void SetImageSmoothing(bool smoothing_enabled=true, bool hq_image_resampling=false)
void SetThinLineAdjustment(bool pixel_grid_fit, bool stroke_adjust)
void SetErrorReportProc(ErrorReportProc error_proc, void *data)
void SetOverprint(OverprintPreviewMode op)
void SetGamma(double expgamma)
std::vector< unsigned char > Rasterize(Page &page, int width, int height, int stride, int num_comps, bool demult, const Common::Matrix2D &device_mtx, const Rect *clip=0, const Rect *scrl_clip_regions=0, bool *cancel=0)
void SetRasterizerType(Type type)
ColorPostProcessMode GetColorPostProcessMode() const
void SetPathHinting(bool enable_hinting)
void(* ErrorReportProc)(const char *message, void *data)
void SetAntiAliasing(bool enable_aa)
TRN_UChar UChar
Definition: BasicTypes.h:12
void SetColorPostProcessMode(ColorPostProcessMode mode)
void(* DownloadReportHandler)(DownloadedType type, PDFDoc *doc, int page_num, int obj_num, const char *message, void *data)
Definition: PDFRasterizer.h:43
void SetHighlightFields(bool highlight_fields)
high-quality, platform independent rasterizer.
Definition: PDFRasterizer.h:74
void SetDrawAnnotations(bool render_annots)
void SetOCGContext(OCG::Context *ctx)
PDFRasterizer(Type type=e_BuiltIn)
void SetPrintMode(bool is_printing)

© 2002-2014 PDFTron Systems Inc.