gcn::AllegroImage Class Reference

#include <allegroimage.hpp>

Inheritance diagram for gcn::AllegroImage:

gcn::Image List of all members.

Detailed Description

Allegro implementation of Image.

Definition at line 72 of file allegroimage.hpp.

Public Member Functions

 AllegroImage (BITMAP *bitmap, bool autoFree)
 Constructor.
virtual ~AllegroImage ()
 Destructor.
virtual BITMAP * getBitmap () const
 Gets the Allegro bitmap 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

BITMAP * mBitmap
bool mAutoFree


Constructor & Destructor Documentation

gcn::AllegroImage::AllegroImage ( BITMAP *  bitmap,
bool  autoFree 
)

Constructor.

Load an image from an Allegro BITMAP.

NOTE: The functions getPixel and putPixel are only guaranteed to work before an image has been converted to display format.

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

Definition at line 67 of file allegroimage.cpp.

References mAutoFree, and mBitmap.


Member Function Documentation

void gcn::AllegroImage::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 135 of file allegroimage.cpp.

References mBitmap.

BITMAP * gcn::AllegroImage::getBitmap (  )  const [virtual]

Gets the Allegro bitmap for the image.

Returns:
the Allegro bitmap for the image.

Definition at line 81 of file allegroimage.cpp.

References mBitmap.

Referenced by gcn::AllegroGraphics::drawImage().

int gcn::AllegroImage::getHeight (  )  const [virtual]

Gets the height of the Image.

Returns:
the image height

Implements gcn::Image.

Definition at line 101 of file allegroimage.cpp.

References mBitmap.

Color gcn::AllegroImage::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 111 of file allegroimage.cpp.

References mBitmap.

int gcn::AllegroImage::getWidth (  )  const [virtual]

Gets the width of the Image.

Returns:
the image width

Implements gcn::Image.

Definition at line 91 of file allegroimage.cpp.

References mBitmap.

void gcn::AllegroImage::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 123 of file allegroimage.cpp.

References gcn::Color::a, gcn::Color::b, gcn::Color::g, mBitmap, and gcn::Color::r.


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