#include <image.hpp>
To be able to use this class you must first set an ImageLoader in Image by calling
Image::setImageLoader(myImageLoader)
EXAMPLE: If you use SDLGraphics you should use SDLImageLoader. Otherwise your program will crash in a most bizarre way.
Definition at line 76 of file image.hpp.
Public Member Functions | |
Image (void *data, int width, int height) | |
Constructor. | |
Image (const std::string &filename) | |
Constructor. | |
virtual | ~Image () |
Destructor. | |
virtual int | getWidth () const |
Gets the width of the Image. | |
virtual int | getHeight () const |
Gets the height of the Image. | |
virtual void * | _getData () const |
Gets the data of the Image. | |
Static Public Member Functions | |
static ImageLoader * | _getImageLoader () |
Gets the ImageLoader used for loading Images. | |
static void | setImageLoader (ImageLoader *imageLoader) |
Sets the ImageLoader to be used for loading images. | |
Protected Member Functions | |
Image () | |
Default constructor. | |
Protected Attributes | |
void * | mData |
int | mWidth |
int | mHeight |
bool | mLoadedWithImageLoader |
Static Protected Attributes | |
static ImageLoader * | mImageLoader = NULL |
|
Constructor.
|
|
Constructor.
Definition at line 80 of file image.cpp. References gcn::ImageLoader::finalize(), gcn::ImageLoader::getHeight(), gcn::ImageLoader::getWidth(), and gcn::ImageLoader::prepare(). |
|
Destructor. Unloads the image with the ImageLoader, if it was loaded with it. Definition at line 94 of file image.cpp. References gcn::ImageLoader::free(). |
|
Default constructor. It is protected so you can inherit from this class. |
|
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.
|
|
Gets the ImageLoader used for loading Images.
|
|
Gets the height of the Image.
|
|
Gets the width of the Image.
|
|
Sets the ImageLoader to be used for loading images. IMPORTANT: The ImageLoader is static and MUST be set before loading images!
|