_________ __ __ / _____// |_____________ _/ |______ ____ __ __ ______ \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/ / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ \ /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ > \/ \/ \//_____/ \/ ______________________ ______________________ T H E W A R B E G I N S Stratagus - A free fantasy real time strategy game engine
#include <image.h>
Public Member Functions | |
Image (void *data, int width, int height) | |
Image (const std::string &filename) | |
virtual | ~Image () |
virtual int | getWidth () const |
virtual int | getHeight () const |
virtual void * | _getData () const |
virtual bool | isDirty () const |
Static Public Member Functions | |
static ImageLoader * | _getImageLoader () |
static void | setImageLoader (ImageLoader *imageLoader) |
Protected Member Functions | |
Image () | |
Protected Attributes | |
void * | mData |
int | mWidth |
int | mHeight |
bool | mLoadedWithImageLoader |
Static Protected Attributes | |
static ImageLoader * | mImageLoader = NULL |
Holds an image. To be able to use this class you must first set an ImageLoader in Image by calling
The function is static. If this is not done, the constructor taking a filename will throw an exception. The ImageLoader you use must be compatible with the Graphics object you use.
EXAMPLE: If you use SDLGraphics you should use SDLImageLoader. Otherwise your program will crash in a most bizarre way.
Image::Image | ( | void * | data, |
int | width, | ||
int | height | ||
) |
Constructor.
data | the data of the image. |
width | the width of the image. |
height | the height of the image. |
Image::Image | ( | const std::string & | filename | ) |
Constructor.
filename | the filename of the image. |
Exception | when no ImageLoader exists. |
|
virtual |
Destructor. Unloads the image with the ImageLoader, if it was loaded with it.
|
protected |
Default constructor. It is protected so you can inherit from this class.
|
virtual |
Gets the data of the Image. Image data can be different things depending on what ImageLoader you use. If you for instance use the SDLImageLoader then an SDL_Surface will be returned.
|
static |
Gets the ImageLoader used for loading Images.
|
virtual |
|
virtual |
|
static |
Sets the ImageLoader to be used for loading images.
IMPORTANT: The ImageLoader is static and MUST be set before loading images!
imageLoader | the ImageLoader to be used for loading images. |
|
protected |
|
protected |
|
staticprotected |
|
protected |
|
protected |