mElite  1.0
An Elite clone based on TextElite by Jan-Philipp Kappmeier and Melanie Schmidt.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | List of all members
TextureLoaderTGA Class Reference

An implementation of the TextureLoader that can load Targa files. More...

#include <TextureLoaderTGA.h>

Inheritance diagram for TextureLoaderTGA:
TextureLoader

Public Member Functions

 TextureLoaderTGA (void)
 Default constructor, does nothing.
 
 ~TextureLoaderTGA (void)
 Default destructor, does nothing.
 
bool load (const std::string &filename)
 Loads a Targa image from disk.
 
bool write (const std::string &filename)
 Writes a Targa file.
 
- Public Member Functions inherited from TextureLoader
 TextureLoader (void)
 Default constructor. Initializes variables and does nothing.
 
 ~TextureLoader (void)
 Destructor. Frees image data, if an image has been loaded.
 
bool load (BYTE *data, unsigned int width, unsigned int height, unsigned int bpp)
 Load an image from memory.
 
unsigned int getWidth (void)
 Returns the width of the image.
 
unsigned int getHeight (void)
 Gets the height of the image.
 
unsigned int getBPP (void)
 Gets the bits per pixel of the image. This is usually 24 or 32.
 
GLenum getFormat (void)
 Gets the OpenGL format of the image data.
 
BYTE * getImage ()
 Gets the actual image data as byte array.
 
void useBGR (bool value)
 Sets the color order to blue, green, red by force.
 
bool useBGR (void)
 Determines if BGR coloring is used, or not.
 
bool isBGR (void)
 Trys to decide, if BGR is the appropriate ording for the format of the current image.
 
void toRGB (void)
 Converts the image from BGR to RBG, if the image data is in BGR ordering.
 
void toBGR (void)
 Converts the image from RGB to BGR, if the image data is in RGB ordering.
 

Additional Inherited Members

- Protected Member Functions inherited from TextureLoader
void setWidth (unsigned int width)
 Sets the width of the image.
 
void setHeight (unsigned int height)
 Sets the height of the image.
 
void setBPP (unsigned int bpp)
 Sets the number of bits per pixel for the image.
 
void setFormat (GLenum format)
 Sets the format of the image.
 
void setImage (BYTE **image)
 Sets the image data.
 
void setImage (BYTE *image)
 Sets the image data.
 
void bgr2rgb (unsigned __int8 colorMode)
 Convert the image data from BGR to RGB format.
 

Detailed Description

An implementation of the TextureLoader that can load Targa files.

This class is basically an extension to the TextureLoader class which is capable to load targa files. Therefore it overloads the load method of the base class.

Definition at line 17 of file TextureLoaderTGA.h.

Constructor & Destructor Documentation

TextureLoaderTGA::TextureLoaderTGA ( void  )

Default constructor, does nothing.

Definition at line 14 of file TextureLoaderTGA.cpp.

TextureLoaderTGA::~TextureLoaderTGA ( void  )

Default destructor, does nothing.

Definition at line 19 of file TextureLoaderTGA.cpp.

Member Function Documentation

bool TextureLoaderTGA::load ( const std::string &  filename)
virtual

Loads a Targa image from disk.

This function loads a targa file. Currently only uncompressed files are supported.

Parameters
filenameString with the filename
Returns
True if the loading was successful

Implements TextureLoader.

Definition at line 29 of file TextureLoaderTGA.cpp.

bool TextureLoaderTGA::write ( const std::string &  filename)
virtual

Writes a Targa file.

Writes an uncompressed targa file. This could be used to make screenshots.

Parameters
filenameString containing the filename
Returns
True if the writing was successful.

Implements TextureLoader.

Definition at line 88 of file TextureLoaderTGA.cpp.


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