Google

Main Page   Class Hierarchy   Compound List   File List   Compound Members  

iImage Struct Reference

The iImage interface is used to work with image files (what did you expect?). More...

#include <image.h>

Inheritance diagram for iImage:

iBase csImageFile csImageMemory List of all members.

Public Methods

virtual void* GetImageData ()=0
 Get image data: returns either (csRGBpixel *) or (unsigned char *) depending on format. More...

virtual int GetWidth ()=0
 Query image width.

virtual int GetHeight ()=0
 Query image height.

virtual int GetSize ()=0
 Query image size in bytes.

virtual void Rescale (int NewWidth, int NewHeight)=0
 Rescale the image to the given size.

virtual iImage* MipMap (int step, csRGBpixel *transp)=0
 Create a new iImage which is a mipmapped version of this one. More...

virtual void SetName (const char *iName)=0
 Set image file name.

virtual const char* GetName ()=0
 Get image file name.

virtual int GetFormat ()=0
 Qyery image format (see CS_IMGFMT_XXX above).

virtual csRGBpixelGetPalette ()=0
 Get image palette (or NULL if no palette).

virtual uint8* GetAlpha ()=0
 Get alpha map for 8-bit paletted image. More...

virtual void SetFormat (int iFormat)=0
 Convert the image to another format. More...

virtual iImage* Clone ()=0
 Create yet another image and copy this one into the new image.

virtual iImage* Crop (int x, int y, int width, int height)=0
 Create a new image and copy a subpart of the actual image into the new image.

virtual void CheckAlpha ()=0
 Check if all alpha values are "non-transparent" and if so, discard alpha.

virtual bool HasKeycolor ()=0
 check if image has a keycolour stored with it.

virtual void GetKeycolor (int &r, int &g, int &b)=0
 get the keycolour stored with the image.


Detailed Description

The iImage interface is used to work with image files (what did you expect?).

Crystal Space supports loading of images in GIF, JPEG, PNG, SGI, TIFF etc formats, you can work with any image through this interface.


Member Function Documentation

uint8 * iImage::GetAlpha ( ) [pure virtual]
 

Get alpha map for 8-bit paletted image.

RGBA images contains alpha within themself. If image has no alpha map, or the image is in RGBA format, this function will return NULL.

Reimplemented in csImageFile, and csImageMemory.

void * iImage::GetImageData ( ) [pure virtual]
 

Get image data: returns either (csRGBpixel *) or (unsigned char *) depending on format.

Note that for RGBA images the csRGBpixel structure contains the alpha channel as well, so GetAlpha (see below) method will return NULL (because alpha is not stored separately, as for paletted images).

Reimplemented in csImageFile.

iImage * iImage::MipMap ( int step,
csRGBpixel * transp ) [pure virtual]
 

Create a new iImage which is a mipmapped version of this one.

'step' indicates how much the mipmap should be scaled down. Only steps 0, 1, 2, and 3 are supported. Step 0 returns the blended version of the image without image being scaled down. The new image will have same format as the original one. If you pass a pointer to a transparent color, the texels of that color are handled differently.

Reimplemented in csImageFile.

void iImage::SetFormat ( int iFormat ) [pure virtual]
 

Convert the image to another format.

This method will allocate a respective color component if it was not allocated before. For example, you can use this method to add alpha channel to paletted images, to allocate a image for CS_IMGFMT_NONE alphamaps or vice versa, to remove the image and leave alphamap alone. This routine may be used as well for removing alpha channel.

Reimplemented in csImageFile, and csImageMemory.


The documentation for this struct was generated from the following file:
Generated for Crystal Space by doxygen 1.2.5 written by Dimitri van Heesch, ©1997-2000