![]() |
Public API Reference |
![]() |
The iImage interface is used to work with image objects. More...
#include <igraphic/image.h>
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. |
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).
Main creators of instances implementing this interface:
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).
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).
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().
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.