GLGETCOMPRESSEDTEXTU(3G)

  .SH "NAME" glGetCompressedTextureSubImage - retrieve a sub-region of a compressed texture image from a compressed texture object
  .SH "C SPECIFICATION"

      .HP u void glGetCompressedTextureSubImage(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei bufSize, void *pixels);

  .SH "PARAMETERS"

      .PP texture

              Specifies the name of the source texture object. Must be GL_TEXTURE_1D, GL_TEXTURE_1D_ARRAY, GL_TEXTURE_2D, GL_TEXTURE_2D_ARRAY, GL_TEXTURE_3D, GL_TEXTURE_CUBE_MAP, GL_TEXTURE_CUBE_MAP_ARRAY or GL_TEXTURE_RECTANGLE. In specific, buffer and multisample textures are not permitted.

          .RE
          .PP level

                  Specifies the level-of-detail number. Level 0 is the base image level. Level $n$ is the $n$th mipmap reduction image.

              .RE
              .PP xoffset

                      Specifies a texel offset in the x direction within the texture array.

                  .RE
                  .PP yoffset

                          Specifies a texel offset in the y direction within the texture array.

                      .RE
                      .PP zoffset

                              Specifies a texel offset in the z direction within the texture array.

                          .RE
                          .PP width

                                  Specifies the width of the texture subimage. Must be a multiple of the compressed block's width, unless the offset is zero and the size equals the texture image size.

                              .RE
                              .PP height

                                      Specifies the height of the texture subimage. Must be a multiple of the compressed block's height, unless the offset is zero and the size equals the texture image size.

                                  .RE
                                  .PP depth

                                          Specifies the depth of the texture subimage. Must be a multiple of the compressed block's depth, unless the offset is zero and the size equals the texture image size.

                                      .RE
                                      .PP bufSize

                                              Specifies the size of the buffer to receive the retrieved pixel data.

                                          .RE
                                          .PP pixels

                                                  Returns the texture subimage. Should be a pointer to an array of the type specified by type.

                                              .RE

                                          .SH "DESCRIPTION"

                                            .PP 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.
                                            .PP 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.
                                            .TS allbox tab(:); l l l l l l l l l l l l l l. T{ Layer number T}:T{ Cube Map Face T} T{ 0 T}:T{ GL_TEXTURE_CUBE_MAP_POSITIVE_X T} T{ 1 T}:T{ GL_TEXTURE_CUBE_MAP_NEGATIVE_X T} T{ 2 T}:T{ GL_TEXTURE_CUBE_MAP_POSITIVE_Y T} T{ 3 T}:T{ GL_TEXTURE_CUBE_MAP_NEGATIVE_Y T} T{ 4 T}:T{ GL_TEXTURE_CUBE_MAP_POSITIVE_Z T} T{ 5 T}:T{ GL_TEXTURE_CUBE_MAP_NEGATIVE_Z T}

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

                                          .SH "ERRORS"

                                            .PP GL_INVALID_OPERATION error is generated if texture is the name of a buffer or multisample texture.
                                            .PP GL_INVALID_OPERATION error is generated if the buffer size required to store the requested data is greater than bufSize.
                                            .PP GL_INVALID_OPERATION error is generated if the texture compression format is not based on fixed-size blocks.
                                            .PP GL_INVALID_VALUE error is generated if texture is not the name of an existing texture object.
                                            .PP GL_INVALID_VALUE is generated if xoffset, yoffset or zoffset are negative.
                                            .PP 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.
                                            .PP 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.
                                            .PP 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.
                                            .PP GL_INVALID_VALUE error is generated if xoffset, yoffset or zoffset is not a multiple of the compressed block width, height or depth respectively.
                                            .PP 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.

                                            .SH "VERSION SUPPORT"
                                                .TS allbox tab(:); l l l l l l l l l l l l l. T{ glGetCompressedTextureSubImage T}:T{ T}:T{ T}:T{ T}:T{ T}:T{ T}:T{ T}:T{ T}:T{ T}:T{ T}:T{ T}:T{ T}:T{ T}

                                          .SH "SEE ALSO"

                                            .PP glCompressedTexImage1D(), glCompressedTexImage2D(), glCompressedTexImage3D(), glCompressedTexSubImage1D(), glCompressedTexSubImage2D(), glCompressedTexSubImage3D(), glGetCompressedTexImage(), glGetCompressedTextureImage, glReadPixels()

                                            .SH "COPYRIGHT"
                                                .PP 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
Copyright © 2014 Khronos Group