glGetTextureSubImage

glGetTextureSubImage: man4/glGetTextureSubImage.xml

glGetTextureSubImage returns a texture subimage into pixels. texture is the name of the source texture object and must not be a buffer or multisample texture. The effective target parameter is the value of GL_TEXTURE_TARGET for texture. Level, format, type and pixels have the same meaning as for glGetTexImage. bufSize is the size of the buffer to receive the retrieved pixel data. For cube map textures, the behavior is as though GetTextureImage were called, but only texels from the requested cube map faces (selected by zoffset and depth, as described below) were returned. xoffset, yoffset and zoffset values indicate the position of the subregion to return. width, height and depth indicate the size of the region to return. These parameters have the same meaning as for glTexSubImage3D, though for one- and two-dimensional textures there are extra restrictions, described in the errors section below. For one-dimensional array textures, yoffset is interpreted as the first layer to access and height is the number of layers to access. For two-dimensional array textures, zoffset is interpreted as the first layer to access and depth is the number of layers to access. Cube map textures are treated as an array of six slices in the z-dimension, where the value of zoffset is interpreted as specifying the cube map face for the corresponding layer (as presented in the table below) and depth is the number of faces to access: Layer number Cube Map Face 0 GL_TEXTURE_CUBE_MAP_POSITIVE_X 1 GL_TEXTURE_CUBE_MAP_NEGATIVE_X 2 GL_TEXTURE_CUBE_MAP_POSITIVE_Y 3 GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 4 GL_TEXTURE_CUBE_MAP_POSITIVE_Z 5 GL_TEXTURE_CUBE_MAP_NEGATIVE_Z For cube map array textures, zoffset is the first layer-face to access, and depth is the number of layer-faces to access. A layer-face described by $k$ is translated into an array layer and face according to $$ layer = \left\lfloor { layer \over 6 } \right\rfloor$$ and $$ face = k \bmod 6. $$ Component groups from the specified sub-region are packed and placed into memory as described for glGetTextureImage, starting with the texel at ( xoffset, yoffset, zoffset ).

@OpenGL_Version(OGLIntroducedIn.V4P5)
@OpenGL_Extension("GL_ARB_get_texture_sub_image")
fn_glGetTextureSubImage glGetTextureSubImage;

See Also

glGetTexImage, glGetTextureImage, glReadPixels, glTexImage1D, glTexImage2D, glTexImage3D, glTexSubImage1D, glTexSubImage2D, glTexSubImage3D

Meta