My Project
|
Public Types | |
enum | BlendMode { e_BlendNormal = 0, e_BlendMultiply = 1, e_BlendScreen = 2, e_BlendOverlay = 3, e_BlendDarken = 4, e_BlendLighten = 5, e_BlendColorDodge = 6, e_BlendColorBurn = 7, e_BlendHardlight = 8, e_BlendSoftlight = 9, e_BlendDifference = 10, e_BlendExclusion = 11, e_BlendHue = 21, e_BlendSaturation = 22, e_BlendColor = 23, e_BlendLuminosity = 24 } |
Enumeration for render blend mode. More... | |
enum | Type { e_TypeAll = 0, e_TypeText = 1, e_TypePath = 2, e_TypeImage = 3, e_TypeShading = 4, e_TypeFormXObject = 5 } |
Enumeration for PDF graphics object type. More... | |
Public Member Functions | |
bool | AddClipPath (const common::Path &path, common::FillMode fill_mode) |
Add a path for clipping. More... | |
bool | AddClipTextObject (TextObject *textobject) |
Add text object for clipping. More... | |
bool | ClearClips () |
Clear all clips. More... | |
GraphicsObject * | Clone () |
Clone a new graphics object. More... | |
BlendMode | GetBlendMode () const |
Get the blend mode for transparent imaging model. More... | |
common::Path | GetClipPath (int index) const |
Get a path clip by index. More... | |
int | GetClipPathCount () const |
Get the count of path clip. More... | |
common::FillMode | GetClipPathFillMode (int index) const |
Get the fill mode of a path clip by index. More... | |
RectF | GetClipRect () const |
Get clip rectangle. More... | |
TextObject * | GetClipTextObject (int index) const |
Get the text object of a text clip by index. More... | |
int | GetClipTextObjectCount () const |
Get the count of text clip. More... | |
ARGB | GetFillColor () const |
Get the fill color. More... | |
FormXObject * | GetFormXObject () const |
Get the form XObject graphics object if current graphics object represents a form XObject object. More... | |
common::GraphState | GetGraphState () const |
Get graph state. More... | |
ImageObject * | GetImageObject () const |
Get the image graphics object if current graphics object represents an image object. More... | |
LayerNodeArray | GetLayers (const LayerTree &layer_tree) |
Get all the layers which are associated with current graphics object. More... | |
MarkedContent * | GetMarkedContent () const |
Get marked content object. More... | |
Matrix | GetMatrix () const |
Get matrix. More... | |
PathObject * | GetPathObject () const |
Get the path graphics object if current graphics object represents a path object. More... | |
RectF | GetRect () const |
Get the rectangle of current graphics object. More... | |
ShadingObject * | GetShadingObject () const |
Get the shading graphics object if current graphics object represents a shading object. More... | |
ARGB | GetStrokeColor () const |
Get the stroke color. More... | |
TextObject * | GetTextObject () const |
Get the text graphics object if current graphics object represents a text object. More... | |
Type | GetType () const |
Get the type of current graphics object. More... | |
bool | HasTransparency () |
Check whether current graphics object has transparency or not. More... | |
void | Release () |
Release a cloned or newly created PDF graphics object which has not been inserted into any PDF page or other object. More... | |
bool | RemoveClipPath (int index) |
Remove a path clip by index. More... | |
bool | RemoveClipTextObject (int index) |
Remove a text clip by index for clipping. More... | |
void | SetBlendMode (BlendMode blend_mode) |
Set the blend mode for transparent imaging model. More... | |
void | SetClipRect (const RectF &clip_rect) |
Set clip rectangle. More... | |
void | SetFillColor (ARGB color) |
Set the fill color. More... | |
void | SetGraphState (const common::GraphState &graph_state) |
Set graph state. More... | |
void | SetMatrix (const Matrix &matrix) |
Set matrix. More... | |
void | SetStrokeColor (ARGB color) |
Set the stroke color. More... | |
bool | Transform (const Matrix &matrix, bool need_transform_clippath) |
Transform current graphics object. More... | |
Content of a PDF page usually consists of a sequence of graphics objects. Each graphics object contains its state information, data and instructions for rendering.
Class GraphicsObject is the base class for all types of PDF graphics objects. It offers the base functions to get/set graphics object's common properties. For concrete graphics object types, please refer to derived classes.
To get or insert/remove a graphics object, please refer to class pdf::GraphicsObjects.
If any change is done to a PDF graphics object, please remember to call function GraphicsObjects::GenerateContent for pdf::GraphicsObjects object (to which current graphics object belongs). Please refer to comment of function GraphicsObjects::GenerateContent for more details.
Enumeration for render blend mode.
Values of this enumeration should be used alone.
Enumeration for PDF graphics object type.
Values of this enumeration should be used alone.
bool foxit::pdf::graphics::GraphicsObject::AddClipPath | ( | const common::Path & | path, |
common::FillMode | fill_mode | ||
) |
Add a path for clipping.
[in] | path | Path data to be added to current graphics object. |
[in] | fill_mode | Fill mode for the input path. Please refer to values starting from common::e_FillModeNone and this should be one of these values. |
bool foxit::pdf::graphics::GraphicsObject::AddClipTextObject | ( | TextObject * | textobject | ) |
Add text object for clipping.
[in] | textobject | Text object to be added for clipping. |
bool foxit::pdf::graphics::GraphicsObject::ClearClips | ( | ) |
Clear all clips.
GraphicsObject* foxit::pdf::graphics::GraphicsObject::Clone | ( | ) |
Clone a new graphics object.
Newly cloned graphics object is related to the same page with current graphics object by default. Newly cloned graphics object can only be used inside the PDF file which contains current graphics object.
BlendMode foxit::pdf::graphics::GraphicsObject::GetBlendMode | ( | ) | const |
Get the blend mode for transparent imaging model.
common::Path foxit::pdf::graphics::GraphicsObject::GetClipPath | ( | int | index | ) | const |
Get a path clip by index.
[in] | index | Path clip index. Valid range: from 0 to (count-1). count is returned by function GraphicsObject::GetClipPath. |
int foxit::pdf::graphics::GraphicsObject::GetClipPathCount | ( | ) | const |
Get the count of path clip.
common::FillMode foxit::pdf::graphics::GraphicsObject::GetClipPathFillMode | ( | int | index | ) | const |
Get the fill mode of a path clip by index.
[in] | index | Path clip index. Valid range: from 0 to (count-1). count is returned by function GraphicsObject::GetClipPath. |
RectF foxit::pdf::graphics::GraphicsObject::GetClipRect | ( | ) | const |
Get clip rectangle.
TextObject* foxit::pdf::graphics::GraphicsObject::GetClipTextObject | ( | int | index | ) | const |
Get the text object of a text clip by index.
[in] | index | Text clip index. Valid range: from 0 to (count-1). count is returned by function GraphicsObject::GetClipTextObjectCount. |
int foxit::pdf::graphics::GraphicsObject::GetClipTextObjectCount | ( | ) | const |
Get the count of text clip.
ARGB foxit::pdf::graphics::GraphicsObject::GetFillColor | ( | ) | const |
Get the fill color.
Text graphics object, path graphics object, and form XObject graphics object can have this property.
FormXObject* foxit::pdf::graphics::GraphicsObject::GetFormXObject | ( | ) | const |
Get the form XObject graphics object if current graphics object represents a form XObject object.
common::GraphState foxit::pdf::graphics::GraphicsObject::GetGraphState | ( | ) | const |
Get graph state.
Form XObjet graphics object, path graphics object and text graphics object can have this property.
ImageObject* foxit::pdf::graphics::GraphicsObject::GetImageObject | ( | ) | const |
Get the image graphics object if current graphics object represents an image object.
LayerNodeArray foxit::pdf::graphics::GraphicsObject::GetLayers | ( | const LayerTree & | layer_tree | ) |
Get all the layers which are associated with current graphics object.
[in] | layer_tree | A valid layer tree. All the layer nodes in this layer tree will be enumerated\ in order to find which are associated with current graphics object. |
MarkedContent* foxit::pdf::graphics::GraphicsObject::GetMarkedContent | ( | ) | const |
Get marked content object.
Matrix foxit::pdf::graphics::GraphicsObject::GetMatrix | ( | ) | const |
Get matrix.
PathObject* foxit::pdf::graphics::GraphicsObject::GetPathObject | ( | ) | const |
Get the path graphics object if current graphics object represents a path object.
RectF foxit::pdf::graphics::GraphicsObject::GetRect | ( | ) | const |
Get the rectangle of current graphics object.
ShadingObject* foxit::pdf::graphics::GraphicsObject::GetShadingObject | ( | ) | const |
Get the shading graphics object if current graphics object represents a shading object.
ARGB foxit::pdf::graphics::GraphicsObject::GetStrokeColor | ( | ) | const |
Get the stroke color.
Text graphics object, path graphics object, and form XObject graphics object can have this property.
TextObject* foxit::pdf::graphics::GraphicsObject::GetTextObject | ( | ) | const |
Get the text graphics object if current graphics object represents a text object.
Type foxit::pdf::graphics::GraphicsObject::GetType | ( | ) | const |
Get the type of current graphics object.
bool foxit::pdf::graphics::GraphicsObject::HasTransparency | ( | ) |
Check whether current graphics object has transparency or not.
void foxit::pdf::graphics::GraphicsObject::Release | ( | ) |
Release a cloned or newly created PDF graphics object which has not been inserted into any PDF page or other object.
bool foxit::pdf::graphics::GraphicsObject::RemoveClipPath | ( | int | index | ) |
Remove a path clip by index.
[in] | index | Path clip index. Valid range: from 0 to (count-1). count is returned by function GraphicsObject::GetClipPath. |
bool foxit::pdf::graphics::GraphicsObject::RemoveClipTextObject | ( | int | index | ) |
Remove a text clip by index for clipping.
[in] | index | Text clip index. Valid range: from 0 to (count-1). count is returned by function GraphicsObject::GetClipTextObjectCount. |
void foxit::pdf::graphics::GraphicsObject::SetBlendMode | ( | BlendMode | blend_mode | ) |
Set the blend mode for transparent imaging model.
[in] | blend_mode | New blend mode. Please refer to values starting from GraphicsObject::e_BlendNormal and this should be one of these values. |
void foxit::pdf::graphics::GraphicsObject::SetClipRect | ( | const RectF & | clip_rect | ) |
Set clip rectangle.
New clip rectangle will be set with fill mode common::e_FillModeWinding by default.
[in] | clip_rect | New clip rectangle. |
void foxit::pdf::graphics::GraphicsObject::SetFillColor | ( | ARGB | color | ) |
Set the fill color.
Text graphics object, path graphics object, and form XObject graphics object can have this property. If try to set fill color for rest unsupported types, foxit::e_ErrUnsupported will be thrown.
[in] | color | New color value, in format 0xAARRGGBB. |
void foxit::pdf::graphics::GraphicsObject::SetGraphState | ( | const common::GraphState & | graph_state | ) |
Set graph state.
Form XObjet graphics object, path graphics object and text graphics object can have this property. If try to set graph state to rest unsupported types, exception foxit::e_ErrUnsupported will be thrown.
[in] | graph_state | New graph state. |
void foxit::pdf::graphics::GraphicsObject::SetMatrix | ( | const Matrix & | matrix | ) |
Set matrix.
[in] | matrix | New matrix value. |
void foxit::pdf::graphics::GraphicsObject::SetStrokeColor | ( | ARGB | color | ) |
Set the stroke color.
Text graphics object, path graphics object, and form XObject graphics object can have this property. If current graphics object is a text graphics object and the text mode is TextState::e_ModeFill, the stroke color will not have effect on the text graphics object.
If try to set stroke color for rest unsupported types, exception foxit::e_ErrUnsupported will be thrown.
[in] | color | New color value, in format 0xAARRGGBB. |
bool foxit::pdf::graphics::GraphicsObject::Transform | ( | const Matrix & | matrix, |
bool | need_transform_clippath | ||
) |
Transform current graphics object.
[in] | matrix | Transform matrix. |
[in] | need_transform_clippath | true means to transform clip path with current graphics object. false means to transform current graphics object only. |