Foxit PDF SDK

Instance Methods | Class Methods | List of all members
FSImageObject Class Reference
Inheritance diagram for FSImageObject:

## Instance Methods
(FSBitmap *) | - cloneBitmap:
(FSBitmap *) | - cloneBitmapWithPage:graphics_objects:
| Clone the bitmap from current image graphics object. More...
(FSColorSpaceType) | - getColorSpace
| Get color space. More...
(FSPDFObject *) | - getMask
| Get the PDF object that represents the mask of current image graphics object. More...
(FSPDFStream *) | - getStream
| Get image stream. More...
(BOOL) | - isImageMask
| Check if current image object is treated as mask. More...
(void) | - setBitmap:mask:
| Set a bitmap to current image graphics object. More...
(void) | - setImage:frame_index:
| Set one frame of an image to current image graphics object. More...
Instance Methods inherited from FSGraphicsObject
(BOOL) | - addClipPath:fill_mode:
| Add a path for clipping. More...
(BOOL) | - addClipTextObject:
| Add text object for clipping. More...
(BOOL) | - clearClips
| Clear all clips. More...
(FSGraphicsObject *) | - clone
| Clone a new graphics object. More...
(FSGraphicsObject *) | - cloneWithSrcGraphicsobjects:dest_graphicsobjects:
| Clone a new graphics object. More...
(FSPath *) | - getClipPath:
| Get a path clip by index. More...
(int) | - getClipPathCount
| Get the count of path clip. More...
(FSFillMode) | - getClipPathFillMode:
| Get the fill mode of a path clip by index. More...
(FSTextObject *) | - getClipTextObject:
| Get the text object of a text clip by index. More...
(int) | - getClipTextObjectCount
| Get the count of text clip. More...
(FSFormXObject *) | - getFormXObject
| Get the form XObject graphics object if current graphics object represents a form XObject object. More...
(FSImageObject *) | - getImageObject
| Get the image graphics object if current graphics object represents an image object. More...
(FSLayerNodeArray *) | - getLayers:
| Get all the layers which are associated with current graphics object. More...
(FSMarkedContent *) | - getMarkedContent
| Get marked content object. More...
(FSPathObject *) | - getPathObject
| Get the path graphics object if current graphics object represents a path object. More...
(FSRectF *) | - getRect
| Get the rectangle of current graphics object. More...
(FSShadingObject *) | - getShadingObject
| Get the shading graphics object if current graphics object represents a shading object. More...
(FSTextObject *) | - getTextObject
| Get the text graphics object if current graphics object represents a text object. More...
(FSGraphicsObjectType) | - getType
| Get the type of current graphics object. More...
(BOOL) | - hasTransparency
| Check whether current graphics object has transparency or not. More...
(BOOL) | - removeClipPath:
| Remove a path clip by index. More...
(BOOL) | - removeClipTextObject:
| Remove a text clip by index for clipping. More...
(void) | - rotate:
| Rotate current graphics object from current state with specified angle degree in clockwise. More...
(BOOL) | - transform:need_transform_clippath:
| Transform current graphics object. More...

## Class Methods
(FSImageObject *) | + create:
| Create a new image graphics object. More...
(FSImageObject *) | + createFromType3TextObject:text_obj:
| Create an image graphics object from a type3 text object. More...

## Additional Inherited Members
Properties inherited from FSGraphicsObject
FSGraphicsObjectBlendMode | blendMode
| Get or Set the blend mode for transparent imaging model.
FSRectF * | clipRect
| Get or Set clip rectangle.
FSColorState * | colorState
| Get or Set color state. More...
unsigned int | fillColor
| Get or Set the fill color. More...
float | fillOpacity
| Get or Set the opacity value for painting operations other than stroking.
FSGraphState * | graphState
| Get or Set graph state. More...
FSMatrix2D * | matrix
| Get or Set matrix.
unsigned int | strokeColor
| Get or Set the stroke color. More...
float | strokeOpacity
| Get or Set opacity value for stroke painting operations for paths and glyph outlines.

## Detailed Description

Image graphics object is a kind of PDF graphics object, so class FSImageObject is derived from class FSGraphicsObject . It offers functions to get/set image graphics object's data.
To create a new image graphics object, please use function FSImageObject::create: and then use setting functions to set information to the new image graphics object.

See also
  FSGraphicsObject

## Method Documentation

## ◆ cloneBitmap:()

- (FSBitmap *) cloneBitmap: |  | (FSGraphicsObjects*) | graphics_objects |

Deprecated:
  This function is deprecated. Use function FSImageObject::cloneBitmap: with two parameters instead.

Currently, the bitmap can be cloned from image graphics object only when the bitmap format is one of following formats:
FSBitmapDIB8bppMask, FSBitmapDIB8bpp, FSBitmapDIBRgb, FSBitmapDIBRgb32, FSBitmapDIBArgb, FSBitmapDIBCmyk.
If the return value of function FSBitmap::isEmpty for the returned bitmap object is YES, that means the DIB format of the bitmap is unsupported.

Parameters

  [in] | graphics_objects | A valid FSGraphicsObjects object. Please ensure that current image graphics object just belongs to this FSGraphicsObjects object (it may be a PDF page).

Returns
  The new cloned bitmap object. If the return value of function FSBitmap::isEmpty for the returned bitmap object is YES, that means the DIB format of the bitmap is unsupported.

## ◆ cloneBitmapWithPage:graphics_objects:()

- (FSBitmap *) cloneBitmapWithPage: |  | (FSPDFPage*) | page
graphics_objects: |  | (FSGraphicsObjects*) | graphics_objects

Clone the bitmap from current image graphics object.

Currently, the bitmap can be cloned from image graphics object only when the bitmap format is one of following formats:
FSBitmapDIB8bppMask, FSBitmapDIB8bpp, FSBitmapDIBRgb, FSBitmapDIBRgb32, FSBitmapDIBArgb, FSBitmapDIBCmyk.
If the return value of function FSBitmap::isEmpty for the returned bitmap object is YES, that means the DIB format of the bitmap is unsupported.

Parameters

  [in] | page | A valid PDF page object. Please ensure that current image graphics object just belongs to this page.
  [in] | graphics_objects | A valid FSGraphicsObjects object. Please ensure that current image graphics object just belongs to this FSGraphicsObjects object (it may be a PDF page).

Returns
  The new cloned bitmap object. If the return value of function FSBitmap::isEmpty for the returned bitmap object is YES, that means the DIB format of the bitmap is unsupported.

## ◆ create:()

+ (FSImageObject *) create: |  | (FSPDFDoc*) | document |

Create a new image graphics object.

The newly created image graphics object does not have any data yet. Then, setting functions can be called to set data to the new image graphics object.

Parameters

  [in] | document | A valid PDF document object. The new image graphics object should be inserted to one page of this PDF document then.

Returns
  A new image object. If there is any error, this function will return nil.

## ◆ createFromType3TextObject:text_obj:()

+ (FSImageObject *) createFromType3TextObject: |  | (FSPDFPage*) | page
text_obj: |  | (FSTextObject*) | text_obj

Create an image graphics object from a type3 text object.

Parameters

  [in] | page | A valid PDF page object.
  [in] | text_obj | A valid text object. This text object should be a type3 text object.

Returns
  A new image object. If there is any error, this function will return nil.

## ◆ getColorSpace()

- (FSColorSpaceType) getColorSpace |  |  |

Get color space.

Returns
  Color space. Please refer to values starting from FSColorSpaceDeviceGray and this would be one of these values.

## ◆ getMask()

- (FSPDFObject *) getMask |  |  |

Get the PDF object that represents the mask of current image graphics object.

The mask can be either a PDF dictionary or a PDF array:

- A PDF dictionary represents an image mask to be applied to this image.
- A PDF array represents a range of colors to be applied to it as a color key mask.

Please refer to Section 4.8.4 "Image Dictionaries" in <PDF Reference 1.7> for more details.

Returns
  A PDF object that represents the mask. If FSImageObject::isImageMask returns YES, this function will return nil.

## ◆ getStream()

- (FSPDFStream *) getStream |  |  |

Get image stream.

Returns
  A FSPDFStream that represents the image stream. If there is any error, this function will return nil.

## ◆ isImageMask()

- (BOOL) isImageMask |  |  |

Check if current image object is treated as mask.

Returns
  YES means current object is treated as mask, while NO means not.

## ◆ setBitmap:mask:()

- (void) setBitmap: |  | (FSBitmap*) | bitmap
mask: |  | (FSBitmap*) | mask

Set a bitmap to current image graphics object.

Parameters

  [in] | bitmap | A valid bitmap object to be set to current image.
  [in] | mask | Mask bitmap. Default value: A bitmap object by default constructor and not set any value, which means no mask is used. If this is valid, its format should be FSBitmapDIB8bppMask. This is useful only when parameter bitmap does not have an alpha channel.

Returns
  None

Note
  When this function succeeds, function FSGraphicsObjects::generateContent should be called. Please refer to function FSGraphicsObjects::generateContent for more details.

## ◆ setImage:frame_index:()

- (void) setImage: |  | (FSImage*) | image
frame_index: |  | (int) | frame_index

Set one frame of an image to current image graphics object.

Input image may contain multiple frames, and only one frame of the image can be set to current image graphics object.

Parameters

  [in] | image | A valid image object. This image should contain at least one frame and the image type should not be FSImageUnknown.
  [in] | frame_index | Frame index used to decide which frame of parameter image is to be set. Valid range: from 0 to (count-1). count is returned by function FSImage::getFrameCount.

Returns
  None

Note
  When this function succeeds, function FSGraphicsObjects::generateContent should be called. Please refer to function FSGraphicsObjects::generateContent for more details.