gcn::SDLImage Class Reference

#include <sdlimage.hpp>

Inheritance diagram for gcn::SDLImage:

gcn::Image List of all members.

Detailed Description

SDL implementation of Image.

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


Constructor & Destructor Documentation

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.

Parameters:
surface the surface from which to load.
autoFree true if the surface should automatically be deleted.

Definition at line 68 of file sdlimage.cpp.

References mAutoFree, and mSurface.


Member Function Documentation

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.

Returns:
the image height

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.

Parameters:
x the x coordinate.
y the y coordinate.
Returns:
the color of the pixel.

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.

Returns:
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.

Returns:
the image width

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).

Parameters:
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().


The documentation for this class was generated from the following files:
Generated on Sat Jul 29 19:38:49 2006 for Guichan by  doxygen 1.4.7