![]() |
Public API Reference |
The iImageIO interface is used to save and load graphic files. More...
#include <igraphic/imageio.h>
Public Types | |
| typedef csImageIOFileFormatDescription | FileFormatDescription |
| Description for a file format supported by an image loader. | |
Public Member Functions | |
| virtual const csImageIOFileFormatDescriptions & | GetDescription ()=0 |
| Propagate the image fileformats handled by this plugin. | |
| virtual csPtr< iImage > | Load (iDataBuffer *buf, int iFormat)=0 |
| Load an image from a buffer. | |
| virtual csPtr< iDataBuffer > | Save (iImage *image, FileFormatDescription *format, const char *extraoptions=0)=0 |
| Save an image using a prefered format. | |
| virtual csPtr< iDataBuffer > | Save (iImage *image, const char *mime=0, const char *extraoptions=0)=0 |
| Save an image using format MIME. | |
The iImageIO interface is used to save and load graphic files.
Main creators of instances implementing this interface:
Main ways to get pointers to this interface:
Main users of this interface:
| virtual const csImageIOFileFormatDescriptions& iImageIO::GetDescription | ( | ) | [pure virtual] |
Propagate the image fileformats handled by this plugin.
| virtual csPtr<iImage> iImageIO::Load | ( | iDataBuffer * | buf, |
| int | iFormat | ||
| ) | [pure virtual] |
Load an image from a buffer.
This routine will read from the buffer buf , try to recognize the type of image contained within, and return an csImageFile of the appropriate type. Returns a pointer to the iImage on success, or 0 on failure. The bits that fit the CS_IMGFMT_MASK mask are mandatory: the image always will be loaded in the appropiate format; the bits outside that mask (i.e. CS_IMGFMT_ALPHA) are optional: if the image does not contain alpha mask, the GetFormat() method of the image will return a value without that bit set.
| virtual csPtr<iDataBuffer> iImageIO::Save | ( | iImage * | image, |
| FileFormatDescription * | format, | ||
| const char * | extraoptions = 0 |
||
| ) | [pure virtual] |
Save an image using a prefered format.
extraoptions allows to specify additional output options. Those options consist of a comma-separated list and can be either 'option' or 'option=value'. The available options vary from plugin to plugin, some common ones are:
compress=# - Set image compression, from 0..100. Higher values give smaller files, but at the expense of quality(e.g. JPEG) or speed(e.g. PNG).
progressive - Progressive/interlaced encoding.
Examples:
compress=50
progressive,compress=30
| virtual csPtr<iDataBuffer> iImageIO::Save | ( | iImage * | image, |
| const char * | mime = 0, |
||
| const char * | extraoptions = 0 |
||
| ) | [pure virtual] |
Save an image using format MIME.
If omitted format selection is left to the plugin.