SketchUp C API
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Related Functions
SUImageRepRef Struct Reference

References an image representation object. More...

#include <SketchUpAPI/model/image_rep.h>

Related Functions

(Note that these are not member functions.)

enum SUResult SUImageRepCreate (SUImageRepRef *image)
 Creates a new image object with no image data. Image data can be set using any of SUImageRepCopy, SUImageRepSetData, SUImageRepLoadFile. More...
 
enum SUResult SUImageRepRelease (SUImageRepRef *image)
 Releases an image object. More...
 
enum SUResult SUImageRepCopy (SUImageRepRef image, SUImageRepRef copy_image)
 Copies data from the copy_image to image. More...
 
enum SUResult SUImageRepSetData (SUImageRepRef image, size_t width, size_t height, size_t bits_per_pixel, size_t row_padding, const SUByte pixel_data[])
 Sets the image data for the given image. Makes a copy of the data rather than taking ownership. More...
 
enum SUResult SUImageRepLoadFile (SUImageRepRef image, const char *file_path)
 Loads image data from the specified file into the provided image. More...
 
enum SUResult SUImageRepSaveToFile (SUImageRepRef image, const char *file_path)
 Saves an image object to an image file specified by a path. More...
 
enum SUResult SUImageRepGetPixelDimensions (SUImageRepRef image, size_t *width, size_t *height)
 Retrieves the width and height dimensions of an image object in pixels. More...
 
enum SUResult SUImageRepGetRowPadding (SUImageRepRef image, size_t *row_padding)
 Retrieves the size of the row padding of an image, in bytes. More...
 
enum SUResult SUImageRepResize (SUImageRepRef image, size_t width, size_t height)
 Resizes the dimensions of an image object to the given width and height in pixels. More...
 
enum SUResult SUImageRepConvertTo32BitsPerPixel (SUImageRepRef image)
 Converts an image object to be 32 bits per pixel. More...
 
enum SUResult SUImageRepGetDataSize (SUImageRepRef image, size_t *data_size, size_t *bits_per_pixel)
 Returns the total size and bits-per-pixel value of an image. This function is useful to determine the size of the buffer necessary to be passed into SUImageRepGetData(). The returned data can be used along with the returned bits-per-pixel value and the image dimensions to compute RGBA values at individual pixels of the image. More...
 
enum SUResult SUImageRepGetData (SUImageRepRef image, size_t data_size, SUByte pixel_data[])
 Returns the pixel data for an image. The given array must be large enough to hold the image's data. This size can be obtained by calling SUImageRepGetDataSize(). More...
 
enum SUResult SUImageRepGetDataAsColors (SUImageRepRef image, SUColor color_data[])
 Returns the color data of an image in a SUColor array. More...
 
enum SUResult SUImageRepGetColorAtUV (SUImageRepRef image, double u, double v, bool bilinear, SUColor *color)
 Returns the color data given by the UV texture coordinates. More...
 

Detailed Description

References an image representation object.

Since
SketchUp 2017, API 5.0

Friends And Related Function Documentation

enum SUResult SUImageRepConvertTo32BitsPerPixel ( SUImageRepRef  image)
related

Converts an image object to be 32 bits per pixel.

Since
SketchUp 2017, API 5.0
Parameters
[in]imageThe image object.
Returns
enum SUResult SUImageRepCopy ( SUImageRepRef  image,
SUImageRepRef  copy_image 
)
related

Copies data from the copy_image to image.

Since
SketchUp 2017, API 5.0
Parameters
[in,out]imageThe image object to be altered.
[in]copy_imageThe original image to copy from.
Returns
enum SUResult SUImageRepCreate ( SUImageRepRef image)
related

Creates a new image object with no image data. Image data can be set using any of SUImageRepCopy, SUImageRepSetData, SUImageRepLoadFile.

Since
SketchUp 2017, API 5.0
Parameters
[out]imageThe image object created.
Returns
enum SUResult SUImageRepGetColorAtUV ( SUImageRepRef  image,
double  u,
double  v,
bool  bilinear,
SUColor color 
)
related

Returns the color data given by the UV texture coordinates.

Since
SketchUp 2018, API 6.0
Parameters
[in]imageThe image object.
[in]uThe U texture coordinate.
[in]vThe V texture coordinate.
[in]bilinearThe flag to set bilinear texture filtering. This interpolates the colors instead of picking the nearest neighbor.
[out]colorThe returned color.
Returns
enum SUResult SUImageRepGetData ( SUImageRepRef  image,
size_t  data_size,
SUByte  pixel_data[] 
)
related

Returns the pixel data for an image. The given array must be large enough to hold the image's data. This size can be obtained by calling SUImageRepGetDataSize().

Since
SketchUp 2017, API 5.0
Parameters
[in]imageThe image object.
[in]data_sizeThe size of the byte array.
[out]pixel_dataThe image data retrieved.
Returns
enum SUResult SUImageRepGetDataAsColors ( SUImageRepRef  image,
SUColor  color_data[] 
)
related

Returns the color data of an image in a SUColor array.

Since
SketchUp 2018, API 6.0
Parameters
[in]imageThe image object.
[out]color_dataThe SUColor data retrieved.
Returns
enum SUResult SUImageRepGetDataSize ( SUImageRepRef  image,
size_t *  data_size,
size_t *  bits_per_pixel 
)
related

Returns the total size and bits-per-pixel value of an image. This function is useful to determine the size of the buffer necessary to be passed into SUImageRepGetData(). The returned data can be used along with the returned bits-per-pixel value and the image dimensions to compute RGBA values at individual pixels of the image.

Since
SketchUp 2017, API 5.0
Parameters
[in]imageThe image object.
[out]data_sizeThe total size of the image data in bytes.
[out]bits_per_pixelThe number of bits per pixel of the image data.
Returns
enum SUResult SUImageRepGetPixelDimensions ( SUImageRepRef  image,
size_t *  width,
size_t *  height 
)
related

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

Since
SketchUp 2017, API 5.0
Parameters
[in]imageThe image object.
[out]widthThe width dimension retrieved.
[out]heightThe height dimension retrieved.
Returns
enum SUResult SUImageRepGetRowPadding ( SUImageRepRef  image,
size_t *  row_padding 
)
related

Retrieves the size of the row padding of an image, in bytes.

Since
SketchUp 2017, API 5.0
Parameters
[in]imageThe image object.
[out]row_paddingThe row padding retrieved.
Returns
enum SUResult SUImageRepLoadFile ( SUImageRepRef  image,
const char *  file_path 
)
related

Loads image data from the specified file into the provided image.

Since
SketchUp 2017, API 5.0
Parameters
[in,out]imageThe image object used to load the file.
[in]file_pathThe file path of the source image file. Assumed to be UTF-8 encoded.
Returns
enum SUResult SUImageRepRelease ( SUImageRepRef image)
related

Releases an image object.

Since
SketchUp 2017, API 5.0
Parameters
[in]imageThe image object.
Returns
enum SUResult SUImageRepResize ( SUImageRepRef  image,
size_t  width,
size_t  height 
)
related

Resizes the dimensions of an image object to the given width and height in pixels.

Since
SketchUp 2017, API 5.0
Parameters
[in]imageThe image object.
[in]widthThe new width.
[in]heightThe new height.
Returns
enum SUResult SUImageRepSaveToFile ( SUImageRepRef  image,
const char *  file_path 
)
related

Saves an image object to an image file specified by a path.

Since
SketchUp 2017, API 5.0
Parameters
[in]imageThe image object.
[in]file_pathThe file path of the destination image file. Assumed to be UTF-8 encoded.
Returns
enum SUResult SUImageRepSetData ( SUImageRepRef  image,
size_t  width,
size_t  height,
size_t  bits_per_pixel,
size_t  row_padding,
const SUByte  pixel_data[] 
)
related

Sets the image data for the given image. Makes a copy of the data rather than taking ownership.

Since
SketchUp 2017, API 5.0
Parameters
[in,out]imageThe image object used to load the data.
[in]widthThe width of the image in pixels.
[in]heightThe height of the image in pixels.
[in]bits_per_pixelThe number of bits per pixel.
[in]row_paddingThe size in Bytes of row padding in each row of pixel_data.
[in]pixel_dataThe raw image data.
Returns

The documentation for this struct was generated from the following files: