![]() |
Public API Reference |
Wrapper class to create a cube map from a number of 2D images as the cube faces. More...
#include <csgfx/imagecubemapmaker.h>
Public Member Functions | |
| csImageCubeMapMaker () | |
| Create a new map without faces set. | |
| csImageCubeMapMaker (iImage *source) | |
| Create a new map and copy the faces from source. | |
| csImageCubeMapMaker (iImage *posX, iImage *negX, iImage *posY, iImage *negY, iImage *posZ, iImage *negZ) | |
| Create a new map from separately specified Positive X, Positive Y etc. | |
| virtual const uint8 * | GetAlpha () |
| Get alpha map for 8-bit paletted image. | |
| virtual int | GetFormat () const |
| Qyery image format (see CS_IMGFMT_XXX above) | |
| virtual int | GetHeight () const |
| Query image height. | |
| virtual const void * | GetImageData () |
| Get image data: returns either (csRGBpixel *) or (unsigned char *) depending on format. | |
| virtual csImageType | GetImageType () const |
| Get the type of the contained image. | |
| virtual void | GetKeyColor (int &, int &, int &) const |
| Get the keycolour stored with the image. | |
| virtual csRef< iImage > | GetMipmap (uint num) |
| Return a precomputed mipmap. | |
| virtual const char * | GetName () const |
| Get the name of the image. | |
| virtual const csRGBpixel * | GetPalette () |
| Get image palette (or 0 if no palette) | |
| virtual csRef< iDataBuffer > | GetRawData () const |
| Get the raw data of the image (or 0 if raw data is not provided). | |
| virtual const char * | GetRawFormat () const |
| 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) |
| Query a sub image. | |
| virtual int | GetWidth () const |
| Query image width. | |
| virtual bool | HasKeyColor () const |
| Check if image has a keycolour stored with it. | |
| virtual uint | HasMipmaps () const |
| 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 |
| Returns the number of sub images, in addition to this image. | |
| virtual void | SetName (const char *iName) |
| Set the name of the image. | |
| void | SetSubImage (uint num, iImage *image) |
| Set a specific face. | |
| bool | SubImageSet (uint num) |
| Check whether a face is specified. | |
Protected Types | |
| enum | { NUM_FACES = 6 } |
Protected Member Functions | |
| void | CheckImage (int index) |
| Ensure that the image at index is valid. | |
| void | UpdateName () |
| Update the image name from the contained images. | |
Protected Attributes | |
| csRef< iImage > | cubeImages [NUM_FACES] |
| The cube face images. | |
| bool | manualName |
| Whether the name was manually overridden (in this case it is not updated when the contained images are changed). | |
Wrapper class to create a cube map from a number of 2D images as the cube faces.
Ensures that all faces are available when requested, if necessary by creating a new image (the famous and popular image-not-found checkerboard).
Definition at line 41 of file imagecubemapmaker.h.
anonymous enum [protected] |
Definition at line 45 of file imagecubemapmaker.h.
Create a new map without faces set.
| csImageCubeMapMaker::csImageCubeMapMaker | ( | iImage * | source | ) |
Create a new map and copy the faces from source.
| csImageCubeMapMaker::csImageCubeMapMaker | ( | iImage * | posX, |
| iImage * | negX, | ||
| iImage * | posY, | ||
| iImage * | negY, | ||
| iImage * | posZ, | ||
| iImage * | negZ | ||
| ) |
Create a new map from separately specified Positive X, Positive Y etc.
images.
| void csImageCubeMapMaker::CheckImage | ( | int | index | ) | [protected] |
Ensure that the image at index is valid.
| virtual const uint8* csImageCubeMapMaker::GetAlpha | ( | ) | [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.
Reimplemented from csImageBase.
| virtual int csImageCubeMapMaker::GetFormat | ( | ) | const [virtual] |
Qyery image format (see CS_IMGFMT_XXX above)
Implements iImage.
| virtual int csImageCubeMapMaker::GetHeight | ( | ) | const [virtual] |
Query image height.
Implements iImage.
| virtual const void* csImageCubeMapMaker::GetImageData | ( | ) | [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).
Implements iImage.
| virtual csImageType csImageCubeMapMaker::GetImageType | ( | ) | const [inline, virtual] |
Get the type of the contained image.
Reimplemented from csImageBase.
Definition at line 104 of file imagecubemapmaker.h.
| virtual void csImageCubeMapMaker::GetKeyColor | ( | int & | r, |
| int & | g, | ||
| int & | b | ||
| ) | const [inline, virtual] |
Get the keycolour stored with the image.
Reimplemented from csImageBase.
Definition at line 97 of file imagecubemapmaker.h.
| virtual csRef<iImage> csImageCubeMapMaker::GetMipmap | ( | uint | num | ) | [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.
Reimplemented from csImageBase.
| virtual const char* csImageCubeMapMaker::GetName | ( | ) | const [inline, virtual] |
Get the name of the image.
posx.png:negx.png:posy.png:negy.png:posz.png:negz.png. Reimplemented from csImageBase.
Definition at line 90 of file imagecubemapmaker.h.
| virtual const csRGBpixel* csImageCubeMapMaker::GetPalette | ( | ) | [virtual] |
Get image palette (or 0 if no palette)
Reimplemented from csImageBase.
| virtual csRef<iDataBuffer> csImageCubeMapMaker::GetRawData | ( | ) | const [virtual] |
Get the raw data of the image (or 0 if raw data is not provided).
Implements iImage.
| virtual const char* csImageCubeMapMaker::GetRawFormat | ( | ) | const [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().
Implements iImage.
| virtual csRef<iImage> csImageCubeMapMaker::GetSubImage | ( | uint | num | ) | [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.
Reimplemented from csImageBase.
| virtual int csImageCubeMapMaker::GetWidth | ( | ) | const [virtual] |
Query image width.
Implements iImage.
| virtual bool csImageCubeMapMaker::HasKeyColor | ( | ) | const [inline, virtual] |
Check if image has a keycolour stored with it.
Reimplemented from csImageBase.
Definition at line 96 of file imagecubemapmaker.h.
| virtual uint csImageCubeMapMaker::HasMipmaps | ( | ) | const [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.
Reimplemented from csImageBase.
| virtual uint csImageCubeMapMaker::HasSubImages | ( | ) | const [inline, virtual] |
Returns the number of sub images, in addition to this image.
Subimages are usually used for cube map faces.
Reimplemented from csImageBase.
Definition at line 105 of file imagecubemapmaker.h.
| virtual void csImageCubeMapMaker::SetName | ( | const char * | iName | ) | [virtual] |
Set the name of the image.
Reimplemented from csImageBase.
| void csImageCubeMapMaker::SetSubImage | ( | uint | num, |
| iImage * | image | ||
| ) |
Set a specific face.
| bool csImageCubeMapMaker::SubImageSet | ( | uint | num | ) | [inline] |
Check whether a face is specified.
The difference from GetSubImage(num) is that GetSubImage() will always return an image != 0, while SubImageSet() checks whether the internal face reference is 0 or not.
Definition at line 116 of file imagecubemapmaker.h.
| void csImageCubeMapMaker::UpdateName | ( | ) | [protected] |
Update the image name from the contained images.
csRef<iImage> csImageCubeMapMaker::cubeImages[NUM_FACES] [protected] |
The cube face images.
Definition at line 51 of file imagecubemapmaker.h.
bool csImageCubeMapMaker::manualName [protected] |
Whether the name was manually overridden (in this case it is not updated when the contained images are changed).
Definition at line 56 of file imagecubemapmaker.h.