fs_render.h
Go to the documentation of this file.
1 
15 #ifndef FS_RENDER_H_
16 #define FS_RENDER_H_
17 
18 #include "common/fs_common.h"
19 #include "common/fs_image.h"
20 #include "pdf/annots/fs_annot.h"
21 #include "pdf/fs_pdflayer.h"
22 #include "pdf/fs_pdfpage.h"
23 #include "pdf/fs_reflowpage.h"
24 #include "addon/xfa/fs_xfa.h"
25 
26 #ifdef __APPLE__
27 #include <CoreGraphics/CoreGraphics.h>
28 #endif
29 
34 namespace foxit {
38 namespace common {
65 class Renderer FS_FINAL : public Base {
66  public:
72  typedef enum _ColorMode {
77  } ColorMode;
78 
84  typedef enum _ContentFlag {
86  e_RenderPage = 0x01,
89  } ContentFlag;
90 
91  #ifdef __APPLE__
92 
97  typedef enum _DeviceType {
102  }DeviceType;
103  #endif
104 
117  Renderer(const Bitmap& bitmap, bool is_rgb_order);
118 
119 #if (defined(_WIN32) || defined(_WIN64)) && (!defined(SWIG) || defined(_SWIG_DOTNET_))
120 
127  explicit Renderer(HDC dc);
128 #endif
129 
130 #ifdef __APPLE__
131 
141  Renderer(const CGContextRef& context, DeviceType device_type);
142 #endif
143 
148  Renderer(const Renderer& other);
150  ~Renderer();
151 
159  Renderer& operator = (const Renderer& other);
167  bool operator == (const Renderer& other) const;
175  bool operator != (const Renderer& other) const;
176 
184  bool IsEmpty() const;
185 
209  Progressive StartQuickRender(const pdf::PDFPage& page, const Matrix& matrix, PauseCallback* pause = NULL);
210 
241  Progressive StartRender(const pdf::PDFPage& page, const Matrix& matrix, PauseCallback* pause = NULL);
242 
261  Progressive StartRenderReflowPage(const pdf::ReflowPage& reflow_page, const Matrix& matrix,
262  PauseCallback* pause = NULL);
263 
284  Progressive StartRenderXFAPage(const addon::xfa::XFAPage& xfa_page_view, const Matrix& matrix, bool is_highlight,
285  PauseCallback* pause = NULL);
311  Progressive StartRenderBitmap(const Bitmap& bitmap, const Matrix& matrix,
312  const RectI* clip_rect = NULL, uint32 interpolation = 0,
313  PauseCallback* pause = NULL);
314 
328  bool RenderAnnot(const pdf::annots::Annot& annot, const Matrix& matrix);
329 
338  void SetClipRect(const RectI* clip_rect);
339 
350  void SetClipPathFill(const Path& clip_path, const Matrix& matrix, foxit::common::FillMode fill_mode);
351 
361  void SetClipPathStroke(const Path& clip_path, const Matrix& matrix, const GraphState* graph_state = NULL);
362 
375  void SetRenderContentFlags(uint32 render_content_flags);
376 
388  void SetTransformAnnotIcon(bool is_to_transform_annot_icon);
389 
401  void SetRenderFormField(bool is_render_formfield);
402 
413  void SetRenderSignature(bool is_render_signature);
414 
425  void SetLayerContext(const pdf::LayerContext& layer_context);
444  void SetColorMode(ColorMode color_mode);
453  void SetMappingModeColors(ARGB background_color, ARGB foreground_color);
454 
465  void SetClearType(bool is_clear_type);
478  void SetPrintTextAsGraphic(bool is_to_print_text_graphic);
479 
490  void SetPrintTextAsImage(bool is_to_print_text_image);
491 
502  void SetForceDownSample(bool is_to_force_down_sample);
503 
514  void SetForceHalftone(bool is_to_force_halftone);
515 
526  void SetRenderPathThinLine(bool is_render_path_thin_line);
527 
538  void SetRenderTextAntiAliasing(bool is_render_text_antialiasing);
539 
550  void SetRenderPathAntiAliasing(bool is_render_path_antialiasing);
551 
563  void SetRenderImageAntiAliasing(bool is_render_image_antialiasing);
564 
565  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
566  explicit Renderer(FS_HANDLE handle = NULL);
567 };
568 } // namespace common
569 } // namespace foxit
570 #endif // FS_RENDER_H_
571 
void SetRenderContentFlags(uint32 render_content_flags)
Set rendering flag to decide what content will be rendered.
Header file for PDF reflow page related definitions and classes.
Progressive StartRenderBitmap(const Bitmap &bitmap, const Matrix &matrix, const RectI *clip_rect=0, uint32 interpolation=0, PauseCallback *pause=0)
Start to render a bitmap.
Definition: fs_reflowpage.h:60
Renderer & operator=(const Renderer &other)
Assign operator.
Definition: fs_image.h:36
void SetRenderImageAntiAliasing(bool is_render_image_antialiasing)
Set the flag to decide whether to draw image anti-aliasing.
Progressive StartQuickRender(const pdf::PDFPage &page, const Matrix &matrix, PauseCallback *pause=0)
Start to quickly render a PDF page, mainly for thumbnail purpose.
Definition: fs_xfa.h:1126
void SetClipRect(const RectI *clip_rect)
Set the clipping rectangle which will be used in following rendering progress.
If set, page content will be rendered.
Definition: fs_render.h:86
void SetTransformAnnotIcon(bool is_to_transform_annot_icon)
Set the flag to decide whether to transform annotation icon or not when display.
~Renderer()
Destructor.
void SetRenderPathAntiAliasing(bool is_render_path_antialiasing)
Set the flag to decide whether to draw path anti-aliasing.
ColorMode
Enumeration for rendering color mode.
Definition: fs_render.h:72
bool IsEmpty() const
Check whether current object is empty or not.
Progressive StartRenderXFAPage(const addon::xfa::XFAPage &xfa_page_view, const Matrix &matrix, bool is_highlight, PauseCallback *pause=0)
Start to render an XFA page.
void SetRenderTextAntiAliasing(bool is_render_text_antialiasing)
Set the flag to decide whether to draw text anti-aliasing.
void SetForceHalftone(bool is_to_force_halftone)
Set the flag to decide whether to use halftone for image stretching.
DeviceType
Enumeration for rendering device type.
Definition: fs_render.h:97
Header file for PDF layer related definitions and classes.
Header file for image and bitmap related definitions and classes.
void SetColorMode(ColorMode color_mode)
Set color mode.
Definition: fs_render.h:65
void SetClipPathFill(const Path &clip_path, const Matrix &matrix, foxit::common::FillMode fill_mode)
Set clipping path using filled region.
uint32 ARGB
ARGB color type, 32 bits, ((b) | ((g) << 8) | ((r) << 16)) | ((a) << 24)
Definition: fs_basictypes.h:209
Progressive StartRenderReflowPage(const pdf::ReflowPage &reflow_page, const Matrix &matrix, PauseCallback *pause=0)
Start to render a reflow page.
void SetClearType(bool is_clear_type)
Set the flag to decide whether to use ClearType-like anti-aliasing to render text objects...
Header file for annotation related definitions and classes.
FillMode
Enumeration for filling mode type, mainly for path graphics object.
Definition: fs_common.h:251
Renderer(const Bitmap &bitmap, bool is_rgb_order)
Constructor, with bitmap.
void SetRenderPathThinLine(bool is_render_path_thin_line)
Set the flag to decide whether to draw path as thin line.
Definition: fx_basic.h:3566
Definition: fs_common.h:759
bool operator!=(const Renderer &other) const
Not equal operator.
Definition: fs_common.h:1453
void SetRenderFormField(bool is_render_formfield)
Set the flag to decide whether to render form fields (except signature fields).
Definition: fs_common.h:382
Map a color value to the color range defined by a background color and a foreground color...
Definition: fs_render.h:76
If set, annotations will be rendered.
Definition: fs_render.h:88
FX_UINT32 uint32
32-bit unsigned integer.
Definition: fs_basictypes.h:195
Definition: fs_pdfpage.h:306
void * FS_HANDLE
Handle type.
Definition: fs_basictypes.h:213
Header file for common definitions and classes.
Progressive StartRender(const pdf::PDFPage &page, const Matrix &matrix, PauseCallback *pause=0)
Start to render a PDF page.
Normal color mode.
Definition: fs_render.h:74
Definition: fx_coordinates.h:458
Definition: fs_basictypes.h:333
Definition: fs_pdflayer.h:245
void SetLayerContext(const pdf::LayerContext &layer_context)
Set layer context to render context handle.
void SetForceDownSample(bool is_to_force_down_sample)
Set the flag to decide whether to use down-sampling for image stretching.
Header file for XFA related definitions and functions.
bool RenderAnnot(const pdf::annots::Annot &annot, const Matrix &matrix)
Render a specified annotation.
Header file for PDF page related definitions and classes.
Definition: fs_annot.h:756
void SetRenderSignature(bool is_render_signature)
Set the flag to decide whether to render signatures or not.
Foxit namespace.
Definition: fs_connectedpdf.h:26
void SetPrintTextAsImage(bool is_to_print_text_image)
Set the flag to decide whether to print text as image.
ContentFlag
Enumeration for rendering content flags.
Definition: fs_render.h:84
void SetMappingModeColors(ARGB background_color, ARGB foreground_color)
Set background color and foreground color when color mode is Renderer::e_ColorModeMapping.
#define NULL
The null-pointer value.
Definition: fx_system.h:767
bool operator==(const Renderer &other) const
Equal operator.
Definition: fx_coordinates.h:914
Device type: display device.
Definition: fs_render.h:99
void SetPrintTextAsGraphic(bool is_to_print_text_graphic)
Set the flag to decide whether to print text as path or bitmap.
Device type: printer.
Definition: fs_render.h:101
void SetClipPathStroke(const Path &clip_path, const Matrix &matrix, const GraphState *graph_state=0)
Set clipping path using stroked region.

Foxit Software Corporation Logo
@2018 Foxit Software Incorporated. All rights reserved.