Public Member Functions |
| image () |
| Default constructor.
|
| image (u_int16 l, u_int16 h, bool mode=true) |
| Creates an image with a specified size.
|
| image (SDL_Surface *s, const SDL_Color &color) |
| Create image from SDL_Surface.
|
| ~image () |
| Destructor.
|
void | resize (u_int16 l, u_int16 h) |
| Resize this image.
|
void | clear () |
| Resets the image to it's initial state, that is totally empty.
|
image & | operator= (const image &src) |
| Image copy (similar to copy ()).
|
void | copy (const image &src) |
| Synonym of operator = to guarantee its access from Python.
|
|
These methods allows you to load and save an image in different formats.
|
s_int8 | get (igzstream &file) |
| Loads an image from an opened file, saved in game internal format, with alpha and mask values.
|
s_int8 | load (string fname) |
| Loads an image from a file name, in game internal format, with alpha and mask values.
|
s_int8 | get_raw (igzstream &file) |
| Loads an image from an opened file, saved in game internal format, without alpha and mask values.
|
s_int8 | load_raw (string fname) |
| Loads an image from a file name, in game internal format, without alpha and mask values.
|
s_int8 | get_pnm (SDL_RWops *file) |
| Loads an image from an opened file, in PNM format, without alpha and mask values.
|
s_int8 | load_pnm (string fname) |
| Loads an image from a file name, in PNM format, without alpha and mask values.
|
s_int8 | put (ogzstream &file) const |
| Saves an image into an opened file, in game format, with alpha and mask values.
|
s_int8 | save (string fname) const |
| Saves an image into an file, in game format, with alpha and mask values.
|
s_int8 | put_raw (ogzstream &file) const |
| Saves an image into an opened file, in game format, without alpha and mask values.
|
s_int8 | save_raw (string fname) const |
| Saves an image into an file, in game format, without alpha and mask values.
|
s_int8 | put_pnm (SDL_RWops *file) const |
| Saves an image into an opened file, in PNM format, without alpha and mask values.
|
s_int8 | save_pnm (string fname) const |
| Saves an image into an file, in PNM format, without alpha and mask values.
|
|
Allows you to put fantasy in your image manipulations! Can eventually even be usefull...
|
void | zoom (const surface &src) |
| Zooms a surface.
|
void | zoom (const surface &src, u_int16 l, u_int16 h, u_int16 x=0, u_int16 y=0) |
| Zooms a surface.
|
void | zoom_to (const surface &src, u_int16 l, u_int16 h, u_int16 x=0, u_int16 y=0) |
| Synonym of zoom () to guarantee its access from Python.
|
void | tile (const surface &src) |
| Tiles a surface.
|
void | tile (const surface &src, u_int16 l, u_int16 h, u_int16 x=0, u_int16 y=0) |
| Tiles a surface.
|
void | tile_to (const surface &src, u_int16 l, u_int16 h, u_int16 x=0, u_int16 y=0) |
| Synonym of tile () to guarantee its access from Python.
|
void | brightness (const surface &src, u_int8 cont, bool proceed_mask=false) |
| Applies a "brightness" to a surface.
|
| surface (bool mode=true) |
| Default constructor.
|
virtual | ~surface () |
| Destructor.
|
surface & | operator= (surface &src) |
| Surface copy (similar to copy ()).
|
void | copy (surface &src) |
| Synonym of operator = to guarantee its access from Python.
|
bool | is_masked () const |
| Returns whether a surface is masked or not.
|
void | set_mask (bool m) |
| Sets the mask parameter of the surface.
|
u_int8 | alpha () const |
| Returns the alpha value of the surface.
|
void | set_alpha (u_int8 a) |
| Sets the alpha value of the surface.
|
bool | is_dbl_mode () const |
void | set_dbl_mode (bool mode) |
void | draw (s_int16 x, s_int16 y, const drawing_area *da_opt=NULL, surface *target=NULL) const |
| Draw the surface.
|
void | draw (s_int16 x, s_int16 y, s_int16 sx, s_int16 sy, u_int16 sl, u_int16 sh, const drawing_area *da_opt=NULL, surface *target=NULL) const |
| Draw a part of the surface.
|
void | draw_part (s_int16 x, s_int16 y, s_int16 sx, s_int16 sy, u_int16 sl, u_int16 sh, const drawing_area *da_opt=NULL, surface *target=NULL) const |
| Synonym of draw () to guarantee its access from Python.
|
void | fillrect (s_int16 x, s_int16 y, u_int16 l, u_int16 h, u_int32 col, drawing_area *da_opt=NULL) |
| Fills an area of the surface with a given color.
|
void | fillrect (s_int16 x, s_int16 y, u_int16 l, u_int16 h, u_int8 r, u_int8 g, u_int8 b, drawing_area *da_opt=NULL) |
| Fills an area of the surface with a given color.
|
void | fillrect_rgb (s_int16 x, s_int16 y, u_int16 l, u_int16 h, u_int8 r, u_int8 g, u_int8 b, drawing_area *da_opt=NULL) |
| Synonym of fillrect () to guarantee its access from Python.
|
void | lock () const |
| Locks the surface.
|
void | unlock () const |
| Unlock the surface after you've worked on it's pixels with the get_pix () and put_pix () methods.
|
void | put_pix (u_int16 x, u_int16 y, u_int32 col) |
| Puts a pixel of a given color.
|
void | put_pix (u_int16 x, u_int16 y, u_int8 r, u_int8 g, u_int8 b) |
| Puts a pixel of a given color.
|
void | put_pix_rgb (u_int16 x, u_int16 y, u_int8 r, u_int8 g, u_int8 b) |
| Synonym of put_pix () to guarantee its access from Python.
|
void | get_pix (u_int16 x, u_int16 y, u_int32 &col) const |
| Gets a pixel from the surface.
|
void | get_pix (u_int16 x, u_int16 y, u_int8 &r, u_int8 &g, u_int8 &b) const |
| Gets a pixel from a surface.
|
void | get_pix_rgb (u_int16 x, u_int16 y, u_int8 r, u_int8 g, u_int8 b) const |
| Synonym of get_pix () to guarantee its access from Python.
|
| drawable () |
| Default constructor.
|
virtual | ~drawable () |
| Destructor.
|
u_int16 | length () const |
| Returns the length of the drawable.
|
u_int16 | height () const |
| Returns the height of the drawable.
|
virtual bool | update () |
| Virtual update function, provided for objects which doesn't need one.
|
virtual bool | input_update () |
| Virtual input update function, provided for objects which doesn't need one.
|
Image manipulation class.
Designed to work with single images, without having to care about the bit depth. This class is widely used through the game - in fact it handles everything that is displayed on the screen. This class highly relies on surface, so you'll probably want to have a look at it before using image.
Definition at line 41 of file image.h.