CrystalSpace

Public API Reference

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

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:

csImageBase iImage iBase List of all members.

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 the Positive X, Positive Y ...
virtual const void * GetImageData ()
 Get image data: returns either (csRGBpixel *) or (unsigned char *) depending on format.
virtual int GetWidth () const
 Query image width.
virtual int GetHeight () const
 Query image height.
virtual void SetName (const char *iName)
 Set the name of the image.
virtual const char * GetName () const
 Get the name of the image.
virtual int GetFormat () const
 Qyery image format (see CS_IMGFMT_XXX above).
virtual const csRGBpixelGetPalette ()
 Get image palette (or 0 if no palette).
virtual const uint8GetAlpha ()
 Get alpha map for 8-bit paletted image.
virtual bool HasKeyColor () const
 Check if image has a keycolour stored with it.
virtual void GetKeyColor (int &r, int &g, int &b) const
 Get the keycolour stored with the image.
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 csRef< iImageGetMipmap (uint num)
 Return a precomputed mipmap.
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< iDataBufferGetRawData () const
 Get the raw data of the image (or 0 if raw data is not provided).
virtual csImageType GetImageType () const
 Get the type of the contained image.
virtual uint HasSubImages () const
 Returns the number of sub images, in addition to this image.
virtual csRef< iImageGetSubImage (uint num)
 Query a sub image.
void SetSubImage (uint num, iImage *image)
 Set a specific face.
bool SubImageSet (uint num)
 Check whether a face is specified.

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-no-found-checkerboard).

Definition at line 39 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 the Positive X, Positive Y ...

images.


Member Function Documentation

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 90 of file imagecubemapmaker.h.

References csImageType.

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

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 76 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).

Reimplemented from csImageBase.

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.

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 82 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 91 of file imagecubemapmaker.h.

References uint.

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 102 of file imagecubemapmaker.h.


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