PVRTexture namespace. Contains methods and classes for PVRTexLib. More...
Classes | |
class | CPVRTexture |
A full public texture container format, with support for custom meta-data, and complete, optimised, resource loading code into PVRTools. More... | |
class | CPVRTextureHeader |
Wrapper class for PVRTextureHeaderV3, adds 'smart' accessor functions. More... | |
Typedefs | |
typedef signed char | int8 |
Signed 8 bit integer. More... | |
typedef signed short | int16 |
Signed 16 bit integer. More... | |
typedef signed int | int32 |
Signed 32 bit integer. More... | |
typedef signed long long | int64 |
Signed 64 bit integer. More... | |
typedef unsigned char | uint8 |
Unsigned 8 bit integer. More... | |
typedef unsigned short | uint16 |
Unsigned 16 bit integer. More... | |
typedef unsigned int | uint32 |
Unsigned 32 bit integer. More... | |
typedef unsigned long long | uint64 |
Unsigned 64 bit integer. More... | |
typedef CPVRTMap< uint32, CPVRTMap< uint32, MetaDataBlock > > | MetaDataMap |
Useful typedef for generating maps of MetaData blocks. More... | |
Enumerations | |
enum | ECompressorQuality { ePVRTCFastest =0, ePVRTCFast, ePVRTCNormal, ePVRTCHigh, ePVRTCBest, eNumPVRTCModes, eETCFast =0, eETCFastPerceptual, eETCSlow, eETCSlowPerceptual, eNumETCModes } |
Quality level to compress the texture with. Currently valid with ETC and PVRTC formats. More... | |
enum | EResizeMode { eResizeNearest, eResizeLinear, eResizeCubic, eNumResizeModes } |
Texture resize mode. More... | |
enum | ELegacyApi { eOGLES =1, eOGLES2, eD3DM, eOGL, eDX9, eDX10, eOVG, eMGL } |
Legacy API enum. More... | |
Functions | |
bool PVR_DLL | Resize (CPVRTexture &sTexture, const uint32 &u32NewWidth, const uint32 &u32NewHeight, const uint32 &u32NewDepth, const EResizeMode eResizeMode) |
Resizes the texture to new specified dimensions. Filtering mode is specified with "eResizeMode". More... | |
bool PVR_DLL | ResizeCanvas (CPVRTexture &sTexture, const uint32 &u32NewWidth, const uint32 &u32NewHeight, const uint32 &u32NewDepth, const int32 &i32XOffset, const int32 &i32YOffset, const int32 &i32ZOffset) |
Resizes the canvas of a texture to new specified dimensions. Filtering mode is specified with "eResizeMode". More... | |
bool PVR_DLL | Rotate90 (CPVRTexture &sTexture, const EPVRTAxis eRotationAxis, const bool bForward) |
Rotates a texture by 90 degrees around the given axis. bForward controls direction of rotation. More... | |
bool PVR_DLL | Flip (CPVRTexture &sTexture, const EPVRTAxis eFlipDirection) |
Flips a texture in a given direction. More... | |
bool PVR_DLL | Border (CPVRTexture &sTexture, uint32 uiBorderX, uint32 uiBorderY, uint32 uiBorderZ) |
Adds a user specified border to the texture. More... | |
bool PVR_DLL | PreMultiplyAlpha (CPVRTexture &sTexture) |
Pre-multiplies a texture's colours by its alpha values. More... | |
bool PVR_DLL | Bleed (CPVRTexture &sTexture) |
Allows a texture's colours to run into any fully transparent areas. More... | |
bool PVR_DLL | SetChannels (CPVRTexture &sTexture, uint32 uiNumChannelSets, EChannelName *eChannels, uint32 *pValues) |
Sets the specified number of channels to values specified in pValues. More... | |
bool PVR_DLL | SetChannelsFloat (CPVRTexture &sTexture, uint32 uiNumChannelSets, EChannelName *eChannels, float *pValues) |
Sets the specified number of channels to values specified in float pValues. More... | |
bool PVR_DLL | CopyChannels (CPVRTexture &sTexture, const CPVRTexture &sTextureSource, uint32 uiNumChannelCopies, EChannelName *eChannels, EChannelName *eChannelsSource) |
Copies the specified channels from sTextureSource into sTexture. More... | |
bool PVR_DLL | GenerateNormalMap (CPVRTexture &sTexture, const float fScale, CPVRTString sChannelOrder) |
Generates a Normal Map from a given height map. More... | |
bool PVR_DLL | GenerateMIPMaps (CPVRTexture &sTexture, const EResizeMode eFilterMode, const uint32 uiMIPMapsToDo=PVRTEX_ALLMIPLEVELS) |
Generates MIPMaps for a source texture. Default is to create a complete MIPMap chain, however this can be overridden with uiMIPMapsToDo. More... | |
bool PVR_DLL | ColourMIPMaps (CPVRTexture &sTexture) |
Colours a texture's MIPMap levels with artificial colours for debugging. MIP levels are coloured in the following order: Red, Green, Blue, Cyan, Magenta and Yellow in a repeating pattern. More... | |
bool PVR_DLL | Transcode (CPVRTexture &sTexture, const PixelType ptFormat, const EPVRTVariableType eChannelType, const EPVRTColourSpace eColourspace, const ECompressorQuality eQuality=ePVRTCNormal, const bool bDoDither=false) |
Transcodes a texture from its original format into a newly specified format. Will either quantise or dither to lower precisions based on bDoDither. uiQuality specifies the quality for PVRTC and ETC compression. More... | |
PVRTexture namespace. Contains methods and classes for PVRTexLib.
typedef signed short pvrtexture::int16 |
Signed 16 bit integer.
typedef signed int pvrtexture::int32 |
Signed 32 bit integer.
typedef signed long long pvrtexture::int64 |
Signed 64 bit integer.
typedef signed char pvrtexture::int8 |
Signed 8 bit integer.
Useful typedef for generating maps of MetaData blocks.
typedef unsigned short pvrtexture::uint16 |
Unsigned 16 bit integer.
typedef unsigned int pvrtexture::uint32 |
Unsigned 32 bit integer.
typedef unsigned long long pvrtexture::uint64 |
Unsigned 64 bit integer.
typedef unsigned char pvrtexture::uint8 |
Unsigned 8 bit integer.
Quality level to compress the texture with. Currently valid with ETC and PVRTC formats.
bool PVR_DLL pvrtexture::Bleed | ( | CPVRTexture & | sTexture) |
Allows a texture's colours to run into any fully transparent areas.
[in] | sTexture | Texture |
bool PVR_DLL pvrtexture::Border | ( | CPVRTexture & | sTexture, |
uint32 | uiBorderX, | ||
uint32 | uiBorderY, | ||
uint32 | uiBorderZ | ||
) |
Adds a user specified border to the texture.
[in] | sTexture | Texture |
[in] | uiBorderX | X border |
[in] | uiBorderY | Y border |
[in] | uiBorderZ | Z border |
bool PVR_DLL pvrtexture::ColourMIPMaps | ( | CPVRTexture & | sTexture) |
Colours a texture's MIPMap levels with artificial colours for debugging. MIP levels are coloured in the following order: Red, Green, Blue, Cyan, Magenta and Yellow in a repeating pattern.
[in] | sTexture | Texture |
bool PVR_DLL pvrtexture::CopyChannels | ( | CPVRTexture & | sTexture, |
const CPVRTexture & | sTextureSource, | ||
uint32 | uiNumChannelCopies, | ||
EChannelName * | eChannels, | ||
EChannelName * | eChannelsSource | ||
) |
Copies the specified channels from sTextureSource into sTexture.
sTextureSource is not modified so it is possible to use the same texture as both input and output. When using the same texture as source and destination, channels are preserved between swaps (e.g. copying Red to Green and then Green to Red will result in the two channels trading places correctly). Channels in eChannels are set to the value of the channels in eChannelSource.
[in] | sTexture | Destination texture to copy channels to |
[in] | sTextureSource | Source texture to copy channels from |
[in] | uiNumChannelCopies | Number of channels to copy |
[in] | eChannels | Channels to set |
[in] | eChannelsSource | Source channels to copy from |
bool PVR_DLL pvrtexture::Flip | ( | CPVRTexture & | sTexture, |
const EPVRTAxis | eFlipDirection | ||
) |
Flips a texture in a given direction.
[in] | sTexture | Texture to flip |
[in] | eFlipDirection | Flip direction |
bool PVR_DLL pvrtexture::GenerateMIPMaps | ( | CPVRTexture & | sTexture, |
const EResizeMode | eFilterMode, | ||
const uint32 | uiMIPMapsToDo = PVRTEX_ALLMIPLEVELS |
||
) |
Generates MIPMaps for a source texture. Default is to create a complete MIPMap chain, however this can be overridden with uiMIPMapsToDo.
[in] | sTexture | Texture |
[in] | eFilterMode | Filter mode |
[in] | uiMIPMapsToDo | Level of MIPMap chain to create |
bool PVR_DLL pvrtexture::GenerateNormalMap | ( | CPVRTexture & | sTexture, |
const float | fScale, | ||
CPVRTString | sChannelOrder | ||
) |
Generates a Normal Map from a given height map.
Assumes the red channel has the height values. By default outputs to red/green/blue = x/y/z, this can be overridden by specifying a channel order in sChannelOrder. The channels specified will output to red/green/blue/alpha in that order. So "xyzh" maps x to red, y to green, z to blue and h to alpha. 'h' is used to specify that the original height map data should be preserved in the given channel.
[in] | sTexture | Texture |
[in] | fScale | Scale factor |
[in] | sChannelOrder | Channel order |
bool PVR_DLL pvrtexture::PreMultiplyAlpha | ( | CPVRTexture & | sTexture) |
Pre-multiplies a texture's colours by its alpha values.
[in] | sTexture | Texture to premultiply |
bool PVR_DLL pvrtexture::Resize | ( | CPVRTexture & | sTexture, |
const uint32 & | u32NewWidth, | ||
const uint32 & | u32NewHeight, | ||
const uint32 & | u32NewDepth, | ||
const EResizeMode | eResizeMode | ||
) |
Resizes the texture to new specified dimensions. Filtering mode is specified with "eResizeMode".
[in] | sTexture | Texture to resize |
[in] | u32NewWidth | New width |
[in] | u32NewHeight | New height |
[in] | u32NewDepth | New depth |
[in] | eResizeMode | Filtering mode |
bool PVR_DLL pvrtexture::ResizeCanvas | ( | CPVRTexture & | sTexture, |
const uint32 & | u32NewWidth, | ||
const uint32 & | u32NewHeight, | ||
const uint32 & | u32NewDepth, | ||
const int32 & | i32XOffset, | ||
const int32 & | i32YOffset, | ||
const int32 & | i32ZOffset | ||
) |
Resizes the canvas of a texture to new specified dimensions. Filtering mode is specified with "eResizeMode".
Offset area is filled with transparent black colour.
[in] | sTexture | Texture |
[in] | u32NewWidth | New width |
[in] | u32NewHeight | New height |
[in] | u32NewDepth | New depth |
[in] | i32XOffset | X Offset value from the top left corner |
[in] | i32YOffset | Y Offset value from the top left corner |
[in] | i32ZOffset | Z Offset value from the top left corner |
bool PVR_DLL pvrtexture::Rotate90 | ( | CPVRTexture & | sTexture, |
const EPVRTAxis | eRotationAxis, | ||
const bool | bForward | ||
) |
Rotates a texture by 90 degrees around the given axis. bForward controls direction of rotation.
[in] | sTexture | Texture to rotate |
[in] | eRotationAxis | Rotation axis |
[in] | bForward | Direction of rotation; 1 = clockwise, 0 = anti-clockwise |
bool PVR_DLL pvrtexture::SetChannels | ( | CPVRTexture & | sTexture, |
uint32 | uiNumChannelSets, | ||
EChannelName * | eChannels, | ||
uint32 * | pValues | ||
) |
Sets the specified number of channels to values specified in pValues.
[in] | sTexture | Texture |
[in] | uiNumChannelSets | Number of channels to set |
[in] | eChannels | Channels to set |
[in] | pValues | uint32 values to set channels to |
bool PVR_DLL pvrtexture::SetChannelsFloat | ( | CPVRTexture & | sTexture, |
uint32 | uiNumChannelSets, | ||
EChannelName * | eChannels, | ||
float * | pValues | ||
) |
Sets the specified number of channels to values specified in float pValues.
[in] | sTexture | Texture |
[in] | uiNumChannelSets | Number of channels to set |
[in] | eChannels | Channels to set |
[in] | pValues | float values to set channels to |
bool PVR_DLL pvrtexture::Transcode | ( | CPVRTexture & | sTexture, |
const PixelType | ptFormat, | ||
const EPVRTVariableType | eChannelType, | ||
const EPVRTColourSpace | eColourspace, | ||
const ECompressorQuality | eQuality = ePVRTCNormal , |
||
const bool | bDoDither = false |
||
) |
Transcodes a texture from its original format into a newly specified format. Will either quantise or dither to lower precisions based on bDoDither. uiQuality specifies the quality for PVRTC and ETC compression.
[in] | sTexture | Texture |
[in] | ptFormat | Pixel format type |
[in] | eChannelType | Channel type |
[in] | eColourspace | Colour space |
[in] | eQuality | Quality for PVRTC and ETC compression |
[in] | bDoDither | Dither the texture to lower precisions |