Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | Related Pages

gcn::ImageLoader Class Reference

#include <imageloader.hpp>

Inheritance diagram for gcn::ImageLoader:

gcn::AllegroImageLoader gcn::OpenGLImageLoader gcn::SDLImageLoader List of all members.

Detailed Description

ImageLoaders base class.

Contains basic image loading functions every image loader should have. Image loaders should inherit from this class and impements it's functions.

Definition at line 72 of file imageloader.hpp.

Public Member Functions

virtual ~ImageLoader ()
 Destructor.
virtual void prepare (const std::string &filename)=0
 Prepares an image for reading.
virtual void free (Image *image)=0
 This function frees an image.
virtual void * getRawData ()=0
 Rreturns a pointer of raw data of an image.
virtual void * finalize ()=0
 Finalizes an image meaning it will return the image data.
virtual void discard ()=0
 Discards a prepared image.
virtual int getHeight () const =0
 Gets the height if the image.
virtual int getWidth () const =0
 Gets the width of an image.
virtual Color getPixel (int x, int y)=0
 Gets the color of a pixel at coordinate x and y.
virtual void putPixel (int x, int y, const Color &color)=0
 Puts a pixel with a certain color at coordinate x and y.


Member Function Documentation

virtual void gcn::ImageLoader::discard  )  [pure virtual]
 

Discards a prepared image.

Exceptions:
Exception when no image has been prepared.

Implemented in gcn::AllegroImageLoader, gcn::OpenGLImageLoader, and gcn::SDLImageLoader.

Referenced by gcn::OpenGLImageLoader::discard(), and gcn::OpenGLImageLoader::finalize().

virtual void* gcn::ImageLoader::finalize  )  [pure virtual]
 

Finalizes an image meaning it will return the image data.

If the image contains pixels with "magic pink" (0xff00ff) they will be treated as transparent pixels.

Returns:
a pointer to the image data.
Exceptions:
Exception when no image has been prepared.

Implemented in gcn::AllegroImageLoader, gcn::OpenGLImageLoader, and gcn::SDLImageLoader.

Referenced by gcn::Image::Image(), and gcn::ImageFont::ImageFont().

virtual void gcn::ImageLoader::free Image image  )  [pure virtual]
 

This function frees an image.

NOTE: There is generally no reason to call this function as it is called upon by the Image object when destroying an Image.

Parameters:
filename the file to be freed and removed.
Exceptions:
Exception when image points to NULL.

Implemented in gcn::AllegroImageLoader, gcn::OpenGLImageLoader, and gcn::SDLImageLoader.

Referenced by gcn::Image::~Image().

virtual int gcn::ImageLoader::getHeight  )  const [pure virtual]
 

Gets the height if the image.

Returns:
the height of the image.
Exceptions:
Exception if no image have been prepared.

Implemented in gcn::AllegroImageLoader, gcn::OpenGLImageLoader, and gcn::SDLImageLoader.

Referenced by gcn::OpenGLImageLoader::finalize(), gcn::OpenGLImageLoader::getHeight(), gcn::Image::Image(), and gcn::ImageFont::ImageFont().

virtual Color gcn::ImageLoader::getPixel int  x,
int  y
[pure virtual]
 

Gets the color of a pixel at coordinate x and y.

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

Implemented in gcn::AllegroImageLoader,  ) 

const [virtual]
 

Gets a width of a glyph.

Parameters:
glyph the glyph which width will be returned
Returns:
the width of a glyph

Definition at line 174 of file imagefont.cpp.

References gcn::Rectangle::width.

Referenced by drawString(), getStringIndexAt(), and getWidth().

void gcn::ImageFont::setGlyphSpacing int  spacing  )  [virtual]
 

Sets the spacing between letters in pixels.

Default is 0 pixels. The spacing can be negative.

Parameters:
spacing the spacing in pixels

Definition at line 229 of file imagefont.cpp.

void gcn::ImageFont::setRowSpacing int  spacing  )  [virtual]
 

Sets the spacing between rows in pixels.

Default is 0 pixels. The spacing can be negative.

Parameters:
spacing the spacing in pixels.

Definition at line 219 of file imagefont.cpp.


The documentation for this class was generated from the following files:
Generated on Tue May 17 21:23:26 2005 for Guichan by  doxygen 1.4.1
./usr/share/doc/libguichan/html/classgcn_1_1ImageFont.png0000644000000000000000000000060310242442256022177 0ustar rootrootPNG  IHDRaPPLTE`{tRNS@fIDATxA Ek>7'*?BLicEmñ.vv? Guichan: Member List
Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | Related Pages

gcn::ImageLoader Member List

This is the complete list of members for gcn::ImageLoader, including all inherited members.

discard()=0gcn::ImageLoader [pure virtual]
finalize()=0gcn::ImageLoader [pure virtual]
free(Image *image)=0gcn::ImageLoader [pure virtual]
getHeight() const =0gcn::ImageLoader [pure virtual]
getPixel(int x, int y)=0gcn::ImageLoader [pure virtual]
getRawData()=0gcn::ImageLoader [pure virtual]
getWidth() const =0gcn::ImageLoader