Loading...
Searching...
No Matches
PDFRasterizer.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_CPPPDFRasterizer
6#define PDFTRON_H_CPPPDFRasterizer
7
8#include <PDF/Page.h>
9#include <C/PDF/TRN_PDFRasterizer.h>
10#include <PDF/OCG/Context.h>
11#ifdef SWIG
12#include <PDF/Callback.h>
13#endif
14#include <C/Common/TRN_Types.h>
15
16namespace pdftron {
17 namespace PDF {
18
37
38class PDFDoc;
44typedef void (*DownloadReportHandler) (DownloadedType type, PDFDoc* doc, int page_num, int obj_num, const char* message, void* data);
45
49class Separation : public TRN_separation
50{
51public:
56 UInt8 C() const;
57 UInt8 M() const;
58 UInt8 Y() const;
59 UInt8 K() const;
62#ifdef SWIG
63 std::vector<unsigned char> GetData() const;
64#else
65 const UChar* GetData() const;
66#endif
67
69
70private:
71 bool m_owner;
72};
73
86{
87public:
88
107
119
125
179#ifndef SWIG
180 std::vector<unsigned char> Rasterize(Page& page,
181 int width, int height, int stride,
182 int num_comps, bool demult,
183 const Common::Matrix2D& device_mtx,
184 const Rect* clip = 0,
185 const Rect* scrl_clip_regions = 0,
186 bool* cancel = 0);
187
188 void Rasterize(Page& page, UChar* in_out_image_buffer,
189 int width, int height, int stride,
190 int num_comps, bool demult,
191 const Common::Matrix2D& device_mtx,
192 const Rect* clip = 0,
193 const Rect* scrl_clip_regions = 0,
194 bool* cancel = 0);
195#else // SWIG
196 std::vector<unsigned char> Rasterize(
197 Page& page,
198 int width,
199 int height,
200 int stride,
201 int num_comps,
202 bool demult,
203 const Common::Matrix2D& device_mtx,
204 const Rect* clip = 0,
205 const Rect* scrl_clip_regions = 0
206 );
207#endif // SWIG
208
225 std::vector<Separation> RasterizeSeparations(
226 Page& page,
227 int width,
228 int height,
229 const Common::Matrix2D& mtx,
230 const Rect* clip,
231 volatile bool* cancel
232 );
233
234#ifdef _WIN32
264 void Rasterize(Page& page, void* hdc,
265 const Common::Matrix2D& device_mtx,
266 const Rect* clip = 0,
267 int dpi = -1,
268 bool* cancel = 0);
269#endif
276 void SetDrawAnnotations(bool render_annots);
277
283 void SetHighlightFields(bool highlight_fields);
284
290 void SetDrawUIElements(bool draw_ui_elements);
291
301 void SetAntiAliasing(bool enable_aa);
302
311 void SetPathHinting(bool enable_hinting);
312
323 void SetThinLineAdjustment(bool pixel_grid_fit, bool stroke_adjust);
324
334 void SetThinLineScaling(double scaling);
335
345 void SetNightModeTuning(double contrast, double saturation, double flipness);
346
361 void SetImageSmoothing(bool smoothing_enabled = true, bool hq_image_resampling = false);
362
369 void SetCaching(bool enabled = true);
370
383 void SetGamma(double expgamma);
384
395
405 void SetPrintMode(bool is_printing);
406
417
423 typedef void (*ErrorReportProc) (const char* message, void* data);
424
432#ifdef SWIG
433 void SetErrorReportProc(Callback* instance);
434#else
435 void SetErrorReportProc(ErrorReportProc error_proc, void* data);
436#endif
437
450
457
468
479
484
491
495 void Destroy();
496
497// @cond PRIVATE_DOC
498#ifndef SWIGHIDDEN
499 TRN_PDFRasterizer mp_rast;
500private:
502 PDFRasterizer& operator= (const PDFRasterizer&);
503#endif
504// @endcond
505};
506
507
508
509#include <Impl/PDFRasterizer.inl>
510
511
512 }; // namespace PDF
513}; // namespace pdftron
514
515#endif // PDFTRON_H_CPPPDFRasterizer
void Rasterize(Page &page, UChar *in_out_image_buffer, 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 SetColorPostProcessMode(ColorPostProcessMode mode)
void SetPathHinting(bool enable_hinting)
void SetRasterizerType(Type type)
void SetGamma(double expgamma)
void SetOCGContext(OCG::Context *ctx)
void SetThinLineScaling(double scaling)
void SetNightModeTuning(double contrast, double saturation, double flipness)
@ e_GDIPlus
GDI+ based rasterizer. (Deprecated)
@ e_BuiltIn
high-quality, platform independent rasterizer.
std::vector< Separation > RasterizeSeparations(Page &page, int width, int height, const Common::Matrix2D &mtx, const Rect *clip, volatile bool *cancel)
void SetDrawAnnotations(bool render_annots)
void SetCaching(bool enabled=true)
void SetAntiAliasing(bool enable_aa)
void SetPrintMode(bool is_printing)
void SetThinLineAdjustment(bool pixel_grid_fit, bool stroke_adjust)
void SetHighlightFields(bool highlight_fields)
void SetDrawUIElements(bool draw_ui_elements)
PDFRasterizer(Type type=e_BuiltIn)
void(* ErrorReportProc)(const char *message, void *data)
void SetErrorReportProc(ErrorReportProc error_proc, void *data)
void SetOverprint(OverprintPreviewMode op)
void SetImageSmoothing(bool smoothing_enabled=true, bool hq_image_resampling=false)
ColorPostProcessMode GetColorPostProcessMode() const
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)
Separation(const Separation &)
UInt32 GetDataSize() const
UString GetSeparationName() const
const UChar * GetData() const
Separation & operator=(const Separation &)
void(* DownloadReportHandler)(DownloadedType type, PDFDoc *doc, int page_num, int obj_num, const char *message, void *data)
@ e_downloadedtype_named_dests
@ e_downloadedtype_finished
TRN_UInt32 UInt32
Definition BasicTypes.h:13
TRN_UInt8 UInt8
Definition BasicTypes.h:15
TRN_UChar UChar
Definition BasicTypes.h:12