iImage Struct Reference (Crystal Space 2.0 Public API Reference)

| ## Public API Reference

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions
iImage Struct Reference
2D

The iImage interface is used to work with image objects. More...

`#include <igraphic/image.h>`

Inheritance diagram for iImage:

List of all members.

## Public Member Functions
virtual const uint8 * | GetAlpha ()=0
| Get alpha map for 8-bit paletted image.
virtual csRef< iDataBuffer > | GetCookedImageData ()=0
| Return the "cooked" image data (the image data into which an image of non-"special" format may be processed).
virtual const char * | GetCookedImageFormat ()=0
| Return the "cooked" format of the image data (a non-"special" format into which image data may be processed).
virtual int | GetDepth () const =0
| Query image depth (only sensible when the image type is csimg3D)
virtual int | GetFormat () const =0
| Qyery image format (see CS_IMGFMT_XXX above)
virtual int | GetHeight () const =0
| Query image height.
virtual const void * | GetImageData ()=0
| Get image data: returns either (csRGBpixel *) or (unsigned char *) depending on format.
virtual csImageType | GetImageType () const =0
| Get the type of the contained image.
virtual void | GetKeyColor (int &r, int &g, int &b) const =0
| Get the keycolour stored with the image.
virtual csRef< iImage > | GetMipmap (uint num)=0
| Return a precomputed mipmap.
virtual const char * | GetName () const =0
| Get image file name.
virtual const csRGBpixel * | GetPalette ()=0
| Get image palette (or 0 if no palette)
virtual csRef< iDataBuffer > | GetRawData () const =0
| Get the raw data of the image (or 0 if raw data is not provided).
virtual const char * | GetRawFormat () const =0
| Get a string identifying the format of the raw data of the image (or 0 if raw data is not provided).
virtual csRef< iImage > | GetSubImage (uint num)=0
| Query a sub image.
virtual int | GetWidth () const =0
| Query image width.
virtual bool | HasKeyColor () const =0
| Check if image has a keycolour stored with it.
virtual uint | HasMipmaps () const =0
| Returns the number of mipmaps contained in the image (in case there exist any precalculated mipmaps), in addition to the original image.
virtual uint | HasSubImages () const =0
| Returns the number of sub images, in addition to this image.
virtual void | SetName (const char *iName)=0
| Set image file name.

## Detailed Description

The iImage interface is used to work with image objects.

You cannot manipulate the pixel data of iImage objects directly. To do this, you need to instantiate a your own copy of the image, e.g. by creating a csImageMemory instance (which allows access to the pixel data).

Raw and cooked image data
  For images the "raw" and "cooked" data is available. The raw data means the image data as read from the image file with little processing done; this means that the raw format can be a "special" format requiring some special algorithm to be translated into color data. The "cooked" data is the image data already translated into color data and is usually easier to deal with.

Main creators of instances implementing this interface:

- iImageIO::Load()

See also:
  csImageMemory, csImageManipulate, csImageTools, csImageCubeMapMaker, csImageVolumeMaker

Definition at line 104 of file image.h.

## Member Function Documentation

virtual const 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 csImageMemory, csCommonImageFile, csImageVolumeMaker, csImageCubeMapMaker, and csImageBase.

virtual csRef<iDataBuffer> iImage::GetCookedImageData | ( |  | ) | `[pure virtual]`

Return the "cooked" image data (the image data into which an image of non-"special" format may be processed).

See also:
  Texture format strings

Implemented in csImageBase.

virtual const char* iImage::GetCookedImageFormat | ( |  | ) | `[pure virtual]`

Return the "cooked" format of the image data (a non-"special" format into which image data may be processed).

See also:
  Texture format strings

Implemented in csImageBase.

virtual int iImage::GetDepth | ( |  | ) | const`[pure virtual]`

Query image depth (only sensible when the image type is csimg3D)

Implemented in csImageMemory, csImageVolumeMaker, and csImageBase.

virtual int iImage::GetFormat | ( |  | ) | const`[pure virtual]`

Qyery image format (see CS_IMGFMT_XXX above)

Implemented in csImageMemory, csImageVolumeMaker, csImageCubeMapMaker, and csGLScreenShot.

virtual int iImage::GetHeight | ( |  | ) | const`[pure virtual]`

Query image height.

Implemented in csImageMemory, csImageVolumeMaker, csImageCubeMapMaker, and csGLScreenShot.

virtual const 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 csCommonImageFile, csImageMemory, csImageVolumeMaker, csImageCubeMapMaker, and csGLScreenShot.

virtual csImageType iImage::GetImageType | ( |  | ) | const`[pure virtual]`

Get the type of the contained image.

Implemented in csImageMemory, csImageVolumeMaker, csImageCubeMapMaker, and csImageBase.

virtual void iImage::GetKeyColor | ( | int & | r,
|  | int & | g,
|  | int & | b
| ) |  | const`[pure virtual]`

Get the keycolour stored with the image.

Implemented in csCommonImageFile, csImageMemory, csImageCubeMapMaker, and csImageBase.

virtual csRef<iImage> iImage::GetMipmap | ( | uint | num | ) | `[pure virtual]`

Return a precomputed mipmap.

num specifies which mipmap to return; 0 returns the original image, num <= the return value of HasMipmaps() returns that mipmap.

Implemented in csImageMemory, csImageCubeMapMaker, and csImageBase.

virtual const char* iImage::GetName | ( |  | ) | const`[pure virtual]`

Get image file name.

Implemented in csImageVolumeMaker, csImageCubeMapMaker, and csImageBase.

virtual const csRGBpixel* iImage::GetPalette | ( |  | ) | `[pure virtual]`

Get image palette (or 0 if no palette)

Implemented in csImageMemory, csCommonImageFile, csImageVolumeMaker, csImageCubeMapMaker, and csImageBase.

virtual csRef<iDataBuffer> iImage::GetRawData | ( |  | ) | const`[pure virtual]`

Get the raw data of the image (or 0 if raw data is not provided).

Implemented in csCommonImageFile, csImageMemory, csImageVolumeMaker, csImageCubeMapMaker, and csGLScreenShot.

virtual const char* iImage::GetRawFormat | ( |  | ) | const`[pure virtual]`

Get a string identifying the format of the raw data of the image (or 0 if raw data is not provided).

The format string must be compatible with that supported by iTextureManager::CreateTexture().

See also:
  Texture format strings

Implemented in csCommonImageFile, csImageMemory, csImageVolumeMaker, csImageCubeMapMaker, and csGLScreenShot.

virtual csRef<iImage> iImage::GetSubImage | ( | uint | num | ) | `[pure virtual]`

Query a sub image.

A value of 0 for num returns the original image, a value larger or equal than the return value of HasSubImages() returns that sub image, any other value returns 0.

Implemented in csImageCubeMapMaker, and csImageBase.

virtual int iImage::GetWidth | ( |  | ) | const`[pure virtual]`

Query image width.

Implemented in csImageMemory, csImageVolumeMaker, csImageCubeMapMaker, and csGLScreenShot.

virtual bool iImage::HasKeyColor | ( |  | ) | const`[pure virtual]`

Check if image has a keycolour stored with it.

Implemented in csImageMemory, csCommonImageFile, csImageCubeMapMaker, and csImageBase.

virtual uint iImage::HasMipmaps | ( |  | ) | const`[pure virtual]`

Returns the number of mipmaps contained in the image (in case there exist any precalculated mipmaps), in addition to the original image.

0 means there are no precomputed mipmaps.

Implemented in csImageMemory, csImageCubeMapMaker, and csImageBase.

virtual uint iImage::HasSubImages | ( |  | ) | const`[pure virtual]`

Returns the number of sub images, in addition to this image.

Subimages are usually used for cube map faces.

Implemented in csImageCubeMapMaker, and csImageBase.

virtual void iImage::SetName | ( | const char * | iName | ) | `[pure virtual]`

Set image file name.

Implemented in csImageVolumeMaker, csImageCubeMapMaker, and csImageBase.

The documentation for this struct was generated from the following file:

- igraphic/image.h