Public Methods |
virtual | ~csImageFile () |
| Destroy the image file object and free all associated storage.
|
virtual void* | GetImageData () |
| Get image data: returns either (csRGBpixel *) or (unsigned char *) depending on format. More...
|
virtual int | GetWidth () |
| Query image width.
|
virtual int | GetHeight () |
| Query image height.
|
virtual int | GetSize () |
| Query image size in bytes.
|
virtual void | Rescale (int newwidth, int newheight) |
| Rescale the image to the given size.
|
virtual iImage* | MipMap (int step, csRGBpixel *transp) |
| Create a new csImageFile which is a mipmapped version of this one. More...
|
virtual void | SetName (const char *iName) |
| Set image file name.
|
virtual const char* | GetName () |
| Get image file name.
|
virtual int | GetFormat () |
| Get image format.
|
virtual csRGBpixel* | GetPalette () |
| Get image palette (or NULL if no palette).
|
virtual uint8* | GetAlpha () |
| Get alpha map for image.
|
virtual void | SetFormat (int iFormat) |
| Convert the image to another format.
|
virtual iImage* | Clone () |
| Create yet another image and copy this one into the new image.
|
virtual iImage* | Crop (int x, int y, int width, int height) |
| Create another image and copy a subpart of this image into the new image.
|
virtual void | CheckAlpha () |
| Check if all alpha values are "non-transparent" and if so, discard alpha.
|
virtual bool | HasKeycolor () |
| check if image has a keycolour stored with it.
|
virtual void | GetKeycolor (int &r, int &g, int &b) |
| get the keycolour stored with the image.
|
Public Attributes |
| SCF_DECLARE_IBASE |
Protected Methods |
| csImageFile (int iFormat) |
| csImageFile constructor. More...
|
void | set_dimensions (int w, int h) |
| Set the width and height. More...
|
void | convert_rgba (csRGBpixel *iImage) |
| Used to convert an truecolor RGB image into requested format. More...
|
void | convert_pal8 (uint8 *iImage, csRGBpixel *iPalette, int nPalColors=256) |
| Used to convert an 8-bit indexed image into requested format. More...
|
void | convert_pal8 (uint8 *iImage, csRGBcolor *iPalette, int nPalColors=256) |
| Same as above but accepts an array of csRGBcolor's as palette. More...
|
void | FreeImage () |
| Free all image data: pixels and palette. More...
|
int | closest_index (csRGBpixel *iColor) |
| Return the closest color index to given. Fails if image has no palette.
|
Protected Attributes |
int | Width |
| Width of image.
|
int | Height |
| Height of image.
|
void* | Image |
| The image data.
|
csRGBpixel* | Palette |
| The image palette or NULL.
|
uint8* | Alpha |
| The alpha map.
|
char* | fName |
| Image file name.
|
int | Format |
| Image format (see CS_IMGFMT_XXX above).
|
uint8 | has_keycolour |
| if it has a keycolour, and the keycolour values.
|
uint8 | keycolour_r |
| if it has a keycolour, and the keycolour values.
|
uint8 | keycolour_g |
| if it has a keycolour, and the keycolour values.
|
uint8 | keycolour_b |
| if it has a keycolour, and the keycolour values.
|
For every image type supported, a subclass should be created for loading that image type. The image file class contains a number of member functions for accessing and manipulating the image contents.