GLCOMPRESSEDTEXSUBIMAGE2D(3gl)GLCOMPRESSEDTEXSUBIMAGE2D(3gl)NAME
glCompressedTexSubImage2D - specify a two-dimensional compressed tex‐
ture subimage
C SPECIFICATION
void glCompressedTexSubImage2D( GLenum target,
GLint level,
GLint xoffset,
GLint yoffset,
GLsizei width,
GLsizei height,
GLenum format,
GLsizei imagesize,
const GLvoid *data )
PARAMETERS
target Specifies the target texture. Must be GL_TEXTURE_2D.
level Specifies the level-of-detail number. Level 0 is the base
image level. Level n is the nth mipmap reduction image.
xoffset Specifies a texel offset in the x direction within the texture
array.
yoffset Specifies a texel offset in the y direction within the texture
array.
width Specifies the width of the texture subimage.
height Specifies the height of the texture subimage.
format Specifies the specific compressed texture image format.
imagesize
Specifies the size (in bytes) of the compressed image data.
data Specifies a pointer to the compressed image data in memory.
DESCRIPTION
glCompressedTexSubImage2D respecify only a rectangular region of an
existing texture array, with incoming data stored in a known compressed
image format. The target, level, xoffset, yoffset, width, height param‐
eters have the same meaning as in glTexSubImage2D. data points to com‐
pressed image data stored in the compressed image format corresponding
to format.
The GL provides no specific compressed internal formats but does pro‐
vide a mechanism to obtain the enums for such formats provided by
extensions. The number of specific compressed internal format symbolic
constants supported by the renderer can be obtained by querying the
value of GL_NUM_COMPRESSED_TEXTURE_FORMATS using glGet. The set of
specific compressed internal format symbolic constants supported by the
renderer can be obtained by querying the value of GL_COMPRESSED_TEX‐
TURE_FORMATS using glGet. Since the GL provides no specific image for‐
mats, using any of the six generic compressed internal formats, GL_COM‐
PRESSED_ALPHA, GL_COMPRESSED_LUMINANCE, GL_COMPRESSED_LUMINANCE_ALPHA,
GL_COMPRESSED_INTENSITY, GL_COMPRESSED_RGB, GL_COMPRESSED_RGBA, as for‐
mat will result in a GL_INVALID_ENUM error.
The image pointed to by data and the imagesize parameter are inter‐
preted as though they were provided to glCompressedTexImage2D. This
command does not provide for image format conversion, so an
GL_INVALID_OPERATION error results if format does not match the inter‐
nal format of the texture image being modified. If the imagesize
parameter is not consistent with the format, dimensions, and contents
of the compressed image (too little or too much data), an
GL_INVALID_VALUE error results.
As with glCompressedTexImage2D call, compressed internal formats may
have additional restrictions on the use of the compressed image speci‐
fication calls or parameters. Any such restrictions will be documented
in the specification defining the compressed internal format; violating
these restrictions will result in an GL_INVALID_OPERATION error.
Any restrictions imposed by specific compressed internal formats will
be invariant, meaning that if the GL accepts and stores a texture image
in compressed form, providing the same image to glCompressedTexSubIm‐
age2D will not result in an GL_INVALID_OPERATION error if the following
restrictions are satisfied:
data points to a compressed texture image returned by
glGetCompressedTexImage.
target, level, and format match the target,
level and format parameters provided to the glGetCompressedTexImage
call returning data.
width, height, depth, format, and imagesize
match the values of GL_TEXTURE_WIDTH, GL_TEXTURE_HEIGHT, GL_TEX‐
TURE_DEPTH, GL_TEXTURE_INTERNAL_FORMAT, and GL_TEXTURE_COM‐
PRESSED_IMAGE_SIZE for image level level in effect at the time of
the glGetCompressedTexImage call returning data.
width, height, depth, format match the values of
GL_TEXTURE_WIDTH, GL_TEXTURE_HEIGHT, GL_TEXTURE_DEPTH, and GL_TEX‐
TURE_INTERNAL_FORMAT currently in effect for image level level.
xoffset, yoffset, and zoffset are all "-b", where b
is the value of GL_TEXTURE_BORDER currently in effect for image
level level.
This guarantee applies not just to images returned by glGetCompressed‐
TexImage, but also to any other properly encoded compressed texture
image of the same size.
NOTES
Texturing has no effect in color index mode.
ERRORS
GL_INVALID_ENUM is generated if target is not one of the allowable val‐
ues.
GL_INVALID_OPERATION is generated if the texture array has not been
defined by a previous glCompressedTexImage2D operation.
GL_INVALID_VALUE is generated if level is less than 0.
GL_INVALID_VALUE may be generated if level is greater than log2max,
where max is the returned value of GL_MAX_TEXTURE_SIZE.
GL_INVALID_VALUE is generated if xoffset<−b, or if (xoff‐
set+width)>(w−b). Where w is the GL_TEXTURE_WIDTH, and b is the width
of the GL_TEXTURE_BORDER of the texture image being modified. Note
that w includes twice the border width.
GL_INVALID_VALUE is generated if width is less than 0.
GL_INVALID_OPERATION is generated if glCompressedTexSubImage2D is exe‐
cuted between the execution of glBegin and the corresponding execution
of glEnd.
ASSOCIATED GETS
glGetCompressedTexImage
glGet with argument GL_NUM_COMPRESSED_TEXTURE_FORMATS, GL_COM‐
PRESSED_TEXTURE_FORMATS
glGetTexLevelParameter with argument GL_TEXTURE_COMPRESSED_IMAGE_SIZE,
GL_TEXTURE_COMPRESSED
glIsEnabled with argument GL_TEXTURE_2D
SEE ALSO
glTexSubImage2D,
30 Sep 02 GLCOMPRESSEDTEXSUBIMAGE2D(3gl)