FIFE::Image Class Reference

#include <image.h>

Inheritance diagram for FIFE::Image:
Inheritance graph
[legend]
Collaboration diagram for FIFE::Image:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Image (SDL_Surface *surface)
 Image (const uint8_t *data, unsigned int width, unsigned int height)
virtual void render (const Rect &rect, SDL_Surface *dst, unsigned char alpha=255)=0
void render (const Rect &rect, unsigned char alpha=255)
SDL_Surface * detachSurface ()

Protected Member Functions

virtual void setClipArea (const Rect &cliparea, bool clear)=0
virtual void clearClipArea ()

Detailed Description

Base Class for Images.

Definition at line 123 of file image.h.


Constructor & Destructor Documentation

FIFE::Image::Image ( SDL_Surface *  surface  ) 

Constructor.

Note:
Takes ownership of the SDL Surface
Parameters:
surface SDL Surface in RGBA format

Definition at line 37 of file image.cpp.

FIFE::Image::Image ( const uint8_t *  data,
unsigned int  width,
unsigned int  height 
)

Constructor

Parameters:
data Pointer to the imagedata (needs to be in RGBA, 8 bits per channel).
width Width of the image.
height Height of the image.

Definition at line 42 of file image.cpp.


Member Function Documentation

void FIFE::Image::clearClipArea (  )  [protected, virtual]

Clears any possible clip areas

See also:
pushClipArea

Definition at line 171 of file image.cpp.

References setClipArea().

SDL_Surface * FIFE::Image::detachSurface (  ) 

Removes underlying SDL_Surface from the image (if exists) and returns this

Note:
this effectively causes SDL_Surface not to be freed on destruction

Definition at line 74 of file image.cpp.

void FIFE::Image::render ( const Rect rect,
unsigned char  alpha = 255 
)

Renders itself to the main screen at the rectangle rect. Convenience function

Parameters:
rect The position and clipping where to draw this image to.
alpha The alpha value, with which to draw self.

Definition at line 140 of file image.cpp.

References render().

virtual void FIFE::Image::render ( const Rect rect,
SDL_Surface *  dst,
unsigned char  alpha = 255 
) [pure virtual]

Renders itself to the Destination surface at the rectangle rect.

Parameters:
rect The position and clipping where to draw this image to.
target Target surface to draw to, e.g. main screen or other image
alpha The alpha value, with which to draw self. opaque by default.

Implemented in FIFE::GLImage, and FIFE::SDLImage.

Referenced by render(), and FIFE::SdlGuiGraphics::SdlGuiGraphics().

Here is the caller graph for this function:

virtual void FIFE::Image::setClipArea ( const Rect cliparea,
bool  clear 
) [protected, pure virtual]

Sets given clip area into image

See also:
pushClipArea

Implemented in FIFE::GLImage, and FIFE::SDLImage.

Referenced by clearClipArea().

Here is the caller graph for this function:


The documentation for this class was generated from the following files:
Generated by  doxygen 1.6.2-20100208