____ _ __
/ __ )____ _____ | | / /___ ___________
/ __ / __ \/ ___/ | | /| / / __ `/ ___/ ___/
/ /_/ / /_/ (__ ) | |/ |/ / /_/ / / (__ )
/_____/\____/____/ |__/|__/\__,_/_/ /____/
A futuristic real-time strategy game.
This file is part of Bos Wars.
(C) Copyright 2001-2007 by the Bos Wars and Stratagus Project.
Distributed under the "GNU General Public License"#include <imageloader.h>

Public Member Functions | |
| virtual | ~ImageLoader () |
| virtual void | prepare (const std::string &filename)=0 |
| virtual void | free (Image *image)=0 |
| virtual void * | getRawData ()=0 |
| virtual void * | finalize ()=0 |
| virtual void | discard ()=0 |
| virtual int | getHeight () const =0 |
| virtual int | getWidth () const =0 |
| virtual Color | getPixel (int x, int y)=0 |
| virtual void | putPixel (int x, int y, const Color &color)=0 |
Definition at line 72 of file imageloader.h.
| virtual gcn::ImageLoader::~ImageLoader | ( | ) | [inline, virtual] |
Destructor.
Definition at line 79 of file imageloader.h.
| virtual void gcn::ImageLoader::prepare | ( | const std::string & | filename | ) | [pure virtual] |
Prepares an image for reading. After you have called this function you can retrieve information about it and edit it.
| filename | the image file to prepare. |
| Exception | when called without having finalized or disposed to last image or when unable to load the image. |
Implemented in gcn::SDLImageLoader.
Referenced by gcn::Image::Image(), and gcn::ImageFont::ImageFont().
| virtual void gcn::ImageLoader::free | ( | Image * | image | ) | [pure virtual] |
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.
| image | the image to be freed and removed. |
| Exception | when image points to NULL. |
Implemented in gcn::SDLImageLoader.
Referenced by gcn::Image::~Image(), and gcn::ImageFont::~ImageFont().
| virtual void* gcn::ImageLoader::getRawData | ( | ) | [pure virtual] |
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::SDLImageLoader.
| virtual void* gcn::ImageLoader::finalize | ( | ) | [pure virtual] |
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.
| Exception | when no image has been prepared. |
Implemented in gcn::SDLImageLoader.
Referenced by gcn::Image::Image(), and gcn::ImageFont::ImageFont().
| virtual void gcn::ImageLoader::discard | ( | ) | [pure virtual] |
Discards a prepared image.
| Exception | when no image has been prepared. |
Implemented in gcn::SDLImageLoader.
| virtual int gcn::ImageLoader::getHeight | ( | ) | const [pure virtual] |
Gets the height if the image.
| Exception | if no image have been prepared. |
Implemented in gcn::SDLImageLoader.
Referenced by gcn::ImageFont::addGlyph(), gcn::Image::Image(), and gcn::ImageFont::ImageFont().
| virtual int gcn::ImageLoader::getWidth | ( | ) | const [pure virtual] |
Gets the width of an image.
| Exception | if no image have been prepared. |
Implemented in gcn::SDLImageLoader.
Referenced by gcn::ImageFont::addGlyph(), gcn::Image::Image(), and gcn::ImageFont::ImageFont().
| virtual Color gcn::ImageLoader::getPixel | ( | int | x, | |
| int | y | |||
| ) | [pure virtual] |
Gets the color of a pixel at coordinate x and y.
| x | the x coordinate. | |
| y | the y coordinate. |
Implemented in gcn::SDLImageLoader.
Referenced by gcn::ImageFont::addGlyph(), and gcn::ImageFont::ImageFont().
| virtual void gcn::ImageLoader::putPixel | ( | int | x, | |
| int | y, | |||
| const Color & | color | |||
| ) | [pure virtual] |
Puts a pixel with a certain color at coordinate x and y.
| x | the x coordinate. | |
| y | the y coordinate. | |
| color | the color of the pixel to put. |
Implemented in gcn::SDLImageLoader.
1.5.6