SketchUp SDK
|
#include <slapi/geometry.h>
#include <slapi/unicodestring.h>
#include <slapi/model/defs.h>
#include <slapi/model/face.h>
Go to the source code of this file.
Functions | |
SU_RESULT | SUTextureWriterCreate (SUTextureWriterRef *writer) |
Creates a new texture writer object. The texture writer must be subsequently deallocated with SUTextureWriterRelease. More... | |
SU_RESULT | SUTextureWriterRelease (SUTextureWriterRef *writer) |
Deallocates a texture writer object. More... | |
SU_RESULT | SUTextureWriterLoadEntity (SUTextureWriterRef writer, SUEntityRef entity, long *texture_id) |
Loads an entity to a texture writer object in order to have its texture written to disk. Acceptable entity types are: SUComponentInstanceRef, SUImageRef, SUGroupRef and SULayerRef. More... | |
SU_RESULT | SUTextureWriterLoadFace (SUTextureWriterRef writer, SUFaceRef face, long *front_texture_id, long *back_texture_id) |
Loads a face object to a texture writer object in order to have its front and/or back texture written to local disk. More... | |
SU_RESULT | SUTextureWriterGetNumTextures (SUTextureWriterRef writer, size_t *count) |
Retrieves the total number of textures that are loaded into the texture writer object. More... | |
SU_RESULT | SUTextureWriterWriteTexture (SUTextureWriterRef writer, long texture_id, const char *path, bool reduce_size) |
Writes a texture to a file on disk. More... | |
SU_RESULT | SUTextureWriterWriteAllTextures (SUTextureWriterRef writer, const char *directory) |
Writes out all the textures loaded into a texture writer object. The file names and formats are those of the image file used to create the texture. Preexisting files are overwritten. More... | |
SU_RESULT | SUTextureWriterIsTextureAffine (SUTextureWriterRef writer, long texture_id, bool *is_affine) |
Retrieves a flag indicating whether a texture object loaded into a texture writer object is linearly interpolated (affine) or perspective corrected. More... | |
SU_RESULT | SUTextureWriterGetTextureFilePath (SUTextureWriterRef writer, long texture_id, SUStringRef *file_path) |
Retrieves the file path from a texture image written using SUTextureWriterWriteAllTextures. More... | |
SU_RESULT | SUTextureWriterGetFrontFaceUVCoords (SUTextureWriterRef writer, SUFaceRef face, size_t len, const struct SUPoint3D points[], struct SUPoint2D uv_coords[]) |
Given an array of vertex positions, retrieves the corresponding UV coordinates of the front face texture of a face object that has been loaded into the given texture writer object. More... | |
SU_RESULT | SUTextureWriterGetBackFaceUVCoords (SUTextureWriterRef writer, SUFaceRef face, size_t len, const struct SUPoint3D points[], struct SUPoint2D uv_coords[]) |
Given an array of vertex positions, retrieves the corresponding UV coordinates of the back face texture of a face object that has been loaded into the given texture writer object. More... | |
SU_RESULT | SUTextureWriterGetTextureIdForEntity (SUTextureWriterRef writer, SUEntityRef entity, long *texture_id) |
Gets the texture id of a previously loaded entity. Acceptable entity types are: SUComponentInstanceRef, SUImageRef, SUGroupRef and SULayerRef. More... | |
SU_RESULT | SUTextureWriterGetTextureIdForFace (SUTextureWriterRef writer, SUFaceRef face, bool front, long *texture_id) |
Gets the texture id of a previously loaded face. More... | |
SU_RESULT SUTextureWriterCreate | ( | SUTextureWriterRef * | writer | ) |
Creates a new texture writer object. The texture writer must be subsequently deallocated with SUTextureWriterRelease.
[out] | writer | The created texture writer object. |
SU_RESULT SUTextureWriterGetBackFaceUVCoords | ( | SUTextureWriterRef | writer, |
SUFaceRef | face, | ||
size_t | len, | ||
const struct SUPoint3D | points[], | ||
struct SUPoint2D | uv_coords[] | ||
) |
Given an array of vertex positions, retrieves the corresponding UV coordinates of the back face texture of a face object that has been loaded into the given texture writer object.
[in] | writer | The texture writer object. |
[in] | face | The face object. |
[in] | len | The number of vertex positions. |
[in] | points | The vertex positions. |
[out] | uv_coords | The UV coordinates retrieved. |
SU_RESULT SUTextureWriterGetFrontFaceUVCoords | ( | SUTextureWriterRef | writer, |
SUFaceRef | face, | ||
size_t | len, | ||
const struct SUPoint3D | points[], | ||
struct SUPoint2D | uv_coords[] | ||
) |
Given an array of vertex positions, retrieves the corresponding UV coordinates of the front face texture of a face object that has been loaded into the given texture writer object.
[in] | writer | The texture writer object. |
[in] | face | The face object. |
[in] | len | The number of vertex positions. |
[in] | points | The vertex positions. |
[out] | uv_coords | The UV coordinates retrieved. |
SU_RESULT SUTextureWriterGetNumTextures | ( | SUTextureWriterRef | writer, |
size_t * | count | ||
) |
Retrieves the total number of textures that are loaded into the texture writer object.
[in] | writer | The texture writer object. |
[in] | count | The number of textures. |
SU_RESULT SUTextureWriterGetTextureFilePath | ( | SUTextureWriterRef | writer, |
long | texture_id, | ||
SUStringRef * | file_path | ||
) |
Retrieves the file path from a texture image written using SUTextureWriterWriteAllTextures.
[in] | writer | The texture writer object. |
[in] | texture_id | The id of the texture. |
[out] | file_path | The file path retrieved. |
SU_RESULT SUTextureWriterGetTextureIdForEntity | ( | SUTextureWriterRef | writer, |
SUEntityRef | entity, | ||
long * | texture_id | ||
) |
Gets the texture id of a previously loaded entity. Acceptable entity types are: SUComponentInstanceRef, SUImageRef, SUGroupRef and SULayerRef.
[in] | writer | The texture writer object. |
[in] | entity | The entity object. |
[out] | texture_id | The texture id retrieved. |
SU_RESULT SUTextureWriterGetTextureIdForFace | ( | SUTextureWriterRef | writer, |
SUFaceRef | face, | ||
bool | front, | ||
long * | texture_id | ||
) |
Gets the texture id of a previously loaded face.
[in] | writer | The texture writer object. |
[in] | face | The face object. |
[in] | front | The side of the face we are interested in. True if we want texture for the front face, false if we want the texture for the back face. |
[out] | texture_id | The texture id retrieved. |
SU_RESULT SUTextureWriterIsTextureAffine | ( | SUTextureWriterRef | writer, |
long | texture_id, | ||
bool * | is_affine | ||
) |
Retrieves a flag indicating whether a texture object loaded into a texture writer object is linearly interpolated (affine) or perspective corrected.
[in] | writer | The texture writer object. |
[in] | texture_id | The id of the texture. |
[out] | is_affine | The affine flag retrieved. |
SU_RESULT SUTextureWriterLoadEntity | ( | SUTextureWriterRef | writer, |
SUEntityRef | entity, | ||
long * | texture_id | ||
) |
Loads an entity to a texture writer object in order to have its texture written to disk. Acceptable entity types are: SUComponentInstanceRef, SUImageRef, SUGroupRef and SULayerRef.
[in] | writer | The texture writer object. |
[in] | entity | The entity object. |
[out] | texture_id | The id of the texture. |
SU_RESULT SUTextureWriterLoadFace | ( | SUTextureWriterRef | writer, |
SUFaceRef | face, | ||
long * | front_texture_id, | ||
long * | back_texture_id | ||
) |
Loads a face object to a texture writer object in order to have its front and/or back texture written to local disk.
[in] | writer | The texture writer object. |
[in] | face | The face object. |
[in] | front_texture_id | The texture ID of the front texture. |
[in] | back_texture_id | The texture ID of the back texture. |
SU_RESULT SUTextureWriterRelease | ( | SUTextureWriterRef * | writer | ) |
Deallocates a texture writer object.
[in] | writer | The texture writer object. |
SU_RESULT SUTextureWriterWriteAllTextures | ( | SUTextureWriterRef | writer, |
const char * | directory | ||
) |
Writes out all the textures loaded into a texture writer object. The file names and formats are those of the image file used to create the texture. Preexisting files are overwritten.
[in] | writer | The texture writer object. |
[in] | directory | The directory on disk to write the textures. Assumed to be UTF-8 encoded. |
SU_RESULT SUTextureWriterWriteTexture | ( | SUTextureWriterRef | writer, |
long | texture_id, | ||
const char * | path, | ||
bool | reduce_size | ||
) |
Writes a texture to a file on disk.
[in] | writer | The texture writer object. |
[in] | texture_id | The id of the texture. |
[in] | path | The file location on disk to write the texture. If a file is present at the location it is overwritten. The file extension of the file path is indicates the file format. The extension must be one of "jpg", "bmp", "tif", or "png". Assumed to be UTF-8 encoded. |
[in] | reduce_size | Indicates whether the texture image should be reduced in size through scaling. |