____ _ __
/ __ )____ _____ | | / /___ ___________
/ __ / __ \/ ___/ | | /| / / __ `/ ___/ ___/
/ /_/ / /_/ (__ ) | |/ |/ / /_/ / / (__ )
/_____/\____/____/ |__/|__/\__,_/_/ /____/
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 <sdlimageloader.h>

Public Member Functions | |
| SDLImageLoader () | |
| virtual void | prepare (const std::string &filename) |
| virtual void | free (Image *image) |
| virtual void * | getRawData () |
| virtual void * | finalize () |
| virtual void | discard () |
| virtual int | getHeight () const |
| virtual int | getWidth () const |
| virtual Color | getPixel (int x, int y) |
| virtual void | putPixel (int x, int y, const Color &color) |
Protected Attributes | |
| SDL_Surface * | mCurrentImage |
Definition at line 71 of file sdlimageloader.h.
| gcn::SDLImageLoader::SDLImageLoader | ( | ) |
Constructor.
| virtual void gcn::SDLImageLoader::prepare | ( | const std::string & | filename | ) | [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. |
Implements gcn::ImageLoader.
| virtual void gcn::SDLImageLoader::free | ( | Image * | image | ) | [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. |
Implements gcn::ImageLoader.
| virtual void* gcn::SDLImageLoader::getRawData | ( | ) | [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.
Implements gcn::ImageLoader.
| virtual void* gcn::SDLImageLoader::finalize | ( | ) | [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. |
Implements gcn::ImageLoader.
| virtual void gcn::SDLImageLoader::discard | ( | ) | [virtual] |
Discards a prepared image.
| Exception | when no image has been prepared. |
Implements gcn::ImageLoader.
| virtual int gcn::SDLImageLoader::getHeight | ( | ) | const [virtual] |
Gets the height if the image.
| Exception | if no image have been prepared. |
Implements gcn::ImageLoader.
| virtual int gcn::SDLImageLoader::getWidth | ( | ) | const [virtual] |
Gets the width of an image.
| Exception | if no image have been prepared. |
Implements gcn::ImageLoader.
| virtual Color gcn::SDLImageLoader::getPixel | ( | int | x, | |
| int | y | |||
| ) | [virtual] |
Gets the color of a pixel at coordinate x and y.
| x | the x coordinate. | |
| y | the y coordinate. |
Implements gcn::ImageLoader.
| virtual void gcn::SDLImageLoader::putPixel | ( | int | x, | |
| int | y, | |||
| const Color & | color | |||
| ) | [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. |
Implements gcn::ImageLoader.
SDL_Surface* gcn::SDLImageLoader::mCurrentImage [protected] |
Definition at line 102 of file sdlimageloader.h.
1.5.6