#include <allegroimage.hpp>
Inheritance diagram for gcn::AllegroImage:
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 |
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.
bitmap | the bitmap from which to load. | |
autoFree | true if the surface should automatically be deleted. |
Definition at line 67 of file allegroimage.cpp.
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.
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.
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.
x | the x coordinate. | |
y | the y coordinate. |
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.
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).
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.