FIFE 2008.0
FIFE::Image Class Reference

#include <image.h>

Inheritance diagram for FIFE::Image:
Collaboration diagram for FIFE::Image:

List of all members.

Public Member Functions

 Image (SDL_Surface *surface)
 Image (const uint8_t *data, unsigned int width, unsigned int height)
virtual void invalidate ()=0
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 138 of file image.h.


Constructor & Destructor Documentation

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

Constructor.

Note:
Takes ownership of the SDL Surface
Parameters:
surfaceSDL 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:
dataPointer to the imagedata (needs to be in RGBA, 8 bits per channel).
widthWidth of the image.
heightHeight 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.

virtual void FIFE::Image::invalidate ( ) [pure virtual]

Invalidates the Image causing it to be reset or re-loaded

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

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:
rectThe position and clipping where to draw this image to.
targetTarget surface to draw to, e.g. main screen or other image
alphaThe alpha value, with which to draw self. opaque by default.

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

Referenced by FIFE::Cursor::draw(), and render().

Here is the caller graph for this function:

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

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

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

Definition at line 140 of file image.cpp.

References render().

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:
 All Classes Namespaces Functions Variables Enumerations Enumerator