GLUS
Functions
glus_image_tga.h File Reference

Go to the source code of this file.

Functions

GLUSAPI GLUSboolean GLUSAPIENTRY glusImageCreateTga (GLUStgaimage *tgaimage, GLUSint width, GLUSint height, GLUSint depth, GLUSenum format)
 Creates a TGA image. More...
 
GLUSAPI GLUSboolean GLUSAPIENTRY glusImageLoadTga (const GLUSchar *filename, GLUStgaimage *tgaimage)
 Loads a TGA file. More...
 
GLUSAPI GLUSboolean GLUSAPIENTRY glusImageSaveTga (const GLUSchar *filename, const GLUStgaimage *tgaimage)
 Saves a TGA file. More...
 
GLUSAPI GLUSvoid GLUSAPIENTRY glusImageDestroyTga (GLUStgaimage *tgaimage)
 Destroys the content of a TGA structure. More...
 
GLUSAPI GLUSboolean GLUSAPIENTRY glusImageSampleTga2D (GLUSubyte rgba[4], const GLUStgaimage *tgaimage, const GLUSfloat st[2])
 Samples a RGBA color value from a TGA 2D image. More...
 
GLUSAPI GLUSboolean GLUSAPIENTRY glusImageConvertTga (GLUStgaimage *targetImage, const GLUStgaimage *sourceImage, const GLUSenum targetFormat)
 Converts a TGA image into another color format. More...
 

Function Documentation

GLUSAPI GLUSboolean GLUSAPIENTRY glusImageConvertTga ( GLUStgaimage targetImage,
const GLUStgaimage sourceImage,
const GLUSenum  targetFormat 
)

Converts a TGA image into another color format.

Source and target can not be the same.

Parameters
targetImageThe TGA image structure, containing the converted image.
sourceImageThe TGA image structure, which will be converted.
targetFormatThe target format of the image.
Returns
GLUS_TRUE, if conversion succeeded.
GLUSAPI GLUSboolean GLUSAPIENTRY glusImageCreateTga ( GLUStgaimage tgaimage,
GLUSint  width,
GLUSint  height,
GLUSint  depth,
GLUSenum  format 
)

Creates a TGA image.

Parameters
tgaimageThe structure to fill the TGA data.
widthWidth of the image.
heightHeight of the image.
depthDepth of the image.
formatFormat of the image.
Returns
GLUS_TRUE, if creating succeeded.
GLUSAPI GLUSvoid GLUSAPIENTRY glusImageDestroyTga ( GLUStgaimage tgaimage)

Destroys the content of a TGA structure.

Has to be called for freeing the resources.

Parameters
tgaimageThe TGA file structure.
GLUSAPI GLUSboolean GLUSAPIENTRY glusImageLoadTga ( const GLUSchar filename,
GLUStgaimage tgaimage 
)

Loads a TGA file.

Parameters
filenameThe name of the file to load.
tgaimageThe structure to fill the TGA data.
Returns
GLUS_TRUE, if loading succeeded.
GLUSAPI GLUSboolean GLUSAPIENTRY glusImageSampleTga2D ( GLUSubyte  rgba[4],
const GLUStgaimage tgaimage,
const GLUSfloat  st[2] 
)

Samples a RGBA color value from a TGA 2D image.

Sampling uses a bilinear filter.

Parameters
rgbaThe resulting, sampled RGBA color value.
tgaimageThe TGA image structure, containing the 2D texel data.
stTexture coordinate, where to sample the 2D texture.
Returns
GLUS_TRUE, if sampling succeeded.
GLUSAPI GLUSboolean GLUSAPIENTRY glusImageSaveTga ( const GLUSchar filename,
const GLUStgaimage tgaimage 
)

Saves a TGA file.

Parameters
filenameThe name of the file to save.
tgaimageThe structure with the TGA data.
Returns
GLUS_TRUE, if saving succeeded.