#include <imageloader.hpp>
Inheritance diagram for gcn::ImageLoader:
Contains basic image loading functions every image loader should have. Image loaders should inherit from this class and impements it's functions.
Definition at line 72 of file imageloader.hpp.
Public Member Functions | |
virtual | ~ImageLoader () |
Destructor. | |
virtual void | prepare (const std::string &filename)=0 |
Prepares an image for reading. | |
virtual void | free (Image *image)=0 |
This function frees an image. | |
virtual void * | getRawData ()=0 |
Rreturns a pointer of raw data of an image. | |
virtual void * | finalize ()=0 |
Finalizes an image meaning it will return the image data. | |
virtual void | discard ()=0 |
Discards a prepared image. | |
virtual int | getHeight () const =0 |
Gets the height if the image. | |
virtual int | getWidth () const =0 |
Gets the width of an image. | |
virtual Color | getPixel (int x, int y)=0 |
Gets the color of a pixel at coordinate x and y. | |
virtual void | putPixel (int x, int y, const Color &color)=0 |
Puts a pixel with a certain color at coordinate x and y. |
|
Discards a prepared image.
Implemented in gcn::AllegroImageLoader, gcn::OpenGLImageLoader, and gcn::SDLImageLoader. Referenced by gcn::OpenGLImageLoader::discard(), and gcn::OpenGLImageLoader::finalize(). |
|
Finalizes an image meaning it will return the image data. If the image contains pixels with "magic pink" (0xff00ff) they will be treated as transparent pixels.
Implemented in gcn::AllegroImageLoader, gcn::OpenGLImageLoader, and gcn::SDLImageLoader. Referenced by gcn::Image::Image(), and gcn::ImageFont::ImageFont(). |
|
This function frees an image. NOTE: There is generally no reason to call this function as it is called upon by the Image object when destroying an Image.
Implemented in gcn::AllegroImageLoader, gcn::OpenGLImageLoader, and gcn::SDLImageLoader. Referenced by gcn::Image::~Image(). |
|
Gets the height if the image.
Implemented in gcn::AllegroImageLoader, gcn::OpenGLImageLoader, and gcn::SDLImageLoader. Referenced by gcn::OpenGLImageLoader::finalize(), gcn::OpenGLImageLoader::getHeight(), gcn::Image::Image(), and gcn::ImageFont::ImageFont(). |
|
Gets the color of a pixel at coordinate x and y.
Implemented in gcn::AllegroImageLoader, gcn::OpenGLImageLoader, and gcn::SDLImageLoader. Referenced by gcn::OpenGLImageLoader::getPixel(), and gcn::ImageFont::ImageFont(). |
|
Rreturns a pointer of raw data of an image. The raw data is in 32 bit RGBA format. The funcion will not free a prepared image, so finalize or discard should be used afterwards.
Implemented in gcn::AllegroImageLoader, gcn::OpenGLImageLoader, and gcn::SDLImageLoader. Referenced by gcn::OpenGLImageLoader::finalize(), and gcn::OpenGLImageLoader::getRawData(). |
|
Gets the width of an image.
Implemented in gcn::AllegroImageLoader, gcn::OpenGLImageLoader, and gcn::SDLImageLoader. Referenced by gcn::OpenGLImageLoader::finalize(), gcn::OpenGLImageLoader::getWidth(), gcn::Image::Image(), and gcn::ImageFont::ImageFont(). |
|
Prepares an image for reading. After you have called this function you can retrieve information about it and edit it.
Implemented in gcn::AllegroImageLoader, gcn::OpenGLImageLoader, and gcn::SDLImageLoader. Referenced by gcn::Image::Image(), and gcn::OpenGLImageLoader::prepare(). |
|
Puts a pixel with a certain color at coordinate x and y.
Implemented in gcn::AllegroImageLoader, gcn::OpenGLImageLoader, and gcn::SDLImageLoader. Referenced by gcn::OpenGLImageLoader::putPixel(). |