glGetCompressedTextureSubImage - retrieve a sub-region of a compressed texture image from a compressed texture object
void glGetCompressedTextureSubImage(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei bufSize, void *pixels);
glGetCompressedTextureSubImage can be used to obtain a sub-region of a compressed texture image instead of the whole image, as long as the compressed data are arranged into fixed-size blocks of texels. texture is the name of the texture object, and must not be a buffer or multisample texture. The effective target is the value of GL_TEXTURE_TARGET for texture. level and pixels have the same meaning as the corresponding arguments of glCompressedTexSubImage3D. bufSize indicates the size of the buffer to receive the retrieved pixel data.
For cube map textures, the behavior is as though glGetCompressedTexImage were called once for each requested face (selected by zoffset and depth, as described below) with target corresponding to the requested texture cube map face as indicated by the table presented below. pixels is offset appropriately for each successive image.
|Layer number||Cube Map Face|
xoffset, yoffset and zoffset indicate the position of the subregion to return. width, height and depth indicate the size of the region to return. These arguments have the same meaning as for glCompressedTexSubImage3D, though there are extra restrictions, described in the errors section below.
The mapping between the xoffset, yoffset, zoffset, width, height and depth parameters and the faces, layers, and layer-faces for cube map, array, and cube map array textures is the same as for glGetTextureSubImage.
The xoffset, yoffset, zoffset offsets and width, height and depth sizes must be multiples of the values of GL_PACK_COMPRESSED_BLOCK_WIDTH, GL_PACK_COMPRESSED_BLOCK_HEIGHT, and GL_PACK_COMPRESSED_BLOCK_DEPTH respectively, unless offset is zero and the corresponding size is the same as the texture size in that dimension.
Pixel storage modes are treated as for glGetCompressedTexSubImage. The texel at (xoffset, yoffset, zoffset) will be stored at the location indicated by pixels and the current pixel packing parameters.
GL_INVALID_OPERATION error is generated if texture is the name of a buffer or multisample texture.
GL_INVALID_OPERATION error is generated if the buffer size required to store the requested data is greater than bufSize.
GL_INVALID_OPERATION error is generated if the texture compression format is not based on fixed-size blocks.
GL_INVALID_VALUE error is generated if texture is not the name of an existing texture object.
GL_INVALID_VALUE is generated if xoffset, yoffset or zoffset are negative.
GL_INVALID_VALUE is generated if xoffset + width is greater than the texture's width, yoffset + height is greater than the texture's height, or zoffset + depth is greater than the texture's depth.
GL_INVALID_VALUE error is generated if the effective target is GL_TEXTURE_1D and either yoffset is not zero, or height is not one.
GL_INVALID_VALUE error is generated if the effective target is GL_TEXTURE_1D, GL_TEXTURE_1D_ARRAY, GL_TEXTURE_2D or GL_TEXTURE_RECTANGLE and either zoffset is not zero, or depth is not one.
GL_INVALID_VALUE error is generated if xoffset, yoffset or zoffset is not a multiple of the compressed block width, height or depth respectively.
GL_INVALID_VALUE error is generated if width, height or depth is not a multiple of the compressed block width, height or depth respectively, unless the offset is zero and the size equals the texture image size.
|Function / Feature Name||2.0||2.1||3.0||3.1||3.2||3.3||4.0||4.1||4.2||4.3||4.4||4.5|
glCompressedTexImage1D(), glCompressedTexImage2D(), glCompressedTexImage3D(), glCompressedTexSubImage1D(), glCompressedTexSubImage2D(), glCompressedTexSubImage3D(), glGetCompressedTexImage(), glGetCompressedTextureImage(), glReadPixels()
Copyright © 2014 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/.
Copyright © 2014 Khronos Group