Foxit PDF SDK
fs_psi.h
浏览该文件的文档.
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 
199  void AddPoint(const PointF& point, common::Path::PointType type, float pressure);
200 
209 
216 
238  annots::PSInk ConvertToPDFAnnot(const PDFPage& page, const RectF& annot_rect, common::Rotation rotate);
239 
240  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
241  explicit PSI(FS_HANDLE handle = NULL);
242 
243 };
244 } // namespace pdf
245 } // namespace foxit
246 #endif // FS_PSI_H_
247 
bool operator !=(const PSI &other) const
不相等操作符。
~PSI()
析构函数。
Definition: fs_image.h:36
void AddPoint(const PointF &point, common::Path::PointType type, float pressure)
添加一个点。
void SetColor(RGB color)
设置墨水颜色。
uint32 RGB
RGB 颜色类型,24 位,((b) | ((g) << 8) | ((r) << 16)))
Definition: fs_basictypes.h:212
Definition: fx_coordinates.h:30
common::Bitmap GetBitmap()
获取画布位图。
void SetOpacity(float opacity)
设置墨水不透明度。
virtual void Release()=0
用于释放当前回调对象本身的回调函数。
void SetCallback(PSICallback *callback)
设置用于刷新的回调对象。
PSI & operator=(const PSI &other)
赋值操作符。
注释相关定义和类的头文件。
void SetDiameter(int diameter)
设置墨水直径。
Definition: fs_annot.h:4981
PSI(common::Bitmap &bitmap, bool simulate)
构造函数,使用位图作为画布。
bool IsEmpty() const
检查当前对象是否为空。
Definition: fs_pdfpage.h:421
void * FS_HANDLE
句柄类型。
Definition: fs_basictypes.h:214
通用定义和类的头文件。
Definition: fs_psi.h:73
RectF GetContentsRect()
获取内容矩形。
Definition: fs_psi.h:40
bool operator==(const PSI &other) const
相等操作符。
Definition: fs_basictypes.h:449
PDF页面相关定义和类的头文件。
Rotation
旋转的枚举。
Definition: fs_common.h:57
Foxit命名空间。
Definition: fs_taggedpdf.h:27
annots::PSInk ConvertToPDFAnnot(const PDFPage &page, const RectF &annot_rect, common::Rotation rotate)
将PSI对象转换为PSInk注释并将PSInk注释插入到PDF页面中。
#define NULL
空指针值。
Definition: fx_system.h:792
virtual void Refresh(PSI psi, const RectF &rect)=0
用于刷新PSI指定区域的回调函数。
PointType
路径中点类型枚举。
Definition: fs_common.h:2174
Definition: fx_coordinates.h:771