# cFileLoaderTGA Class Reference
[Files]

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 returns the depth of the alpha bitplane in the image it can be either 0 or 8.

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

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.

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

- D:/CHAI3D/build-2-0-0/2.0.0/win32/src/files/CFileLoaderTGA.h
- D:/CHAI3D/build-2-0-0/2.0.0/win32/src/files/CFileLoaderTGA.cpp

CHAI3D 2.0.0 documentation
Please address any questions to support@chai3d.org
(C) 2003-2009 - CHAI 3D
All Rights Reserved.