My Project
fs_psi.h
Go to the documentation of this file.
1 
15 #ifndef FS_PSI_H_
16 #define FS_PSI_H_
17 
18 #include "common/fs_common.h"
19 #include "pdf/annots/fs_annot.h"
20 #include "pdf/fs_pdfpage.h"
21 
27 namespace foxit {
31 namespace pdf {
32 // forward declaration
33 class PSI;
34 
40 class PSICallback {
41  public:
47  virtual void Release() = 0;
56  virtual void Refresh(PSI psi, const RectF& rect) = 0;
57 
58  protected:
59  ~PSICallback() {}
60 };
61 
73 class PSI FS_FINAL : public Base {
74  public:
84  PSI(common::Bitmap& bitmap, bool simulate);
85 
95  PSI(int width, int height, bool simulate);
96 
102  PSI(const PSI& other);
110  PSI& operator = (const PSI& other);
111 
119  bool operator == (const PSI& other) const;
127  bool operator != (const PSI& other) const;
128 
136  bool IsEmpty() const;
138  ~PSI();
139 
149  void SetCallback(PSICallback* callback);
150 
161  void SetColor(RGB color);
162 
173  void SetDiameter(int diameter);
174 
186  void SetOpacity(float opacity);
187 
198  void AddPoint(const PointF& point, common::Path::PointType type, float pressure);
199 
208 
215 
237  annots::PSInk ConvertToPDFAnnot(const PDFPage& page, const RectF& annot_rect, common::Rotation rotate);
238 
239  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
240  explicit PSI(FS_HANDLE handle = NULL);
241 
242 };
243 } // namespace pdf
244 } // namespace foxit
245 #endif // FS_PSI_H_
246 
annots::PSInk ConvertToPDFAnnot(const PDFPage &page, const RectF &annot_rect, common::Rotation rotate)
Convert a PSI object to a PSInk annotation and insert the PSInk annotation to a PDF page.
common::Bitmap GetBitmap()
Get the canvas bitmap.
void * FS_HANDLE
Handle type.
Definition: fs_basictypes.h:216
PointType
Enumeration for point type in path.
Definition: fs_common.h:1474
PSI & operator=(const PSI &other)
Assign operator.
Header file for common definitions and classes.
void SetCallback(PSICallback *callback)
Set a callback object for refreshing.
bool operator==(const PSI &other) const
Equal operator.
void SetDiameter(int diameter)
Set ink diameter.
void AddPoint(const PointF &point, common::Path::PointType type, float pressure)
Add a point.
bool operator !=(const PSI &other) const
Not equal operator.
Definition: fx_coordinates.h:30
Rotation
Enumeration for rotation.
Definition: fs_common.h:221
Definition: fs_psi.h:73
Header file for PDF page related definitions and classes.
Foxit namespace.
Definition: fs_connectedpdf.h:26
virtual void Refresh(PSI psi, const RectF &rect)=0
A callback function used to refresh a specified region for PSI.
~PSI()
Destructor.
Definition: fs_annot.h:4059
Definition: fs_psi.h:40
#define NULL
The null-pointer value.
Definition: fx_system.h:773
void SetOpacity(float opacity)
Set ink opacity.
void SetColor(RGB color)
Set ink color.
Definition: fx_coordinates.h:763
uint32 RGB
RGB color type, 24 bits, ((b) | ((g) << 8) | ((r) << 16)))
Definition: fs_basictypes.h:214
Definition: fs_pdfpage.h:307
PSI(common::Bitmap &bitmap, bool simulate)
Constructor, with a bitmap as canvas.
RectF GetContentsRect()
Get contents rectangle.
Header file for annotation related definitions and classes.
Definition: fs_image.h:36
bool IsEmpty() const
Check whether current object is empty or not.
virtual void Release()=0
A callback function used to release current callback object itself.
Definition: fs_basictypes.h:342

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