![]() |
|
A utility class that will write out texture files. More...
Public Member Functions | |
HRESULT | LoadFace ([in] ISkpFace *pFace,[in] BOOL bFront,[out, retval]long *pHandle) |
Load a particular ISkpFace into the texture writer. | |
HRESULT | LoadImage ([in] ISkpImage *pImage,[out, retval]long *pHandle) |
Load a particular ISkpImage into the texture writer. | |
HRESULT | LoadComponentInstance ([in] ISkpComponentInstance *pComponentInstance,[out, retval]long *pHandle) |
Load a particular ISkpComponentInstance into the texture writer. | |
HRESULT | GetTextureHandleFromFace ([in]ISkpFace *pFace,[in]BOOL bFront,[out, retval]long *pVal) |
Retrieves the texture handle for the given face and side of the face. | |
HRESULT | GetTextureHandleFromComponentInstance ([in]ISkpComponentInstance *pInst,[out, retval]long *pVal) |
Retrieves the texture handle for the given component instance. | |
HRESULT | GetTextureHandleFromImage ([in]ISkpImage *pInst,[out, retval]long *pVal) |
Retrieves the texture handle for the given image. | |
HRESULT | GetTextureFile ([in]long textureHandle,[out, retval]BSTR *pFileName) |
Retrieves the texture file associated with the texture handle provided. | |
HRESULT | WriteAllTextures ([in]BSTR directoryName,[in]BOOL use83) |
Writes all the textures to the given directory name. | |
HRESULT | WriteTextureFileFromFace ([in]ISkpFace *pFace,[in] BOOL bFront,[in]BSTR fileName) |
Writes the texture associated with the given face/side to the file of the given name. | |
HRESULT | WriteTextureFileFromComponentInstance ([in]ISkpComponentInstance *pComponentInstance,[in]BSTR fileName) |
Writes the texture associated with the given ComponentInstance to the file of the given name. | |
HRESULT | WriteTextureFileFromImage ([in]ISkpImage *pImage,[in]BSTR fileName) |
Writes the texture associated with the given Image to the file of the given name. | |
HRESULT | WriteTextureFileFromHandle ([in]long textureHandle,[in]BSTR fileName) |
Writes the texture associated with the given handle to the file of the given name. | |
HRESULT | WriteTextureFileFromHandleOptimize ([in]long textureHandle,[in]BSTR fileName,[in]long optimize) |
Writes the texture associated with the given handle to the file of the given name. | |
Properties | |
long | Count [get] |
The number of textures that have been computed. |
A utility class that will write out texture files.
This object will write either individual texture files for each face, or write all the texture files for the loaded faces into a specified directory.
HRESULT ISkpTextureWriter::GetTextureFile | ( | [in] long | textureHandle, | |
[out, retval] BSTR * | pFileName | |||
) |
Retrieves the texture file associated with the texture handle provided.
The given textureHandle must correspond to a handle returned from the ISkpTextureWriter::LoadFace call on this same texture writer. Any other handle results in E_FAIL as a return value.
This method should only be called after ISkpTextureWriter::WriteAllTextures has been called. Otherwise, the file names will be empty.
textureHandle | The valid handle for the face/side desired. |
pFileName | The name of the file where the texture was written. |
HRESULT ISkpTextureWriter::GetTextureHandleFromComponentInstance | ( | [in] ISkpComponentInstance * | pInst, | |
[out, retval] long * | pVal | |||
) |
Retrieves the texture handle for the given component instance.
The component instance must have been previously loaded into the writer via the ISkpTextureWriter::LoadComponentInstance method call.
pInst | The Component Instance to load. |
pVal | The handle of the texture. |
HRESULT ISkpTextureWriter::GetTextureHandleFromFace | ( | [in] ISkpFace * | pFace, | |
[in] BOOL | bFront, | |||
[out, retval] long * | pVal | |||
) |
Retrieves the texture handle for the given face and side of the face.
The face must have been previously loaded into the writer via the ISkpTextureWriter::LoadFace method call.
pFace | The face to load. | |
bFront | TRUE iff the texture on the front of the face is to be computed, FALSE if the back of the face is to be used. |
pVal | The handle of the texture. |
HRESULT ISkpTextureWriter::GetTextureHandleFromImage | ( | [in] ISkpImage * | pInst, | |
[out, retval] long * | pVal | |||
) |
Retrieves the texture handle for the given image.
The image must have been previously loaded into the writer via the ISkpTextureWriter::LoadImage method call.
pInst | The Component Instance to load. |
pVal | The handle of the texture. |
HRESULT ISkpTextureWriter::LoadComponentInstance | ( | [in] ISkpComponentInstance * | pComponentInstance, | |
[out, retval] long * | pHandle | |||
) |
Load a particular ISkpComponentInstance into the texture writer.
When a component instance is loaded into the texture writer, the writer determines the appropriate texture that must be associated with this instance, taking into account perspective distortion, etc.
This method does not iterate over the faces within the component instance. It is only used to cover the cases where a material may have been applied to a component.
The return value is the handle that this texture can use to reference the computed texture. If the handle value is <= 0 then no corresponding texture has been found. Such handles are considered invalid in other calls to the texture writer.
pComponentInstance | The Component Instance to load. |
pHandle | The handle of the texture. |
HRESULT ISkpTextureWriter::LoadFace | ( | [in] ISkpFace * | pFace, | |
[in] BOOL | bFront, | |||
[out, retval] long * | pHandle | |||
) |
Load a particular ISkpFace into the texture writer.
When a face is loaded into the texture writer, the writer determines the appropriate texture that must be associated with this face, taking into account whether it's the front or back of the face of interest, perspective distortion, etc.
The return value is the handle that this texture can use to reference the computed texture. If the handle value is <= 0 then no corresponding texture has been found. Such handles are considered invalid in other calls to the texture writer.
pFace | The face to load. | |
bFront | TRUE iff the texture on the front of the face is to be computed, FALSE if the back of the face is to be used. |
pHandle | The handle of the texture. |
HRESULT ISkpTextureWriter::LoadImage | ( | [in] ISkpImage * | pImage, | |
[out, retval] long * | pHandle | |||
) |
Load a particular ISkpImage into the texture writer.
When a Image is loaded into the texture writer, the writer determines the appropriate texture that must be associated with this Image, taking into account perspective distortion, etc.
The return value is the handle that this texture can use to reference the computed texture. If the handle value is <= 0 then no corresponding texture has been found. Such handles are considered invalid in other calls to the texture writer.
pImage | The Image to load. |
pHandle | The handle of the texture. |
HRESULT ISkpTextureWriter::WriteAllTextures | ( | [in] BSTR | directoryName, | |
[in] BOOL | use83 | |||
) |
Writes all the textures to the given directory name.
This method will write all the computed textures associated with faces that have been loaded via the ISkpTextureWriter::LoadFace method to the directory specified. If the use83 flag is TRUE, then the file names will be mangled to 8.3 format, which is required for some file formats.
The given directory must correspond to a directory that exists on the file system. This method will fail if the directory name does not match an existing directory.
directoryName | The name of the directory. | |
use83 | TRUE if the file names should be of the 8.3 format. |
HRESULT ISkpTextureWriter::WriteTextureFileFromComponentInstance | ( | [in] ISkpComponentInstance * | pComponentInstance, | |
[in] BSTR | fileName | |||
) |
Writes the texture associated with the given ComponentInstance to the file of the given name.
If the given file name contains a directory specification that does not exist on the file system, the method will fail.
The ComponentInstance must have a texture associated with it, or the method will fail.
This method will overwrite any existing file.
pComponentInstance | Instance The Component Instance whose texture is to be written. | |
fileName | The name of the file where the texture should be written. |
HRESULT ISkpTextureWriter::WriteTextureFileFromFace | ( | [in] ISkpFace * | pFace, | |
[in] BOOL | bFront, | |||
[in] BSTR | fileName | |||
) |
Writes the texture associated with the given face/side to the file of the given name.
If the given file name contains a directory specification that does not exist on the file system, the method will fail.
The face must have a texture associated with it, or the method will fail.
This method will overwrite any existing file.
pFace | The face whose texture is to be written. | |
bFront | TRUE iff the front face is to be written, FALSE if the back face is desired. | |
fileName | The name of the file where the texture should be written. |
HRESULT ISkpTextureWriter::WriteTextureFileFromHandle | ( | [in] long | textureHandle, | |
[in] BSTR | fileName | |||
) |
Writes the texture associated with the given handle to the file of the given name.
If the given file name contains a directory specification that does not exist on the file system, the method will fail.
The face must have a texture associated with it, or the method will fail.
This method will overwrite any existing file.
The provided handle must be > 0 and must correspond to a face/side that was loaded into the texture writer via the ISkpTextureWriter::LoadFace method.
textureHandle | The valid handle for the face/side desired. | |
fileName | The name of the file where the texture should be written. |
HRESULT ISkpTextureWriter::WriteTextureFileFromHandleOptimize | ( | [in] long | textureHandle, | |
[in] BSTR | fileName, | |||
[in] long | optimize | |||
) |
Writes the texture associated with the given handle to the file of the given name.
If the given file name contains a directory specification that does not exist on the file system, the method will fail.
The face must have a texture associated with it, or the method will fail.
This method will overwrite any existing file.
The provided handle must be > 0 and must correspond to a face/side that was loaded into the texture writer via the ISkpTextureWriter::LoadFace method.
textureHandle | The valid handle for the face/side desired. | |
fileName | The name of the file where the texture should be written. | |
optimize | Whether or not the texture should be optimized to a power of 2. |
HRESULT ISkpTextureWriter::WriteTextureFileFromImage | ( | [in] ISkpImage * | pImage, | |
[in] BSTR | fileName | |||
) |
Writes the texture associated with the given Image to the file of the given name.
If the given file name contains a directory specification that does not exist on the file system, the method will fail.
The Image must have a texture associated with it, or the method will fail.
This method will overwrite any existing file.
pImage | The Image whose texture is to be written. | |
fileName | The name of the file where the texture should be written. |
long ISkpTextureWriter::Count [get] |
The number of textures that have been computed.
This count is less than or equal to the number of faces that have been loaded via the ISkpTextureWriter::LoadFace method.
pVal | the number of textures in this writer. |
©2010 Google - Google Home - About Google |