e2d::graphics::Image Class Reference

Inheritance diagram for e2d::graphics::Image:


List of all members.

Detailed Description

Responsible for reading image files from disk and blitting them onto other surfaces, including the framebuffer.

Public Member Functions

 Image (const Image &original)
 Copy constructor.
void Blit (SDL_Surface *destination, Rect *part=NULL)
 Blits the image to destination.
ImageDataGetData ()
 Gets the raw data.
void Load (const char *filename)
 Loads the image from a file.

Constructor & Destructor Documentation

e2d::graphics::Image::Image ( const Image original  ) 

Makes a copy of another image.

original image to copy data from.

Member Function Documentation

void e2d::graphics::Image::Blit ( SDL_Surface *  destination,
Rect part = NULL 

Blits the loaded image to the destination. The image will be blitted having its upper-left corner at position X, Y of the destination, where X and Y are this image's X and Y attributes inherited from Rect.

destination Pointer to an SDL_Surface where the image will be blitted (may be the Video::framebuffer or another image's surface).
part If you want only part of this image to be blitted, set a Rect with sizes smaller than this image and pass it as a parameter here. The reference point (0,0) is the upper-left corner of this image.

ImageData * e2d::graphics::Image::GetData (  ) 

Accesses the image's raw data.

void e2d::graphics::Image::Load ( const char *  filename  ) 

Loads an image file. Whenever you load an image using this method, it's ImageData will be automatically added to (or recovered from) the ResourceMap using the filename as the resource name. For more information on file types supported, see ImageData::Load.

filename Path to the image file.
e2d::core::Exception if the file could not be loaded.

Generated on Tue Dec 8 10:32:45 2009 for Easy2D by  doxygen 1.5.6