Unofficial OpenGL Software Development Kit
0.5.0
|
#include <ImageSet.h>
Represents a set of images that can be stored in a texture object.
This class represents the full range of possible image layouts with regard to texture objects. All images in the ImageSet use the same format.
The images in an ImageSet are named by a triple of numbers: mipmap level, array index, and face index. The maximum number of each of these is queriable. The size of the ImageSet is the size of all images from mipmap level 0. Each mipmap will have the same number of array indices and faces.
Faces represent the faces of a cubemap. So for non-cubemap textures, GetFaceCount will return 1. The order of the faces in the cubemap is the same as the order of the faces for ARB_texture_cube_map_array extension. That is, the order of the GL_TEXTURE_CUBE_MAP_* enumerators.
Array indices represent images that go into an array texture. Array-cubemap textures are arranged in memory as specified in the ARB_texture_cube_map_array extension.
This object uses reference semantics. Every copy of it will refer to the same image data.
Public Member Functions | |
Dimensions | GetDimensions () const |
Returns the dimensionality of the base mipmap image. | |
int | GetMipmapCount () const |
Returns the number of mipmap levels the image set contains. More... | |
int | GetArrayCount () const |
Returns the number of array images this image set has. More... | |
int | GetFaceCount () const |
Returns the number of faces in the image set. More... | |
ImageFormat | GetFormat () const |
Retrieves the image format that describes all images in this ImageSet. | |
SingleImage | GetImage (int mipmapLevel, int arrayIx=0, int faceIx=0) const |
Retrieves the image at the given mipmap level, array index, and face index. More... | |
const void * | GetImageArray (int mipmapLevel) const |
Retrieves a pointer to the full array data for the entire mipmap level. More... | |
Friends | |
void | CreateTexture (unsigned int textureName, const ImageSet *pImage, unsigned int forceConvertBits) |
As CreateTexture(const ImageSet *, unsigned int), but with a texture object provided by the user. More... | |
int glimg::ImageSet::GetArrayCount | ( | ) | const |
Returns the number of array images this image set has.
This function will return the number of array images in the image set. The minimum is 1.
This API makes no distinction between an array of length 1 and a non-array texture. If such a distinction needs to be made, it should be made in the uploading of the image's data, not in the ImageSet.
int glimg::ImageSet::GetFaceCount | ( | ) | const |
Returns the number of faces in the image set.
SingleImage glimg::ImageSet::GetImage | ( | int | mipmapLevel, |
int | arrayIx = 0 , |
||
int | faceIx = 0 |
||
) | const |
Retrieves the image at the given mipmap level, array index, and face index.
const void* glimg::ImageSet::GetImageArray | ( | int | mipmapLevel | ) | const |
Retrieves a pointer to the full array data for the entire mipmap level.
This data is formatted explicitly for use with array textures and cubemap-array textures.
int glimg::ImageSet::GetMipmapCount | ( | ) | const |
Returns the number of mipmap levels the image set contains.
|
friend |
As CreateTexture(const ImageSet *, unsigned int), but with a texture object provided by the user.
The given texture object must not have been used at all. You cannot even have bound it to the OpenGL context once. It should be fresh from glGenTextures
.
... | Everything that CreateTexture(const ImageSet *, unsigned int) throws. |