#include <image.h>


Public Member Functions | |
| Image (IResourceLoader *loader=0) | |
| Image (SDL_Surface *surface) | |
| Image (const uint8_t *data, uint32_t width, uint32_t height) | |
| virtual | ~Image () |
| virtual void | invalidate ()=0 |
| virtual void | render (const Rect &rect, uint8_t alpha=255, uint8_t const *rgb=0)=0 |
| SDL_Surface * | detachSurface () |
| virtual void | setSurface (SDL_Surface *surface)=0 |
| void | saveImage (const std::string &filename) |
| virtual void | useSharedImage (const ImagePtr &shared, const Rect ®ion)=0 |
| virtual void | forceLoadInternal ()=0 |
| bool | isSharedImage () const |
| const Rect & | getSubImageRect () const |
| virtual void | copySubimage (uint32_t xoffset, uint32_t yoffset, const ImagePtr &img) |
Static Public Member Functions | |
| static void | saveAsPng (const std::string &filename, const SDL_Surface &surface) |
Protected Member Functions | |
| void | reset (SDL_Surface *surface) |
Base Class for Images.
Definition at line 47 of file image.h.
| FIFE::Image::Image | ( | IResourceLoader * | loader = 0 |
) |
| FIFE::Image::Image | ( | SDL_Surface * | surface | ) |
| FIFE::Image::Image | ( | const uint8_t * | data, | |
| uint32_t | width, | |||
| uint32_t | height | |||
| ) |
| FIFE::Image::~Image | ( | ) | [virtual] |
| void FIFE::Image::copySubimage | ( | uint32_t | xoffset, | |
| uint32_t | yoffset, | |||
| const ImagePtr & | img | |||
| ) | [virtual] |
Copies given image into this one with respect to given offsets
Reimplemented in FIFE::GLImage, and FIFE::GLeImage.
Definition at line 310 of file image.cpp.
References getSubImageRect(), FIFE::RectType< T >::h, isSharedImage(), FIFE::RectType< T >::w, FIFE::RectType< T >::x, and FIFE::RectType< T >::y.
| SDL_Surface * FIFE::Image::detachSurface | ( | ) |
| virtual void FIFE::Image::forceLoadInternal | ( | ) | [pure virtual] |
Forces to load the image into internal memory of GPU
Implemented in FIFE::GLImage, FIFE::GLeImage, and FIFE::SDLImage.
| const Rect& FIFE::Image::getSubImageRect | ( | ) | const [inline] |
Returns area of the image it occupies in the shared image
Definition at line 147 of file image.h.
Referenced by copySubimage().

| virtual void FIFE::Image::invalidate | ( | ) | [pure virtual] |
Invalidates the Image causing it to be reset or re-loaded
Implemented in FIFE::GLImage, FIFE::GLeImage, and FIFE::SDLImage.
| bool FIFE::Image::isSharedImage | ( | ) | const [inline] |
Returns true if this image shares data with another one
Definition at line 143 of file image.h.
Referenced by copySubimage().

| virtual void FIFE::Image::render | ( | const Rect & | rect, | |
| uint8_t | alpha = 255, |
|||
| uint8_t const * | rgb = 0 | |||
| ) | [pure virtual] |
Renders itself to the current render target (main screen or attached destination image) at the rectangle rect. Convenience function
| rect | The position and clipping where to draw this image to. | |
| alpha | The alpha value, with which to draw self. | |
| rgb | The color value of overlay if any. |
Implemented in FIFE::GLImage, FIFE::GLeImage, and FIFE::SDLImage.
| void FIFE::Image::reset | ( | SDL_Surface * | surface | ) | [protected] |
Resets the image to default values (including the x and y shift values), frees the current surface and sets the surface to the passed SDL_Surface (which can be NULL).
| surface | the SDL_Surface to use for this image |
Definition at line 110 of file image.cpp.
Referenced by Image(), FIFE::SDLImage::setSurface(), FIFE::GLeImage::setSurface(), FIFE::GLImage::setSurface(), and ~Image().

| void FIFE::Image::saveAsPng | ( | const std::string & | filename, | |
| const SDL_Surface & | surface | |||
| ) | [static] |
Saves the SDL_Surface to png format
Definition at line 226 of file image.cpp.
Referenced by FIFE::RenderBackendOpenGLe::captureScreen(), and saveImage().

| void FIFE::Image::saveImage | ( | const std::string & | filename | ) |
Saves the image using given filename.
Definition at line 222 of file image.cpp.
References saveAsPng().
| virtual void FIFE::Image::setSurface | ( | SDL_Surface * | surface | ) | [pure virtual] |
This frees the current suface and replaces it with the surface passed in the parameter (which can be NULL).
| surface | the SDL_Surface to use for this image |
Implemented in FIFE::GLImage, FIFE::GLeImage, and FIFE::SDLImage.
| virtual void FIFE::Image::useSharedImage | ( | const ImagePtr & | shared, | |
| const Rect & | region | |||
| ) | [pure virtual] |
After this call all image data will be taken from the given image and its subregion
Implemented in FIFE::GLImage, FIFE::GLeImage, and FIFE::SDLImage.
1.7.1