All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Classes | Typedefs | Enumerations | Functions
pvrtexture Namespace Reference

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...
 

Detailed Description

PVRTexture namespace. Contains methods and classes for PVRTexLib.


Typedef Documentation

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.

Enumeration Type Documentation

Quality level to compress the texture with. Currently valid with ETC and PVRTC formats.


Enumerator
ePVRTCFastest 

PVRTC fastest.

ePVRTCFast 

PVRTC fast.

ePVRTCNormal 

PVRTC normal.

ePVRTCHigh 

PVRTC high.

ePVRTCBest 

PVRTC best.

eNumPVRTCModes 

Number of PVRTC modes.

eETCFast 

ETC fast.

eETCFastPerceptual 

ETC fast perceptual.

eETCSlow 

ETC slow.

eETCSlowPerceptual 

ETC slow perceptual.

eNumETCModes 

Number of ETC modes.

Legacy API enum.


Enumerator
eOGLES 

OpenGL ES 1.x.

eOGLES2 

OpenGL ES 2.0.

eD3DM 

Direct 3D M.

eOGL 

Open GL.

eDX9 

DirextX 9.

eDX10 

DirectX 10.

eOVG 

Open VG.

eMGL 

MGL.

Texture resize mode.


Enumerator
eResizeNearest 

Nearest filtering.

eResizeLinear 

Linear filtering.

eResizeCubic 

Cubic filtering, uses Catmull-Rom splines.

eNumResizeModes 

Number of resize modes.

Function Documentation

bool PVR_DLL pvrtexture::Bleed ( CPVRTexture &  sTexture)

Allows a texture's colours to run into any fully transparent areas.


Parameters
[in]sTextureTexture
Returns
True if the method succeeds.
bool PVR_DLL pvrtexture::Border ( CPVRTexture &  sTexture,
uint32  uiBorderX,
uint32  uiBorderY,
uint32  uiBorderZ 
)

Adds a user specified border to the texture.


Parameters
[in]sTextureTexture
[in]uiBorderXX border
[in]uiBorderYY border
[in]uiBorderZZ border
Returns
True if the method succeeds.
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.


Parameters
[in]sTextureTexture
Returns
True if the method succeeds.
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.

Parameters
[in]sTextureDestination texture to copy channels to
[in]sTextureSourceSource texture to copy channels from
[in]uiNumChannelCopiesNumber of channels to copy
[in]eChannelsChannels to set
[in]eChannelsSourceSource channels to copy from
Returns
True if the method succeeds.
bool PVR_DLL pvrtexture::Flip ( CPVRTexture &  sTexture,
const EPVRTAxis  eFlipDirection 
)

Flips a texture in a given direction.


Parameters
[in]sTextureTexture to flip
[in]eFlipDirectionFlip direction
Returns
True if the method succeeds.
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.


Parameters
[in]sTextureTexture
[in]eFilterModeFilter mode
[in]uiMIPMapsToDoLevel of MIPMap chain to create
Returns
True if the method succeeds.
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.

Parameters
[in]sTextureTexture
[in]fScaleScale factor
[in]sChannelOrderChannel order
Returns
True if the method succeeds.
bool PVR_DLL pvrtexture::PreMultiplyAlpha ( CPVRTexture &  sTexture)

Pre-multiplies a texture's colours by its alpha values.


Parameters
[in]sTextureTexture to premultiply
Returns
True if the method succeeds.
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".


Parameters
[in]sTextureTexture to resize
[in]u32NewWidthNew width
[in]u32NewHeightNew height
[in]u32NewDepthNew depth
[in]eResizeModeFiltering mode
Returns
True if the method succeeds.
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.

Parameters
[in]sTextureTexture
[in]u32NewWidthNew width
[in]u32NewHeightNew height
[in]u32NewDepthNew depth
[in]i32XOffsetX Offset value from the top left corner
[in]i32YOffsetY Offset value from the top left corner
[in]i32ZOffsetZ Offset value from the top left corner
Returns
True if the method succeeds.
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.


Parameters
[in]sTextureTexture to rotate
[in]eRotationAxisRotation axis
[in]bForwardDirection of rotation; 1 = clockwise, 0 = anti-clockwise
Returns
True if the method succeeds or not.
bool PVR_DLL pvrtexture::SetChannels ( CPVRTexture &  sTexture,
uint32  uiNumChannelSets,
EChannelName *  eChannels,
uint32 *  pValues 
)

Sets the specified number of channels to values specified in pValues.


Parameters
[in]sTextureTexture
[in]uiNumChannelSetsNumber of channels to set
[in]eChannelsChannels to set
[in]pValuesuint32 values to set channels to
Returns
True if the method succeeds.
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.


Parameters
[in]sTextureTexture
[in]uiNumChannelSetsNumber of channels to set
[in]eChannelsChannels to set
[in]pValuesfloat values to set channels to
Returns
True if the method succeeds.
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.


Parameters
[in]sTextureTexture
[in]ptFormatPixel format type
[in]eChannelTypeChannel type
[in]eColourspaceColour space
[in]eQualityQuality for PVRTC and ETC compression
[in]bDoDitherDither the texture to lower precisions
Returns
True if the method succeeds.