OpenGL ES SDK for Android ARM Developer Center
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MaliSDK::Texture Class Reference

Functions for working with textures. More...

#include <Texture.h>

Static Public Member Functions

static bool isETCSupported (bool verbose=false)
 Reports whether or not ETC (Ericsson Texture Compression) is supported. More...
 
static void createTexture (unsigned int width, unsigned int height, GLvoid **textureData)
 Create a texture using random data. More...
 
static void createTexture (unsigned int width, unsigned int height, unsigned int red, GLvoid **textureData)
 Create a 1 component texture of uniform colour. More...
 
static void createTexture (unsigned int width, unsigned int height, short red, short **textureData)
 Create uniform texture using given color with 1 short integer components. More...
 
static void deleteTextureData (GLvoid **textureData)
 Deletes previously created texture. More...
 
static void loadData (const char *filename, unsigned char **textureData)
 Load texture data from a file into memory. More...
 
static void loadPKMData (const char *filename, ETCHeader *etcHeader, unsigned char **textureData)
 Load header and texture data from a pkm file into memory. More...
 
static void loadCompressedMipmaps (const char *filenameBase, const char *filenameSuffix, GLuint *textureID)
 Load compressed mipmaps into memory. More...
 
static void reversePixelLine (float *destination, const float *source, int lineWidth)
 Copies float pixel data of one line of the image from source to destination in the reverse direction. More...
 
static bool isETCSupported (bool verbose=false)
 Reports whether or not ETC (Ericsson Texture Compression) is supported. More...
 
static void createTexture (unsigned int width, unsigned int height, GLvoid **textureData)
 Create a texture using random data. More...
 
static void createTexture (unsigned int width, unsigned int height, unsigned int red, GLvoid **textureData)
 Create a 1 component texture of uniform colour. More...
 
static void createTexture (unsigned int width, unsigned int height, short red, short **textureData)
 Create uniform texture using given color with 1 short integer components. More...
 
static void deleteTextureData (GLvoid **textureData)
 Deletes previously created texture. More...
 
static void loadData (const char *filename, unsigned char **textureData)
 Load texture data from a file into memory. More...
 
static void loadPKMData (const char *filename, ETCHeader *etcHeader, unsigned char **textureData)
 Load header and texture data from a pkm file into memory. More...
 
static void reversePixelLine (float *destination, const float *source, int lineWidth)
 Copies float pixel data of one line of the image from source to destination in the reverse direction. More...
 
static void createTexture (unsigned int width, unsigned int height, GLvoid **textureData)
 Create a texture using random data. More...
 
static void createTexture (unsigned int width, unsigned int height, unsigned int red, GLvoid **textureData)
 Create a 1 component texture of uniform colour. More...
 
static void createTexture (unsigned int width, unsigned int height, short red, short **textureData)
 Create uniform texture using given color with 1 short integer components. More...
 
static void deleteTextureData (GLvoid **textureData)
 Deletes previously created texture. More...
 
static bool isETCSupported (bool verbose=false)
 Reports whether or not ETC (Ericsson Texture Compression) is supported. More...
 
static void createTexture (unsigned int width, unsigned int height, GLvoid **textureData)
 Create a texture using random data. More...
 
static void createTexture (unsigned int width, unsigned int height, unsigned int red, GLvoid **textureData)
 Create a 1 component texture of uniform colour. More...
 
static void createTexture (unsigned int width, unsigned int height, short red, short **textureData)
 Create uniform texture using given color with 1 short integer components. More...
 
static void deleteTextureData (GLvoid **textureData)
 Deletes previously created texture. More...
 
static void loadData (const char *filename, unsigned char **textureData)
 Load texture data from a file into memory. More...
 
static void reversePixelLine (float *destination, const float *source, int lineWidth)
 Copies float pixel data of one line of the image from source to destination in the reverse direction. More...
 
static bool isETCSupported (bool verbose=false)
 Reports whether or not ETC (Ericsson Texture Compression) is supported. More...
 
static void createTexture (unsigned int width, unsigned int height, GLvoid **textureData)
 Create a texture using random data. More...
 
static void createTexture (unsigned int width, unsigned int height, unsigned int red, GLvoid **textureData)
 Create a 1 component texture of uniform colour. More...
 
static void createTexture (unsigned int width, unsigned int height, short red, short **textureData)
 Create uniform texture using given color with 1 short integer components. More...
 
static void deleteTextureData (GLvoid **textureData)
 Deletes previously created texture. More...
 
static void loadData (const char *filename, unsigned char **textureData)
 Load texture data from a file into memory. More...
 
static void reversePixelLine (float *destination, const float *source, int lineWidth)
 Copies float pixel data of one line of the image from source to destination in the reverse direction. More...
 
static void loadBmpImageData (const char *fileName, int *imageWidthPtr, int *imageHeightPtr, unsigned char **textureDataPtrPtr)
 Load BMP texture data from a file into memory. More...
 
static void loadBmpImageData (const char *fileName, int *imageWidthPtr, int *imageHeightPtr, unsigned char **textureDataPtrPtr)
 Load BMP texture data from a file into memory. More...
 

Static Private Member Functions

static void getCompressedTextureFormats (GLint **textureFormats, int *numberOfTextureFormats)
 Uses glGetIntegerv to get the number of compressed texture formats and the formats themselves. More...
 
static void getCompressedTextureFormats (GLint **textureFormats, int *numberOfTextureFormats)
 Uses glGetIntegerv to get the number of compressed texture formats and the formats themselves. More...
 
static void getCompressedTextureFormats (GLint **textureFormats, int *numberOfTextureFormats)
 Uses glGetIntegerv to get the number of compressed texture formats and the formats themselves. More...
 
static void getCompressedTextureFormats (GLint **textureFormats, int *numberOfTextureFormats)
 Uses glGetIntegerv to get the number of compressed texture formats and the formats themselves. More...
 
static void readBitmapFileHeader (FILE *filePtr, tagBITMAPFILEHEADER *bitmapFileHeaderPtr)
 Read BMP file header. More...
 
static void readBitmapInforHeader (FILE *filePtr, tagBITMAPINFOHEADER *bitmapInfoHeaderPtr)
 Read BMP info header. More...
 
static void readBitmapFileHeader (FILE *filePtr, tagBITMAPFILEHEADER *bitmapFileHeaderPtr)
 Read BMP file header. More...
 
static void readBitmapInforHeader (FILE *filePtr, tagBITMAPINFOHEADER *bitmapInfoHeaderPtr)
 Read BMP info header. More...
 

Detailed Description

Functions for working with textures.

Definition at line 39 of file Texture.h.

Member Function Documentation

static void MaliSDK::Texture::createTexture ( unsigned int  width,
unsigned int  height,
GLvoid **  textureData 
)
static

Create a texture using random data.

Parameters
[in]widthThe required width of the texture.
[in]heightThe required height of the texture.
[in]textureDataA pointer to the created texture data.
static void MaliSDK::Texture::createTexture ( unsigned int  width,
unsigned int  height,
unsigned int  red,
GLvoid **  textureData 
)
static

Create a 1 component texture of uniform colour.

Parameters
[in]widthThe required width of the texture.
[in]heightThe required height of the texture.
[in]redThe required red channel.
[out]textureDataOutput texture.
static void MaliSDK::Texture::createTexture ( unsigned int  width,
unsigned int  height,
GLvoid **  textureData 
)
static

Create a texture using random data.

Parameters
[in]widthThe required width of the texture.
[in]heightThe required height of the texture.
[in]textureDataA pointer to the created texture data.
static void MaliSDK::Texture::createTexture ( unsigned int  width,
unsigned int  height,
GLvoid **  textureData 
)
static

Create a texture using random data.

Parameters
[in]widthThe required width of the texture.
[in]heightThe required height of the texture.
[in]textureDataA pointer to the created texture data.
static void MaliSDK::Texture::createTexture ( unsigned int  width,
unsigned int  height,
GLvoid **  textureData 
)
static

Create a texture using random data.

Parameters
[in]widthThe required width of the texture.
[in]heightThe required height of the texture.
[in]textureDataA pointer to the created texture data.
static void MaliSDK::Texture::createTexture ( unsigned int  width,
unsigned int  height,
short  red,
short **  textureData 
)
static

Create uniform texture using given color with 1 short integer components.

Parameters
[in]widthThe required width of the texture.
[in]heightThe required height of the texture.
[in]redThe required red channel.
[out]textureDataOutput texture.
static void MaliSDK::Texture::createTexture ( unsigned int  width,
unsigned int  height,
unsigned int  red,
GLvoid **  textureData 
)
static

Create a 1 component texture of uniform colour.

Parameters
[in]widthThe required width of the texture.
[in]heightThe required height of the texture.
[in]redThe required red channel.
[out]textureDataOutput texture.
void MaliSDK::Texture::createTexture ( unsigned int  width,
unsigned int  height,
GLvoid **  textureData 
)
static

Create a texture using random data.

Parameters
[in]widthThe required width of the texture.
[in]heightThe required height of the texture.
[in]textureDataA pointer to the created texture data.

Definition at line 103 of file Texture.cpp.

static void MaliSDK::Texture::createTexture ( unsigned int  width,
unsigned int  height,
unsigned int  red,
GLvoid **  textureData 
)
static

Create a 1 component texture of uniform colour.

Parameters
[in]widthThe required width of the texture.
[in]heightThe required height of the texture.
[in]redThe required red channel.
[out]textureDataOutput texture.
static void MaliSDK::Texture::createTexture ( unsigned int  width,
unsigned int  height,
unsigned int  red,
GLvoid **  textureData 
)
static

Create a 1 component texture of uniform colour.

Parameters
[in]widthThe required width of the texture.
[in]heightThe required height of the texture.
[in]redThe required red channel.
[out]textureDataOutput texture.
static void MaliSDK::Texture::createTexture ( unsigned int  width,
unsigned int  height,
short  red,
short **  textureData 
)
static

Create uniform texture using given color with 1 short integer components.

Parameters
[in]widthThe required width of the texture.
[in]heightThe required height of the texture.
[in]redThe required red channel.
[out]textureDataOutput texture.
void MaliSDK::Texture::createTexture ( unsigned int  width,
unsigned int  height,
unsigned int  red,
GLvoid **  textureData 
)
static

Create a 1 component texture of uniform colour.

Parameters
[in]widthThe required width of the texture.
[in]heightThe required height of the texture.
[in]redThe required red channel.
[out]textureDataOutput texture.

Definition at line 129 of file Texture.cpp.

static void MaliSDK::Texture::createTexture ( unsigned int  width,
unsigned int  height,
short  red,
short **  textureData 
)
static

Create uniform texture using given color with 1 short integer components.

Parameters
[in]widthThe required width of the texture.
[in]heightThe required height of the texture.
[in]redThe required red channel.
[out]textureDataOutput texture.
static void MaliSDK::Texture::createTexture ( unsigned int  width,
unsigned int  height,
short  red,
short **  textureData 
)
static

Create uniform texture using given color with 1 short integer components.

Parameters
[in]widthThe required width of the texture.
[in]heightThe required height of the texture.
[in]redThe required red channel.
[out]textureDataOutput texture.
void MaliSDK::Texture::createTexture ( unsigned int  width,
unsigned int  height,
short  red,
short **  textureData 
)
static

Create uniform texture using given color with 1 short integer components.

Parameters
[in]widthThe required width of the texture.
[in]heightThe required height of the texture.
[in]redThe required red channel.
[out]textureDataOutput texture.

Definition at line 146 of file Texture.cpp.

static void MaliSDK::Texture::deleteTextureData ( GLvoid **  textureData)
static

Deletes previously created texture.

Parameters
[in]textureDataTexture to be deleted.
static void MaliSDK::Texture::deleteTextureData ( GLvoid **  textureData)
static

Deletes previously created texture.

Parameters
[in]textureDataTexture to be deleted.
static void MaliSDK::Texture::deleteTextureData ( GLvoid **  textureData)
static

Deletes previously created texture.

Parameters
[in]textureDataTexture to be deleted.
static void MaliSDK::Texture::deleteTextureData ( GLvoid **  textureData)
static

Deletes previously created texture.

Parameters
[in]textureDataTexture to be deleted.
void MaliSDK::Texture::deleteTextureData ( GLvoid **  textureData)
static

Deletes previously created texture.

Parameters
[in]textureDataTexture to be deleted.

Definition at line 162 of file Texture.cpp.

static void MaliSDK::Texture::getCompressedTextureFormats ( GLint **  textureFormats,
int numberOfTextureFormats 
)
staticprivate

Uses glGetIntegerv to get the number of compressed texture formats and the formats themselves.

Calls glGetIntegerv with GL_NUM_COMPRESSED_TEXTURE_FORMATS and GL_COMPRESSED_TEXTURE_FORMATS.

Parameters
[out]textureFormatsPointer to the array of texture formats.
[out]numberOfTextureFormatsPointer to the number of compressed texture formats.
static void MaliSDK::Texture::getCompressedTextureFormats ( GLint **  textureFormats,
int numberOfTextureFormats 
)
staticprivate

Uses glGetIntegerv to get the number of compressed texture formats and the formats themselves.

Calls glGetIntegerv with GL_NUM_COMPRESSED_TEXTURE_FORMATS and GL_COMPRESSED_TEXTURE_FORMATS.

Parameters
[out]textureFormatsPointer to the array of texture formats.
[out]numberOfTextureFormatsPointer to the number of compressed texture formats.
static void MaliSDK::Texture::getCompressedTextureFormats ( GLint **  textureFormats,
int numberOfTextureFormats 
)
staticprivate

Uses glGetIntegerv to get the number of compressed texture formats and the formats themselves.

Calls glGetIntegerv with GL_NUM_COMPRESSED_TEXTURE_FORMATS and GL_COMPRESSED_TEXTURE_FORMATS.

Parameters
[out]textureFormatsPointer to the array of texture formats.
[out]numberOfTextureFormatsPointer to the number of compressed texture formats.
void MaliSDK::Texture::getCompressedTextureFormats ( GLint **  textureFormats,
int numberOfTextureFormats 
)
staticprivate

Uses glGetIntegerv to get the number of compressed texture formats and the formats themselves.

Calls glGetIntegerv with GL_NUM_COMPRESSED_TEXTURE_FORMATS and GL_COMPRESSED_TEXTURE_FORMATS.

Parameters
[out]textureFormatsPointer to the array of texture formats.
[out]numberOfTextureFormatsPointer to the number of compressed texture formats.

Definition at line 38 of file Texture.cpp.

static bool MaliSDK::Texture::isETCSupported ( bool  verbose = false)
static

Reports whether or not ETC (Ericsson Texture Compression) is supported.

Uses getCompressedTextureFormats to get the list of supported compression formats and then checks to see if any of them are GL_ETC1_RGB8_OES.

Parameters
[in]verboseIf true, prints out the number of supported texture compression formats and then lists the formats supported.
static bool MaliSDK::Texture::isETCSupported ( bool  verbose = false)
static

Reports whether or not ETC (Ericsson Texture Compression) is supported.

Uses getCompressedTextureFormats to get the list of supported compression formats and then checks to see if any of them are GL_ETC1_RGB8_OES.

Parameters
[in]verboseIf true, prints out the number of supported texture compression formats and then lists the formats supported.
static bool MaliSDK::Texture::isETCSupported ( bool  verbose = false)
static

Reports whether or not ETC (Ericsson Texture Compression) is supported.

Uses getCompressedTextureFormats to get the list of supported compression formats and then checks to see if any of them are GL_ETC1_RGB8_OES.

Parameters
[in]verboseIf true, prints out the number of supported texture compression formats and then lists the formats supported.
bool MaliSDK::Texture::isETCSupported ( bool  verbose = false)
static

Reports whether or not ETC (Ericsson Texture Compression) is supported.

Uses getCompressedTextureFormats to get the list of supported compression formats and then checks to see if any of them are GL_ETC1_RGB8_OES.

Parameters
[in]verboseIf true, prints out the number of supported texture compression formats and then lists the formats supported.

Definition at line 46 of file Texture.cpp.

void MaliSDK::Texture::loadBmpImageData ( const char *  fileName,
int imageWidthPtr,
int imageHeightPtr,
unsigned char **  textureDataPtrPtr 
)
static

Load BMP texture data from a file into memory.

Parameters
fileNameThe filename of the texture to be loaded. Cannot be NULL.
imageWidthPtrDeref will be used to store image width.
imageHeightPtrDeref will be used to store image height.
textureDataPtrPtrPointer to a memory where loaded texture data will be stored. Cannot be NULL.

Definition at line 26 of file Texture.cpp.

static void MaliSDK::Texture::loadBmpImageData ( const char *  fileName,
int imageWidthPtr,
int imageHeightPtr,
unsigned char **  textureDataPtrPtr 
)
static

Load BMP texture data from a file into memory.

Parameters
fileNameThe filename of the texture to be loaded. Cannot be NULL.
imageWidthPtrDeref will be used to store image width.
imageHeightPtrDeref will be used to store image height.
textureDataPtrPtrPointer to a memory where loaded texture data will be stored. Cannot be NULL.
void MaliSDK::Texture::loadCompressedMipmaps ( const char *  filenameBase,
const char *  filenameSuffix,
GLuint textureID 
)
static

Load compressed mipmaps into memory.

Load the base level, calculate how many Mipmap levels there are. Load the PKM files into memory. Load the data into the texture mipmap levels.

Parameters
[in]filenameBaseThe base filename of the texture mipmap levels. Will have the mipmap level number appended to it to load all of the mipmap levels. For example, if filenameBase = "texture_", this method will try to load the files "texture_0", "texture_1", "texture_2", etc..
[in]filenameSuffixAny suffix to the mipmap filenames. Most commonly used for file extensions. For example, if filenameSuffix = ".pkm", this method will append ".pkm" to all the files it tries to load.
[out]textureIDThe texture ID of the texture that has been loaded.

Definition at line 232 of file Texture.cpp.

static void MaliSDK::Texture::loadData ( const char *  filename,
unsigned char **  textureData 
)
static

Load texture data from a file into memory.

Parameters
[in]filenameThe filename of the texture to load.
[out]textureDataPointer to the texture that has been loaded.
static void MaliSDK::Texture::loadData ( const char *  filename,
unsigned char **  textureData 
)
static

Load texture data from a file into memory.

Parameters
[in]filenameThe filename of the texture to load.
[out]textureDataPointer to the texture that has been loaded.
static void MaliSDK::Texture::loadData ( const char *  filename,
unsigned char **  textureData 
)
static

Load texture data from a file into memory.

Parameters
[in]filenameThe filename of the texture to load.
[out]textureDataPointer to the texture that has been loaded.
void MaliSDK::Texture::loadData ( const char *  filename,
unsigned char **  textureData 
)
static

Load texture data from a file into memory.

Parameters
[in]filenameThe filename of the texture to load.
[out]textureDataPointer to the texture that has been loaded.

Definition at line 167 of file Texture.cpp.

static void MaliSDK::Texture::loadPKMData ( const char *  filename,
ETCHeader etcHeader,
unsigned char **  textureData 
)
static

Load header and texture data from a pkm file into memory.

Parameters
[in]filenameThe filename of the texture to load.
[out]etcHeaderPointer to the header that has been loaded.
[out]textureDataPointer to the texture that has been loaded.
void MaliSDK::Texture::loadPKMData ( const char *  filename,
ETCHeader etcHeader,
unsigned char **  textureData 
)
static

Load header and texture data from a pkm file into memory.

Parameters
[in]filenameThe filename of the texture to load.
[out]etcHeaderPointer to the header that has been loaded.
[out]textureDataPointer to the texture that has been loaded.

Definition at line 199 of file Texture.cpp.

void MaliSDK::Texture::readBitmapFileHeader ( FILE *  filePtr,
tagBITMAPFILEHEADER bitmapFileHeaderPtr 
)
staticprivate

Read BMP file header.

Parameters
filePtrFile pointer where BMP file header data is stored. Cannot be NULL.
bitmapFileHeaderPtrDeref will be used to store loaded data. Cannot be NULL.

Definition at line 94 of file Texture.cpp.

static void MaliSDK::Texture::readBitmapFileHeader ( FILE *  filePtr,
tagBITMAPFILEHEADER bitmapFileHeaderPtr 
)
staticprivate

Read BMP file header.

Parameters
filePtrFile pointer where BMP file header data is stored. Cannot be NULL.
bitmapFileHeaderPtrDeref will be used to store loaded data. Cannot be NULL.
void MaliSDK::Texture::readBitmapInforHeader ( FILE *  filePtr,
tagBITMAPINFOHEADER bitmapInfoHeaderPtr 
)
staticprivate

Read BMP info header.

Parameters
filePtrFile pointer where BMP info header data is stored. Cannot be NULL.
bitmapInfoHeaderPtrDeref will be used to store loaded data. Cannot be NULL.

Definition at line 112 of file Texture.cpp.

static void MaliSDK::Texture::readBitmapInforHeader ( FILE *  filePtr,
tagBITMAPINFOHEADER bitmapInfoHeaderPtr 
)
staticprivate

Read BMP info header.

Parameters
filePtrFile pointer where BMP info header data is stored. Cannot be NULL.
bitmapInfoHeaderPtrDeref will be used to store loaded data. Cannot be NULL.
static void MaliSDK::Texture::reversePixelLine ( float destination,
const float source,
int  lineWidth 
)
static

Copies float pixel data of one line of the image from source to destination in the reverse direction.

Parameters
[out]destinationPlace in memory where the reversed data will be copied to. Cannot be NULL.
[in]sourcePlace from which the copying should start from. Cannot be NULL.
[in]lineWidthNumber of RGB pixels that will be copied.
static void MaliSDK::Texture::reversePixelLine ( float destination,
const float source,
int  lineWidth 
)
static

Copies float pixel data of one line of the image from source to destination in the reverse direction.

Parameters
[out]destinationPlace in memory where the reversed data will be copied to. Cannot be NULL.
[in]sourcePlace from which the copying should start from. Cannot be NULL.
[in]lineWidthNumber of RGB pixels that will be copied.
static void MaliSDK::Texture::reversePixelLine ( float destination,
const float source,
int  lineWidth 
)
static

Copies float pixel data of one line of the image from source to destination in the reverse direction.

Parameters
[out]destinationPlace in memory where the reversed data will be copied to. Cannot be NULL.
[in]sourcePlace from which the copying should start from. Cannot be NULL.
[in]lineWidthNumber of RGB pixels that will be copied.
void MaliSDK::Texture::reversePixelLine ( float destination,
const float source,
int  lineWidth 
)
static

Copies float pixel data of one line of the image from source to destination in the reverse direction.

Parameters
[out]destinationPlace in memory where the reversed data will be copied to. Cannot be NULL.
[in]sourcePlace from which the copying should start from. Cannot be NULL.
[in]lineWidthNumber of RGB pixels that will be copied.

Definition at line 318 of file Texture.cpp.


The documentation for this class was generated from the following files: