Foxit PDF SDK
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 
~PSI()
Destructor.
Definition: fs_image.h:36
void AddPoint(const PointF &point, common::Path::PointType type, float pressure)
Add a point.
void SetColor(RGB color)
Set ink color.
uint32 RGB
RGB color type, 24 bits, ((b) | ((g) << 8) | ((r) << 16)))
Definition: fs_basictypes.h:214
Definition: fx_coordinates.h:30
bool operator!=(const PSI &other) const
Not equal operator.
common::Bitmap GetBitmap()
Get the canvas bitmap.
void SetOpacity(float opacity)
Set ink opacity.
virtual void Release()=0
A callback function used to release current callback object itself.
void SetCallback(PSICallback *callback)
Set a callback object for refreshing.
PSI & operator=(const PSI &other)
Assign operator.
Header file for annotation related definitions and classes.
void SetDiameter(int diameter)
Set ink diameter.
Definition: fs_annot.h:4353
PSI(common::Bitmap &bitmap, bool simulate)
Constructor, with a bitmap as canvas.
bool IsEmpty() const
Check whether current object is empty or not.
Definition: fs_pdfpage.h:313
void * FS_HANDLE
Handle type.
Definition: fs_basictypes.h:216
Header file for common definitions and classes.
Definition: fs_psi.h:73
RectF GetContentsRect()
Get contents rectangle.
Definition: fs_psi.h:40
bool operator==(const PSI &other) const
Equal operator.
Definition: fs_basictypes.h:393
Header file for PDF page related definitions and classes.
Rotation
Enumeration for rotation.
Definition: fs_common.h:275
Foxit namespace.
Definition: fs_compare.h:27
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.
#define NULL
The null-pointer value.
Definition: fx_system.h:767
virtual void Refresh(PSI psi, const RectF &rect)=0
A callback function used to refresh a specified region for PSI.
PointType
Enumeration for point type in path.
Definition: fs_common.h:1886
Definition: fx_coordinates.h:769