#include <Surface.h>
Inheritance diagram for Yukino::Surface:
Public Member Functions | |
Surface () | |
Constructor of the Surface class. | |
Surface (int w, int h, int bpp) | |
Constructor of the Surface class. | |
Surface (const string &file) | |
Constructor of the Surface class. | |
Surface (const char *file) | |
Constructor of the Surface class. | |
Surface (SDL_Surface *surface) | |
Constructor of the Surface class. | |
Surface (const Surface &obj) | |
Copy constructor of the Surface class. | |
virtual Surface & | operator= (Surface &obj) |
Operator = of the Surface class. | |
~Surface () | |
Destructor of the Surface class. | |
UINT | Create (int w, int h, int bpp) |
Function to create an image in target in the Surface. | |
UINT | SetColorKey (Uint32 color=COLOR_PINK) |
Function to put a color of transparency to the image. | |
UINT | Transform (void) |
Function to transform the format of the image to the one of the screen. | |
UINT | Fill (Uint32 color, Rect *rect=NULL) |
Function to fill up with a color a region of the image. | |
virtual UINT | Load (const char *file) |
Function to load a Surface from a file. | |
virtual UINT | Load (const string &file) |
Function to load a Surface from a file. | |
virtual UINT | Save (const char *file) |
Function to save a Surface in a file BMP. | |
virtual UINT | Save (const string &file) |
Function to save a Surface in a file BMP. | |
virtual void | Free (void) |
Function to release the data of the Surface object. | |
UINT | Copy (const Surface &objsrc, Rect *dst=NULL, Rect *src=NULL) |
Function to put in the image a region of a Surface. | |
UINT | Copy (const Surface &objsrc, int x, int y, Rect *src=NULL) |
Function to put in the image a region of a Surface. | |
UINT | Paste (Surface &objdst, Rect *dst=NULL, Rect *src=NULL) const |
Function to copy a region of the image in a Surface. | |
UINT | Paste (Surface &objdst, int x, int y, Rect *src=NULL) const |
Function to copy a region of the image in a Surface. | |
UINT | Copy (SDL_Surface *srfsrc, Rect *dst=NULL, Rect *src=NULL) |
Function to put in the image a region of a SDL_Surface. | |
UINT | Copy (SDL_Surface *srfsrc, int x, int y, Rect *src=NULL) |
Function to put in the image a region of a SDL_Surface. | |
UINT | Paste (SDL_Surface *srfdst, Rect *dst=NULL, Rect *src=NULL) const |
Function to copy a region of the image in a SDL_Surface. | |
UINT | Paste (SDL_Surface *srfdst, int x, int y, Rect *src=NULL) const |
Function to copy a region of the image in a SDL_Surface. |
The Surface class serves to store in memory an image contained in a file BMP, PNG, TGA, JPG, PCX, GIF, TIF, PNM, XPM, XCF or LBM. Once stored we can handle it to copy regions from a Surface to another one. And to add some effects.
Yukino::Surface::Surface | ( | ) |
Constructor of the Surface class.
Constructor by defect of the Surface class.
Yukino::Surface::Surface | ( | int | w, | |
int | h, | |||
int | bpp | |||
) |
Constructor of the Surface class.
Constructor of the Surface class, that creates a blank image.
w | Width of the image. | |
h | Height of the image. | |
bpp | Depth of color of the image. |
Yukino::Surface::Surface | ( | const string & | file | ) |
Constructor of the Surface class.
Constructor of the Surface class, that loads a file.
file | Path of the file. |
Yukino::Surface::Surface | ( | const char * | file | ) |
Constructor of the Surface class.
Constructor of the Surface class, that loads a file.
file | Path of the file. |
Yukino::Surface::Surface | ( | SDL_Surface * | surface | ) |
Constructor of the Surface class.
Constructor of the Surface class, that receives an image.
surface | The image. |
Yukino::Surface::Surface | ( | const Surface & | obj | ) |
Copy constructor of the Surface class.
obj | Surface object to copy. |
Yukino::Surface::~Surface | ( | ) |
UINT Yukino::Surface::Copy | ( | SDL_Surface * | srfsrc, | |
int | x, | |||
int | y, | |||
Rect * | src = NULL | |||
) |
Function to put in the image a region of a SDL_Surface.
This function serves to put a region determined of an image origin, in a coordinates of the image.
srfsrc | Source image. | |
x | Coordinate x. | |
y | Coordinate y. | |
src | Source area. |
Function to put in the image a region of a SDL_Surface.
This function serves to put a region determined of an image origin, in a region also determined of the image.
srfsrc | Source image. | |
dst | Destination area. | |
src | Source area. |
Function to put in the image a region of a Surface.
This function serves to put a region determined of an image origin, in a coordinates of the image.
objsrc | Source image. | |
x | Coordinate x. | |
y | Coordinate y. | |
src | Source area. |
Function to put in the image a region of a Surface.
This function serves to put a region determined of an image origin, in a region also determined of the image.
objsrc | Source image. | |
dst | Destination area. | |
src | Source area. |
UINT Yukino::Surface::Create | ( | int | w, | |
int | h, | |||
int | bpp | |||
) |
UINT Yukino::Surface::Fill | ( | Uint32 | color, | |
Rect * | rect = NULL | |||
) |
Function to fill up with a color a region of the image.
This function serves to fill up a region of the image, with a color.
color | Fill color. | |
rect | Destination area to fill. |
void Yukino::Surface::Free | ( | void | ) | [virtual] |
virtual UINT Yukino::Surface::Load | ( | const string & | file | ) | [inline, virtual] |
Function to load a Surface from a file.
This function serves to load a Surface from a file.
file | Path of the file. |
Reimplemented in Yukino::Sprite.
UINT Yukino::Surface::Load | ( | const char * | file | ) | [virtual] |
Function to load a Surface from a file.
This function serves to load a Surface from a file.
file | Path of the file. |
Reimplemented in Yukino::Sprite.
Operator = of the Surface class.
The obj object is copied in the actual object, and this is given back.
UINT Yukino::Surface::Paste | ( | SDL_Surface * | srfdst, | |
int | x, | |||
int | y, | |||
Rect * | src = NULL | |||
) | const |
Function to copy a region of the image in a SDL_Surface.
This function serves to copy a determined area of the image, in a coordinates of a destination image.
srfdst | Destination image. | |
x | Coordinate x. | |
y | Coordinate y. | |
src | Source area. |
Function to copy a region of the image in a SDL_Surface.
This function serves to copy a determined area of the image, in a region also determined of a destination image.
srfdst | Destination image. | |
dst | Destination area. | |
src | Source area. |
Function to copy a region of the image in a Surface.
This function serves to copy a determined area of the image, in a coordinates of a destination image.
objdst | Destination image. | |
x | Coordinate x. | |
y | Coordinate y. | |
src | Source area. |
Function to copy a region of the image in a Surface.
This function serves to copy a determined area of the image, in a region also determined of a destination image.
objdst | Destination image. | |
dst | Destination area. | |
src | Source area. |
virtual UINT Yukino::Surface::Save | ( | const string & | file | ) | [inline, virtual] |
UINT Yukino::Surface::Save | ( | const char * | file | ) | [virtual] |
UINT Yukino::Surface::SetColorKey | ( | Uint32 | color = COLOR_PINK |
) |
Function to put a color of transparency to the image.
This function serves so that the image can have transparency.
color | Key color. |
UINT Yukino::Surface::Transform | ( | void | ) |
Function to transform the format of the image to the one of the screen.
This function serves to transform the format of the stored image into the Surface, to the same format that has the screen buffer.