kmuCreateTwiddledTextureEx

Converts KAMUI Bit Map Format to Twiddled Format

KMSTATUS KMAPI
kmuCreateTwiddledTextureEx(
OUT PKMDWORD pOutputTexture,
IN PKMDWORD pInputTexture,
IN KMBOOLEAN bAutoMipMap,
IN KMBOOLEAN bDither,
IN KMINT32 USize,
IN KMINT32 VSize,
IN KMTEXTURETYPE nTextureType,
IN PKMDWORD pWorkarea
)

Description:

This function converts a texture in KM_TEXTURE_BMP format (ABGR8888) in main memory into a texture in Twiddled/Twiddled Mipmap format. If TRUE is specified for bAutoMipMap, a mipmap is created automatically. If TRUE is specified for bDither, dither is effected.
If different values are specified for USize and VSize, a Twiddled-Rectangle format texture is created. Note that in this case no mipmap is created. The bAutoMipMap flag is ignored.

Caution:

The contents of the input texture data are destroyed if mipmap or dither is specified.

Parameters:

pOutputTexture(output)
Address in main memory to which converted texture data is to be written
pInputTexture(input)
This parameter is a pointer indicating an input texture in KM_TEXTURE_BMP format.
bAutoMipMap(input)
This parameter specifies whether a mipmap is created automatically. If TRUE is specified, a mipmap is automatically created (the output is in KM_TEXTURE_TWIDDLED_MM format).
If FALSE is specified, a mipmap is not created (output is in KM_TEXTURE_TWIDDLED format).
If different values are specified for USize and VSize, no mipmap is created. In this case, this flag is ignored.
bDither(input)
This parameter specifies whether dither is effected. If TRUE is specified, dither is effected.
USize,VSize(input)
This parameter specifies width / height of texture by number of texels. Select one of the following:

KM_MAPSIZE_8 | 8x8 texels
KM_MAPSIZE_16 | 16x16 texels
KM_MAPSIZE_32 | 32x32 texels
KM_MAPSIZE_64 | 64x64 texels
KM_MAPSIZE_128 | 128x128 texels
KM_MAPSIZE_256 | 256x256 texels
KM_MAPSIZE_512 | 512x512 texels
KM_MAPSIZE_1024 | 1024x1024 texels

nTextureType(input)
This parameter specifies the pixel format of the converted texture. Select one of the following:

KM_TEXTURE_ARGB1555 | ARGB-1555 format
KM_TEXTURE_RGB565 | RGB-565 format
KM_TEXTURE_ARGB4444 | ARGB-4444 format

pWorkarea(input)
This parameter specifies the starting address for a newly prepared work area of the same size as the input data. This work area is needed when converting a texture that is wider than it is tall into the Twiddled-Rectangle format.
In other cases, the work area is not needed. In such a case, specify NULL for this parameter.

Return values:

Value | Explanation
--- | ---
KMSTATUS_SUCCESS | Success
KMSTATUS_INVALID_TEXTURE_TYPE | Invalid texture type specified.
KMSTATUS_INVALID_ADDRESS | pWorkarea == NULL while converting a texture that is wider than it is tall.

kmuCreateTwiddledTextureEx