csImageCubeMapMaker Class Reference
[Graphics]
Wrapper class to create a cube map from a number of 2D images as the cube faces.
More...
#include <csgfx/imagecubemapmaker.h>
Inheritance diagram for csImageCubeMapMaker:
Public Member Functions | |
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. | |
csImageCubeMapMaker (iImage *source) | |
Create a new map and copy the faces from source. | |
csImageCubeMapMaker () | |
Create a new map without faces set. | |
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 } |
NUM_FACES = 6 | |
Symbolic name for number of faces of a cube map. | |
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). |
Detailed Description
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.
Member Enumeration Documentation
anonymous enum [protected] |
Definition at line 45 of file imagecubemapmaker.h.
Constructor & Destructor Documentation
csImageCubeMapMaker::csImageCubeMapMaker | ( | ) |
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.
Member Function Documentation
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] |
virtual int csImageCubeMapMaker::GetHeight | ( | ) | const [virtual] |
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.
References csimgCube.
virtual void csImageCubeMapMaker::GetKeyColor | ( | int & | , | |
int & | , | |||
int & | ||||
) | const [inline, virtual] |
Get the keycolour stored with the image.
Reimplemented from csImageBase.
Definition at line 97 of file imagecubemapmaker.h.
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.
- Remarks:
- Unless the name was manually overridden with SetName(), the default name will contain the names of the wrapped subimages, separated by ':', in the form
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] |
virtual csRef<iDataBuffer> csImageCubeMapMaker::GetRawData | ( | ) | const [virtual] |
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).
Reimplemented from csImageBase.
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] |
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] |
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.
Member Data Documentation
csRef<iImage> csImageCubeMapMaker::cubeImages[NUM_FACES] [protected] |
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.
The documentation for this class was generated from the following file:
- csgfx/imagecubemapmaker.h
Generated for Crystal Space by doxygen 1.4.7