#include <sdlimage.hpp>
Inheritance diagram for gcn::SDLImage:

Definition at line 73 of file sdlimage.hpp.
Public Member Functions | |
| SDLImage (SDL_Surface *surface, bool autoFree) | |
| Constructor. | |
| virtual | ~SDLImage () |
| Destructor. | |
| virtual SDL_Surface * | getSurface () const |
| Gets the SDL surface for the image. | |
| virtual void | free () |
| Frees an image. | |
| virtual int | getWidth () const |
| Gets the width of the Image. | |
| virtual int | getHeight () const |
| Gets the height of the Image. | |
| virtual Color | getPixel (int x, int y) |
| Gets the color of a pixel at coordinate (x, y) in the image. | |
| virtual void | putPixel (int x, int y, const Color &color) |
| Puts a pixel with a certain color at coordinate (x, y). | |
| virtual void | convertToDisplayFormat () |
| Converts the image, if possible, to display format. | |
Protected Attributes | |
| SDL_Surface * | mSurface |
| bool | mAutoFree |
| gcn::SDLImage::SDLImage | ( | SDL_Surface * | surface, | |
| bool | autoFree | |||
| ) |
Constructor.
Load an image from an SDL surface.
NOTE: The functions getPixel and putPixel are only guaranteed to work before an image has been converted to display format.
| surface | the surface from which to load. | |
| autoFree | true if the surface should automatically be deleted. |
Definition at line 68 of file sdlimage.cpp.
| void gcn::SDLImage::convertToDisplayFormat | ( | ) | [virtual] |
Converts the image, if possible, to display format.
IMPORTANT: Only guaranteed to work before the image has been converted to display format.
Implements gcn::Image.
Definition at line 127 of file sdlimage.cpp.
References mSurface.
| int gcn::SDLImage::getHeight | ( | ) | const [virtual] |
Gets the height of the Image.
Implements gcn::Image.
Definition at line 97 of file sdlimage.cpp.
References mSurface.
| Color gcn::SDLImage::getPixel | ( | int | x, | |
| int | y | |||
| ) | [virtual] |
Gets the color of a pixel at coordinate (x, y) in the image.
IMPORTANT: Only guaranteed to work before the image has been converted to display format.
| x | the x coordinate. | |
| y | the y coordinate. |
Implements gcn::Image.
Definition at line 107 of file sdlimage.cpp.
References mSurface, and gcn::SDLgetPixel().
| SDL_Surface * gcn::SDLImage::getSurface | ( | ) | const [virtual] |
Gets the SDL surface for the image.
Definition at line 82 of file sdlimage.cpp.
References mSurface.
Referenced by gcn::SDLGraphics::drawImage().
| int gcn::SDLImage::getWidth | ( | ) | const [virtual] |
Gets the width of the Image.
Implements gcn::Image.
Definition at line 87 of file sdlimage.cpp.
References mSurface.
| void gcn::SDLImage::putPixel | ( | int | x, | |
| int | y, | |||
| const Color & | color | |||
| ) | [virtual] |
Puts a pixel with a certain color at coordinate (x, y).
| x | the x coordinate. | |
| y | the y coordinate. | |
| color | the color of the pixel to put. |
Implements gcn::Image.
Definition at line 117 of file sdlimage.cpp.
References mSurface, and gcn::SDLputPixel().
1.4.7