CrystalSpace

Public API Reference

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

iImage Struct Reference
[2D]

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. More...

virtual int GetHeight ()=0
 Query image height. More...

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

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

virtual csPtr< 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. More...

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

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

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

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

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

virtual csPtr< iImage > Clone ()=0
 Create yet another image and copy this one into the new image. More...

virtual csPtr< 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. More...

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

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

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

virtual csPtr< iImage > Sharpen (csRGBpixel *transp, int strength)=0
 Create a sharpened copy of the image. More...

virtual int HasMipmaps ()=0
 Returns the number of mipmaps contained in the image (in case there exist any precalculated mipmaps. More...


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 etc formats, you can work with any image through this interface.

Definition at line 71 of file image.h.


Member Function Documentation

virtual void iImage::CheckAlpha   [pure virtual]
 

Check if all alpha values are "non-transparent" and if so, discard alpha.

Implemented in csImageFile.

virtual csPtr<iImage> iImage::Clone   [pure virtual]
 

Create yet another image and copy this one into the new image.

Implemented in csImageFile.

virtual csPtr<iImage> iImage::Crop int    x,
int    y,
int    width,
int    height
[pure virtual]
 

Create a new image and copy a subpart of the actual image into the new image.

Implemented in csImageFile.

virtual 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 0.

Implemented in csImageFile.

virtual int iImage::GetFormat   [pure virtual]
 

Qyery image format (see CS_IMGFMT_XXX above).

Implemented in csImageFile.

virtual int iImage::GetHeight   [pure virtual]
 

Query image height.

Implemented in csImageFile.

virtual 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 0 (because alpha is not stored separately, as for paletted images).

Implemented in csImageFile.

virtual void iImage::GetKeycolor int &    r,
int &    g,
int &    b
[pure virtual]
 

get the keycolour stored with the image.

Implemented in csImageFile.

virtual const char* iImage::GetName   [pure virtual]
 

Get image file name.

Implemented in csImageFile.

virtual csRGBpixel* iImage::GetPalette   [pure virtual]
 

Get image palette (or 0 if no palette).

Implemented in csImageFile.

virtual int iImage::GetSize   [pure virtual]
 

Query image size in bytes.

Implemented in csImageFile.

virtual int iImage::GetWidth   [pure virtual]
 

Query image width.

Implemented in csImageFile.

virtual bool iImage::HasKeycolor   [pure virtual]
 

check if image has a keycolour stored with it.

Implemented in csImageFile.

virtual int iImage::HasMipmaps   [pure virtual]
 

Returns the number of mipmaps contained in the image (in case there exist any precalculated mipmaps.

Implemented in csImageFile.

virtual csPtr<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. Step 0 returns a blurred version of the image without image being scaled down. Step 1 scales the image down to 1/2. Steps > 1 repeat this 'step' times. 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.

Implemented in csImageFile.

virtual void iImage::Rescale int    NewWidth,
int    NewHeight
[pure virtual]
 

Rescale the image to the given size.

Implemented in csImageFile.

virtual 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.

Implemented in csImageFile.

virtual void iImage::SetName const char *    iName [pure virtual]
 

Set image file name.

Implemented in csImageFile.

virtual csPtr<iImage> iImage::Sharpen csRGBpixel   transp,
int    strength
[pure virtual]
 

Create a sharpened copy of the image.

The effect of 'strength' differs from image to image. Values around 128-512 give good results. On really blurry images values up to 1024 or 2048 can be used.

Implemented in csImageFile.


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