CRM32Pro SDK
v5.22
|
IImage. More...
IImage.
Interface to manage images.
Public Member Functions | |
int | isBMP (const char *file) |
Check if the given file is a BMP. More... | |
int | isPNG (const char *file) |
Check if the given file is a PNG. More... | |
SDL_Surface * | Load (char *fileDPF, char *imgname, sHeaderIPF *header=NULL) |
Load an IPF from a DPF(using a filename) More... | |
SDL_Surface * | Load (int idDPF, char *imgname, sHeaderIPF *header=NULL) |
Load an IPF from a DPF(using an idDPF) More... | |
SDL_Surface * | LoadBMP (const char *filename) |
Load a BMP. More... | |
SDL_Surface * | LoadIMG (const char *filename) |
Load an image (BMP or PNG) More... | |
SDL_Surface * | LoadPNG (const char *filename) |
Load a PNG from an external file. More... | |
SDL_Surface * | LoadPNG (void *mem, int size) |
Load a PNG from a memory block. More... | |
int | Save (char *fileDPF, char *imgname, SDL_Surface *image) |
Save a surface into a DPF. More... | |
int | Save (int idDPF, char *imgname, SDL_Surface *image) |
Save a surface into a DPF. More... | |
int | SaveBMP (char *filename, SDL_Surface *surface) |
Save a given surface in an external BMP file. More... | |
int | SavePNG (char *filename, SDL_Surface *surface, int compression=IIMAGE_PNGCOMPRESS_DEFAULT) |
Save a given surface in an external PNG file. More... | |
int CRM32Pro_IImage::isBMP | ( | const char * | filename | ) |
Check if the given file is a BMP.
filename | Name of the BMP |
int CRM32Pro_IImage::isPNG | ( | const char * | filename | ) |
Check if the given file is a PNG.
filename | Name of the PNG |
SDL_Surface * CRM32Pro_IImage::Load | ( | char * | fileDPF, |
char * | imgname, | ||
sHeaderIPF * | header = NULL |
||
) |
Load an IPF from a DPF(using a filename)
fileDPF | Name of the DPF |
imgname | Image name stored in the DPF |
header | Deprecated. NULL by default. Pointer to an IPF header which will be filled up with the image info. |
SDL_Surface * CRM32Pro_IImage::Load | ( | int | idDPF, |
char * | imgname, | ||
sHeaderIPF * | header = NULL |
||
) |
Load an IPF from a DPF(using an idDPF)
idDPF | ID of the opened DPF |
imgname | Image name stored in the DPF |
header | Deprecated. NULL by default. Pointer to an IPF header which will be filled up with the image info. |
SDL_Surface * CRM32Pro_IImage::LoadBMP | ( | const char * | filename | ) |
Load a BMP.
If you do not want to auto convert the BMP surface to current screen format, you must use SDL_LoadBMP().
filename | Name of the BMP |
SDL_Surface * CRM32Pro_IImage::LoadIMG | ( | const char * | filename | ) |
Load an image (BMP or PNG)
It will try to open a BMP or a PNG and will convert the surface to the current screen format(if any).
It fully supports alpha per pixel PNGs.
filename | Name of the BMP or PNG |
SDL_Surface * CRM32Pro_IImage::LoadPNG | ( | const char * | filename | ) |
Load a PNG from an external file.
It will try to convert the surface to the current screen format(if any). It fully supports alpha per pixel PNGs.
filename | Name of the PNG |
SDL_Surface * CRM32Pro_IImage::LoadPNG | ( | void * | mem, |
int | size | ||
) |
Load a PNG from a memory block.
It will try to convert the surface to the current screen format(if any). It fully supports alpha per pixel PNGs.
mem | Pointer to the memory block that contains the PNG |
size | Size of the memory block |
int CRM32Pro_IImage::Save | ( | char * | fileDPF, |
char * | imgname, | ||
SDL_Surface * | image | ||
) |
Save a surface into a DPF.
fileDPF | name and optional path of a DPF to store this image |
imgname | Desired name to store your image in the DPF |
image | Pointer to a SDL_surface with your surface |
int CRM32Pro_IImage::Save | ( | int | idDPF, |
char * | imgname, | ||
SDL_Surface * | srcimage | ||
) |
Save a surface into a DPF.
idDPF | ID of the opened DPF |
imgname | Desired name to store your image in the DPF |
srcimage | Pointer to a SDL_surface with your surface |
int CRM32Pro_IImage::SaveBMP | ( | char * | filename, |
SDL_Surface * | surface | ||
) |
Save a given surface in an external BMP file.
If a BMP already exists, it will be replaced with the new one.
filename | Name and optional path of the BMP |
surface | Pointer to a SDL_surface with your surface |
int CRM32Pro_IImage::SavePNG | ( | char * | filename, |
SDL_Surface * | surface, | ||
int | compression = IIMAGE_PNGCOMPRESS_DEFAULT |
||
) |
Save a given surface in an external PNG file.
If a PNG already exists, it will be replaced with the new one.
filename | Name of the PNG |
surface | Pointer to a SDL_surface with your surface |
compression | Set desired compression value. From 0(minimum) to 9(maximum). By default, it is -1 (let pnglib chooses the level). |