mElite
1.0
An Elite clone based on TextElite by Jan-Philipp Kappmeier and Melanie Schmidt.
|
An implementation of the TextureLoader that can load Targa files. More...
#include <TextureLoaderTGA.h>
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. | |
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.
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.
|
virtual |
Loads a Targa image from disk.
This function loads a targa file. Currently only uncompressed files are supported.
filename | String with the filename |
Implements TextureLoader.
Definition at line 29 of file TextureLoaderTGA.cpp.
|
virtual |
Writes a Targa file.
Writes an uncompressed targa file. This could be used to make screenshots.
filename | String containing the filename |
Implements TextureLoader.
Definition at line 88 of file TextureLoaderTGA.cpp.