CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

iImageIO Struct Reference
[2D]

The iImageIO interface is used to save and load graphic files. More...

#include <imageio.h>

Inheritance diagram for iImageIO:

iBase List of all members.

Public Types

typedef csImageIOFileFormatDescription FileFormatDescription
 Description for a file format supported by an image loader. More...


Public Methods

virtual const csVectorGetDescription ()=0
 Propagate the image fileformats handled by this plugin. More...

virtual csPtr< iImageLoad (uint8 *iBuffer, uint32 iSize, int iFormat)=0
 Load an image from a buffer. More...

virtual void SetDithering (bool iEnable)=0
 Set global image dithering option. More...

virtual csPtr< iDataBufferSave (iImage *image, FileFormatDescription *format, const char *extraoptions=NULL)=0
 Save an image using a prefered format. More...

virtual csPtr< iDataBufferSave (iImage *image, const char *mime=NULL, const char *extraoptions=NULL)=0
 Save an image using format <mime>. More...


Detailed Description

The iImageIO interface is used to save and load graphic files.

Definition at line 59 of file imageio.h.


Member Typedef Documentation

typedef csImageIOFileFormatDescription iImageIO::FileFormatDescription
 

Description for a file format supported by an image loader.

Definition at line 62 of file imageio.h.


Member Function Documentation

virtual const csVector& iImageIO::GetDescription   [pure virtual]
 

Propagate the image fileformats handled by this plugin.

virtual csPtr<iImage> iImageIO::Load uint8   iBuffer,
uint32    iSize,
int    iFormat
[pure virtual]
 

Load an image from a buffer.

This routine will read from the buffer buf of length size, 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 NULL 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,
const char *    mime = NULL,
const char *    extraoptions = NULL
[pure virtual]
 

Save an image using format <mime>.

If omitted format selection is left to the plugin.

virtual csPtr<iDataBuffer> iImageIO::Save iImage   image,
FileFormatDescription   format,
const char *    extraoptions = NULL
[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 void iImageIO::SetDithering bool    iEnable [pure virtual]
 

Set global image dithering option.

By default this option is disabled. If you enable it, all images will be dithered both after loading and after mipmapping/scaling. This will affect all truecolor->paletted image conversions.


The documentation for this struct was generated from the following file:
Generated for Crystal Space by doxygen 1.2.14