- Main Page
- Classes
- Files
- Directories

- Class List
- Class Hierarchy
- Class Members

# cFileLoaderTGA Class Reference

Class that loads TGA files. More...

`#include <CFileLoaderTGA.h>`

List of all members.

## Public Member Functions
| cFileLoaderTGA ()
| Default constructor, does nothing.
| cFileLoaderTGA (const std::string &filename)
| Constructs the object and loads the given tga file.
virtual | ~cFileLoaderTGA ()
| Destructor, cleans up the memory.
bool | LoadFromFile (const std::string &filename)
| This method loads a tga file. It clears all the data if needed.
uint | GetAlphaDepth ()
uint | GetImageWidth ()
| this method returns the width of the image.
uint | GetImageHeight ()
| this method returns the height of the image.
uint | GetPixelDepth ()
byte * | GetPixels ()
LImageType | GetImageType ()
## Public Attributes
byte * | m_pixels
| this is the pixel buffer -> the image
## Protected Member Functions
void | Clear ()
| Clears all data.
## Protected Attributes
uint | m_pixelDepth
| the pixel depth of the image, including the alpha bits
uint | m_alphaDepth
| the depth of the alpha bitplane
uint | m_height
| the image height
uint | m_width
| the width of the image
LImageType | m_type
| image type, either rgb, rgba or greyscale
bool | m_loaded
| m_loaded is true if a file has been loaded

## Detailed Description

Class that loads TGA files.

## Member Function Documentation

uint cFileLoaderTGA::GetAlphaDepth | ( |  | ) |

this method retursn the depth of the alpha bitplane in the image it can be either 0 or 8.

uint cFileLoaderTGA::GetPixelDepth | ( |  | ) |

this method returns the pixel depth of the image. i.e. color depth. Can be 0 (no image loaded), 8 or 24. 16 bit images are not supported.

byte * cFileLoaderTGA::GetPixels | ( |  | ) |

this function returns the pointer to the image data. This pointer can be used for glTexImage2D, for example.

LImageType cFileLoaderTGA::GetImageType | ( |  | ) |

this function returns an image type. Imagetype can be either itUndefined (when no tga file has been loaded, itRGB (when GetAlphaDepth returns 0 and GetPixelDepth returns 24, itRGBA (when GetAlphaDepth returns 8 and GetPixelDepth returns 24), or itGreyscale (when GetAlphaDepth returns 0 and GetPixelDepth returns 8).

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

- chai3d/src/files/CFileLoaderTGA.h
- chai3d/src/files/CFileLoaderTGA.cpp