SketchUp SDK
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Functions
image.h File Reference
#include <slapi/unicodestring.h>
#include <slapi/transformation.h>
#include <slapi/model/defs.h>

Go to the source code of this file.

Functions

SU_EXPORT SUEntityRef SUImageToEntity (SUImageRef image)
 Converts from an SUImageRef to an SUEntityRef. This is essentially an upcast operation. More...
 
SU_EXPORT SUImageRef SUImageFromEntity (SUEntityRef entity)
 Converts from an SUEntityRef to an SUImageRef. This is essentially a downcast operation so the given entity must be convertible to an SUImageRef. More...
 
SU_EXPORT SUDrawingElementRef SUImageToDrawingElement (SUImageRef image)
 Converts from an SUImageRef to an SUDrawingElementRef. This is essentially an upcast operation. More...
 
SU_EXPORT SUImageRef SUImageFromDrawingElement (SUDrawingElementRef drawing_elem)
 Converts from an SUDrawingElementRef to an SUImageRef. This is essentially a downcast operation so the given element must be convertible to an SUImageRef. More...
 
SU_RESULT SUImageCreateFromFile (SUImageRef *image, const char *file_path)
 Creates a new image object from an image file specified by a path. The created image must be subsequently added to the Entities of a model, component definition or a group. More...
 
SU_RESULT SUImageGetName (SUImageRef image, SUStringRef *name)
 Retrieves the name of an image object. More...
 
SU_RESULT SUImageSetName (SUImageRef image, const char *name)
 Sets the name of an image object. More...
 
SU_RESULT SUImageGetTransform (SUImageRef image, struct SUTransformation *transform)
 Retrieves the 3-dimensional homogeneous transform of an image object. More...
 
SU_RESULT SUImageSetTransform (SUImageRef image, const struct SUTransformation *transform)
 Sets the 3-dimensional homogeneous transform of an image object. More...
 
SU_RESULT SUImageGetFileName (SUImageRef image, SUStringRef *file_name)
 Retrieves the image file name of an image object. More...
 
SU_RESULT SUImageGetDimensions (SUImageRef image, double *width, double *height)
 Retrieves the world dimensions of an image object. More...
 
SU_RESULT SUImageGetPixelDimensions (SUImageRef image, size_t *width, size_t *height)
 Retrieves the width and height dimensions of an image object in pixels. More...
 

Function Documentation

SU_RESULT SUImageCreateFromFile ( SUImageRef image,
const char *  file_path 
)

Creates a new image object from an image file specified by a path. The created image must be subsequently added to the Entities of a model, component definition or a group.

Parameters
[out]imageThe image object created.
file_pathThe file path of the source image file. Assumed to be UTF-8 encoded.
Returns
SU_EXPORT SUImageRef SUImageFromDrawingElement ( SUDrawingElementRef  drawing_elem)

Converts from an SUDrawingElementRef to an SUImageRef. This is essentially a downcast operation so the given element must be convertible to an SUImageRef.

Parameters
[in]drawing_elemThe given element reference.
Returns
  • The converted SUImageRef if the downcast operation succeeds
  • If not, the returned reference will be invalid
SU_EXPORT SUImageRef SUImageFromEntity ( SUEntityRef  entity)

Converts from an SUEntityRef to an SUImageRef. This is essentially a downcast operation so the given entity must be convertible to an SUImageRef.

Parameters
[in]entityThe given entity reference.
Returns
  • The converted SUImageRef if the downcast operation succeeds. If not, the returned reference will be invalid
SU_RESULT SUImageGetDimensions ( SUImageRef  image,
double *  width,
double *  height 
)

Retrieves the world dimensions of an image object.

Parameters
[in]imageThe image object.
[out]widthThe width dimension retrieved.
[out]heightThe height dimension retrieved.
Returns
SU_RESULT SUImageGetFileName ( SUImageRef  image,
SUStringRef file_name 
)

Retrieves the image file name of an image object.

Parameters
[in]imageThe image object.
[out]file_nameThe image file name retrieved.
Returns
SU_RESULT SUImageGetName ( SUImageRef  image,
SUStringRef name 
)

Retrieves the name of an image object.

Parameters
[in]imageThe image object.
[out]nameThe name retrieved.
Returns
SU_RESULT SUImageGetPixelDimensions ( SUImageRef  image,
size_t *  width,
size_t *  height 
)

Retrieves the width and height dimensions of an image object in pixels.

Parameters
[in]imageThe image object.
[out]widthThe width dimension retrieved.
[out]heightThe height dimension retrieved.
Returns
SU_RESULT SUImageGetTransform ( SUImageRef  image,
struct SUTransformation transform 
)

Retrieves the 3-dimensional homogeneous transform of an image object.

Parameters
[in]imageThe image object.
[out]transformThe transform retrieved.
Returns
SU_RESULT SUImageSetName ( SUImageRef  image,
const char *  name 
)

Sets the name of an image object.

Parameters
[in]imageThe image object.
[in]nameThe name to set. Assumed to be UTF-8 encoded.
Returns
SU_RESULT SUImageSetTransform ( SUImageRef  image,
const struct SUTransformation transform 
)

Sets the 3-dimensional homogeneous transform of an image object.

Parameters
[in]imageThe image object.
[in]transformThe affine transform to set.
Returns
SU_EXPORT SUDrawingElementRef SUImageToDrawingElement ( SUImageRef  image)

Converts from an SUImageRef to an SUDrawingElementRef. This is essentially an upcast operation.

Parameters
[in]imageThe given image reference.
Returns
  • The converted SUEntityRef if image is a valid image
  • If not, the returned reference will be invalid
SU_EXPORT SUEntityRef SUImageToEntity ( SUImageRef  image)

Converts from an SUImageRef to an SUEntityRef. This is essentially an upcast operation.

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