Foxit PDF SDK
fs_ofdgraphicsobject.h
1 #ifndef FS_OFD_GRAPHICS_OBJECT_H_
2 #define FS_OFD_GRAPHICS_OBJECT_H_
3 
4 #include "common/fs_common.h"
5 #include "common/fs_image.h"
6 
12 namespace foxit {
16 namespace common {
17 class Image;
18 };
19 namespace ofd {
20 class Actions;
24 namespace graphics {
26 class BorderInfo FS_FINAL : public Object {
27  public:
33  typedef enum _LineCapMode {
46  } LineCapMode;
47 
48 
53  :line_width(0.0f)
55  ,color(0)
56  ,h_radius(0.0f)
57  ,v_radius(0.0f)
58  ,dash_offset(0.0f) {}
59 
75  color(color),
79  this->dash_pattern.Copy(dash_pattern);
80  }
81 
87  BorderInfo(const BorderInfo& other) {
88  this->line_width = other.line_width;
89  this->line_cap = other.line_cap;
90  this->color = other.color;
91  this->h_radius = other.h_radius;
92  this->v_radius = other.v_radius;
93  this->dash_offset = other.dash_offset;
94  this->dash_pattern.Copy(other.dash_pattern);
95  }
96 
105  this->line_width = other.line_width;
106  this->line_cap = other.line_cap;
107  this->color = other.color;
108  this->h_radius = other.h_radius;
109  this->v_radius = other.v_radius;
110  this->dash_offset = other.dash_offset;
111  this->dash_pattern.Copy(other.dash_pattern);
112  return *this;
113  }
114 
130  this->line_width = line_width;
131  this->line_cap = line_cap;
132  this->color = color;
133  this->h_radius = h_radius;
134  this->v_radius = v_radius;
135  this->dash_offset = dash_offset;
136  this->dash_pattern.Copy(dash_pattern);
137  }
138 
142  float line_width;
143 
149 
154 
158  float h_radius;
159 
163  float v_radius;
164 
168  float dash_offset;
169 
174 };
175 
177 class OFDGraphicsObject : public Base {
178  public:
184  typedef enum _ObjectType {
201  } ObjectType;
202 
208  typedef enum _LineCapMode {
221  } LineCapMode;
222 
228  typedef enum _LineJoinMode {
249  } LineJoinMode;
250 
251 
254 
260  OFDGraphicsObject(const OFDGraphicsObject& other);
261 
270 
278  bool operator == (const OFDGraphicsObject& other) const;
279 
287  bool operator != (const OFDGraphicsObject& other) const;
288 
296  bool IsEmpty() const;
297 
304 
312 
318  int GetPageIndex();
319 
325  String GetName();
326 
332  bool IsVisible();
333 
339  bool HasBorder();
340 
347 
354 
361 
368 
375 
382 
388  float GetLineWidth();
389 
397 
405 
411  float GetMiterLimit();
412 
418  float GetDashOffset();
419 
426 
434  void SetName(const String& name);
442  void SetVisible(bool visible);
443 
451  void SetBorderInfo(const BorderInfo& border_info);
452 
460  void SetBoundary(const RectF& boundary);
461 
469  void SetMatrix(const Matrix& mt);
470 
478  void SetAlpha(foxit::uint8 alpha);
479 
487  void SetFillColor(foxit::uint32 fill_color);
488 
496  void SetStrokeColor(foxit::uint32 stroke_color);
497 
505  void SetLineWidth(float line_width);
506 
515  void SetLineCap(LineCapMode line_cap = e_LineCapButt);
516 
525  void SetLineJoin(LineJoinMode line_join = e_LineJoinMiter);
526 
534  void SetMiterLimit(float miter_limit);
535 
543  void SetDashOffset(float dash_offset);
544 
553  void SetDashPattern(float dash_offset, const foxit::FloatArray& dash_offset_array);
554 
561 
568 
569  explicit OFDGraphicsObject(FS_HANDLE handle);
570 };
571 
572 } // namespace graphics
573 } // namespace ofd
574 } // namespace foxit
575 
576 #endif // FS_OFD_OBJECT_H_
投影方形端盖。描边在路径端点之外继续延伸等于线宽一半的距离,并被切断。
Definition: fs_ofdgraphicsobject.h:45
void SetLineCap(LineCapMode line_cap=e_LineCapButt)
设置图元对象线帽样式。
BorderInfo & operator=(const BorderInfo &other)
赋值操作符。
Definition: fs_ofdgraphicsobject.h:104
foxit::Matrix GetMatrix()
获取图元对象矩阵。
void SetStrokeColor(foxit::uint32 stroke_color)
设置图元对象勾边颜色。
void SetVisible(bool visible)
设置图元对象可见性属性。
float h_radius
横向圆角半径。
Definition: fs_ofdgraphicsobject.h:158
void Set(float line_width, LineCapMode line_cap, foxit::RGB color, float h_radius, float v_radius, float dash_offset, foxit::FloatArray dash_pattern)
设置值。
Definition: fs_ofdgraphicsobject.h:129
CFX_Object Object
对象类型。
Definition: fs_basictypes.h:220
Definition: fs_ofdgraphicsobject.h:177
void SetDashPattern(float dash_offset, const foxit::FloatArray &dash_offset_array)
设置图元对象虚线重复样式。
foxit::uint8 GetAlpha()
获取图元对象alpha属性。
String GetName()
获取图元对象名称。
ObjectType
OFD图元对象类型定义枚举类型.
Definition: fs_ofdgraphicsobject.h:184
FX_UINT8 uint8
无符号 8 位整数。
Definition: fs_basictypes.h:203
uint32 RGB
RGB 颜色类型,24 位,((b) | ((g) << 8) | ((r) << 16)))
Definition: fs_basictypes.h:211
对象类型:矢量图形。
Definition: fs_ofdgraphicsobject.h:192
bool IsVisible()
获取图元对象可见性属性。
void SetFillColor(foxit::uint32 fill_color)
设置图元对象填充颜色。
bool operator==(const OFDGraphicsObject &other) const
相等操作符。
对象类型:未知
Definition: fs_ofdgraphicsobject.h:186
foxit::RectF GetBoundary()
获取图元对象矩形外接框。
BorderInfo(const BorderInfo &other)
构造函数,通过另一个边框信息对象。
Definition: fs_ofdgraphicsobject.h:87
BorderInfo GetBorderInfo()
获取图元对象边框信息(只有Image和Video对象可能会存在边框)。
平头端盖。描边在路径的端点处被切断。路径末端之外没有投影。
Definition: fs_ofdgraphicsobject.h:212
FX_BOOL Copy(const CFX_ArrayTemplate &src)
从数组复制。
Definition: fx_basic.h:1479
foxit::FloatArray GetDashPattern()
获取图元对象虚线重复样式数组。
图像和位图相关定义和类的头文件。
foxit::RGB GetFillColor()
获取图元对象填充颜色。
void SetDashOffset(float dash_offset)
设置图元对象虚线重复样式起始值。
bool operator !=(const OFDGraphicsObject &other) const
不相等操作符。
float GetMiterLimit()
获取图元对象斜切限制值。
BorderInfo(float line_width, LineCapMode line_cap, foxit::RGB color, float h_radius, float v_radius, float dash_offset, foxit::FloatArray dash_pattern)
带参数的构造函数。
Definition: fs_ofdgraphicsobject.h:72
LineCapMode line_cap
线端点样式。请参考从 foxit::ofd::graphics::BorderInfo::e_LineCapButt 开始的值, 应该是这些值中的一个。
Definition: fs_ofdgraphicsobject.h:148
斜接线条连接类型。
Definition: fs_ofdgraphicsobject.h:234
对象类型:路径。
Definition: fs_ofdgraphicsobject.h:196
foxit::uint32 GetID()
获取图元对象资源ID。
Actions GetActions()
获取图元对象的动作集合。
BorderInfo()
构造函数。
Definition: fs_ofdgraphicsobject.h:52
float GetDashOffset()
获取图元对象虚线重复样式。
int GetPageIndex()
获取图元对象所在页面的索引号。
对象类型:视频。
Definition: fs_ofdgraphicsobject.h:200
foxit::RGB GetStrokeColor()
获取图元对象勾边颜色。
Definition: fs_ofdaction.h:679
void SetLineJoin(LineJoinMode line_join=e_LineJoinMiter)
设置线条连接样式。
LineCapMode GetLineCap()
获取图元对象线帽样式。
bool IsEmpty() const
检查当前对象是否为空。
void SetBorderInfo(const BorderInfo &border_info)
设置图元对象边框信息。
圆角线条连接类型。
Definition: fs_ofdgraphicsobject.h:241
FX_UINT32 uint32
无符号 32 位整数。
Definition: fs_basictypes.h:195
对象类型:文字。
Definition: fs_ofdgraphicsobject.h:194
void SetAlpha(foxit::uint8 alpha)
设置图元对象alpha属性。
void SetName(const String &name)
设置图元对象名称。
void * FS_HANDLE
句柄类型。
Definition: fs_basictypes.h:213
Definition: fs_ofdgraphicsobject.h:26
通用定义和类的头文件。
LineJoinMode GetLineJoin()
获取线条连接样式。
bool HasBorder()
判断图元对象是否有边框。
平头端盖。描边在路径的端点处被切断。路径末端之外没有投影。
Definition: fs_ofdgraphicsobject.h:37
LineCapMode
OFD线端点样式枚举。
Definition: fs_ofdgraphicsobject.h:208
void SetMiterLimit(float miter_limit)
设置图元对象斜切限制值。
斜角线条连接类型。
Definition: fs_ofdgraphicsobject.h:248
OFDGraphicsObject & operator=(const OFDGraphicsObject &other)
赋值操作符。
float dash_offset
虚线偏移量。
Definition: fs_ofdgraphicsobject.h:168
float v_radius
纵向圆角半径。
Definition: fs_ofdgraphicsobject.h:163
Definition: fs_basictypes.h:465
foxit::RGB color
边框颜色。
Definition: fs_ofdgraphicsobject.h:153
float GetLineWidth()
获取图元对象线宽。
投影方形端盖。描边在路径端点之外继续延伸等于线宽一半的距离,并被切断。
Definition: fs_ofdgraphicsobject.h:220
Actions CreateActions()
创建图元对象动作集合对象。
圆头端盖。在端点周围绘制一个直径等于线宽的半圆弧并填充。
Definition: fs_ofdgraphicsobject.h:41
LineJoinMode
OFD线条连接样式枚举。
Definition: fs_ofdgraphicsobject.h:228
ObjectType GetType()
获取图元对象类型。
对象类型:图像。
Definition: fs_ofdgraphicsobject.h:198
void SetMatrix(const Matrix &mt)
设置图元对象矩阵。
对象类型:组合。
Definition: fs_ofdgraphicsobject.h:190
对象类型:页面块。
Definition: fs_ofdgraphicsobject.h:188
Foxit命名空间。
Definition: fs_pdf3d.h:26
OFDGraphicsObject(const OFDGraphicsObject &other)
构造函数,通过另一个OFD图元对象。
字节字符串类
Definition: fx_string.h:317
void SetBoundary(const RectF &boundary)
设置图元对象矩形外接框。
圆头端盖。在端点周围绘制一个直径等于线宽的半圆弧并填充。
Definition: fs_ofdgraphicsobject.h:216
float line_width
边框宽度,以点为单位。这应该是一个非负值。
Definition: fs_ofdgraphicsobject.h:142
foxit::FloatArray dash_pattern
虚线模式数组。
Definition: fs_ofdgraphicsobject.h:173
LineCapMode
OFD线端点样式枚举。
Definition: fs_ofdgraphicsobject.h:33
Definition: fx_coordinates.h:1076
void SetLineWidth(float line_width)
设置图元对象线宽。
Definition: fx_coordinates.h:771