LayOut C API
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Functions
image.h File Reference
#include <LayOutAPI/common.h>
#include <LayOutAPI/geometry/geometry.h>
#include <LayOutAPI/model/defs.h>

Go to the source code of this file.

Functions

LO_RESULT LOImageCreateFromFile (LOImageRef *image, const LOAxisAlignedRect2D *bounds, const char *file_path)
 Creates a new image object from an image file on disk. More...
 
LO_RESULT LOImageAddReference (LOImageRef image)
 Adds a reference to an image object. More...
 
LO_RESULT LOImageRelease (LOImageRef *image)
 Releases an image object. The object will be invalidated if releasing the last reference. More...
 
LO_EXPORT LOImageRef LOImageFromEntity (LOEntityRef entity)
 Converts from a LOEntityRef to a LOImageRef. This is essentially a downcast operation so the given LOEntityRef must be convertible to a LOImageRef. More...
 
LO_EXPORT LOEntityRef LOImageToEntity (LOImageRef image)
 Converts from a LOImageRef to a LOEntityRef. This is essentially an upcast operation. More...
 
LO_RESULT LOImageGetImageRep (LOImageRef image, LOImageRepRef *imagerep)
 Gets an image object's image representation. More...
 
LO_RESULT LOImageGetClipMask (LOImageRef image, LOEntityRef *clip_mask)
 Returns any clip mask assigned to the image. More...
 
LO_RESULT LOImageSetClipMask (LOImageRef model, LOEntityRef clip_mask)
 Sets the clip mask of the image. A clip mask defines a region of the entity that is visible. This allows you to crop with arbitrary shapes. This operation will replace any clip mask that is already assigned to this image. The entity being used must not be already part of a document or group. The clip mask entity must be either a rectangle, ellipse or a path. More...
 

Function Documentation

LO_RESULT LOImageAddReference ( LOImageRef  image)

Adds a reference to an image object.

Parameters
[in]imageThe image object.
Returns
LO_RESULT LOImageCreateFromFile ( LOImageRef image,
const LOAxisAlignedRect2D bounds,
const char *  file_path 
)

Creates a new image object from an image file on disk.

Parameters
[out]imageThe image object.
[in]boundsThe bounding box for the image.
[in]file_pathThe file path to the image on disk.
Returns
LO_EXPORT LOImageRef LOImageFromEntity ( LOEntityRef  entity)

Converts from a LOEntityRef to a LOImageRef. This is essentially a downcast operation so the given LOEntityRef must be convertible to a LOImageRef.

Parameters
[in]entityThe entity object.
Returns
  • The converted LOImageRef if the downcast operation succeeds
  • If not, the returned reference will be invalid
LO_RESULT LOImageGetClipMask ( LOImageRef  image,
LOEntityRef clip_mask 
)

Returns any clip mask assigned to the image.

Parameters
[in]imageThe image object.
[out]clip_maskThe clip mask of the image.
Returns
LO_RESULT LOImageGetImageRep ( LOImageRef  image,
LOImageRepRef imagerep 
)

Gets an image object's image representation.

Parameters
[in]imageThe image object.
[out]imagerepThe image representation object.
Returns
LO_RESULT LOImageRelease ( LOImageRef image)

Releases an image object. The object will be invalidated if releasing the last reference.

Parameters
[in]imageThe image object.
Returns
LO_RESULT LOImageSetClipMask ( LOImageRef  model,
LOEntityRef  clip_mask 
)

Sets the clip mask of the image. A clip mask defines a region of the entity that is visible. This allows you to crop with arbitrary shapes. This operation will replace any clip mask that is already assigned to this image. The entity being used must not be already part of a document or group. The clip mask entity must be either a rectangle, ellipse or a path.

Note
Starting in LayOut 2020.1, API 5.1, clip_mask may be SU_INVALID, which will remove the existing clip mask, if any.
Since
LayOut 2017, API 2.0
Parameters
[in]modelThe image object.
[in]clip_maskThe new clip mask for the image.
Returns
LO_EXPORT LOEntityRef LOImageToEntity ( LOImageRef  image)

Converts from a LOImageRef to a LOEntityRef. This is essentially an upcast operation.

Parameters
[in]imageThe image object.
Returns
  • The converted LOEntityRef if image is a valid object
  • If not, the returned reference will be invalid