glGetTexImage

return a texture image

Signature

glGetTexImage( GLenum ( target ) , GLint ( level ) , GLenum ( format ) , GLenum ( type ) , GLvoid * ( img ) )-> void
glGetTexImage( target , level , format , type , array = None , outputType = <type 'str'> )
Get a texture-level as an image

    target -- enum constant for the texture engine to be read
    level -- the mip-map level to read
    format -- image format to read out the data
    type -- data-type into which to read the data
    array -- optional array/offset into which to store the value

    outputType -- default (bytes) provides string output of the
        results iff OpenGL.UNSIGNED_BYTE_IMAGES_AS_STRING is True
        and type == GL_UNSIGNED_BYTE.  Any other value will cause
        output in the default array output format.

    returns the pixel data array in the format defined by the
    format, type and outputType
    
glGetTexImagef( target , level , format , type = GL_FLOAT , array = None , outputType = <type 'str'> )
Get a texture-level as an image
        
        target -- enum constant for the texture engine to be read
        level -- the mip-map level to read
        format -- image format to read out the data
        type -- data-type into which to read the data
        array -- optional array/offset into which to store the value

        outputType -- default (bytes) provides string output of the
            results iff OpenGL.UNSIGNED_BYTE_IMAGES_AS_STRING is True
            and type == GL_UNSIGNED_BYTE.  Any other value will cause
            output in the default array output format.

        returns the pixel data array in the format defined by the
        format, type and outputType
        
glGetTexImagei( target , level , format , type = GL_INT , array = None , outputType = <type 'str'> )
Get a texture-level as an image
        
        target -- enum constant for the texture engine to be read
        level -- the mip-map level to read
        format -- image format to read out the data
        type -- data-type into which to read the data
        array -- optional array/offset into which to store the value

        outputType -- default (bytes) provides string output of the
            results iff OpenGL.UNSIGNED_BYTE_IMAGES_AS_STRING is True
            and type == GL_UNSIGNED_BYTE.  Any other value will cause
            output in the default array output format.

        returns the pixel data array in the format defined by the
        format, type and outputType
        
glGetTexImages( target , level , format , type = GL_SHORT , array = None , outputType = <type 'str'> )
Get a texture-level as an image
        
        target -- enum constant for the texture engine to be read
        level -- the mip-map level to read
        format -- image format to read out the data
        type -- data-type into which to read the data
        array -- optional array/offset into which to store the value

        outputType -- default (bytes) provides string output of the
            results iff OpenGL.UNSIGNED_BYTE_IMAGES_AS_STRING is True
            and type == GL_UNSIGNED_BYTE.  Any other value will cause
            output in the default array output format.

        returns the pixel data array in the format defined by the
        format, type and outputType
        
glGetTexImageui( target , level , format , type = GL_UNSIGNED_INT , array = None , outputType = <type 'str'> )
Get a texture-level as an image
        
        target -- enum constant for the texture engine to be read
        level -- the mip-map level to read
        format -- image format to read out the data
        type -- data-type into which to read the data
        array -- optional array/offset into which to store the value

        outputType -- default (bytes) provides string output of the
            results iff OpenGL.UNSIGNED_BYTE_IMAGES_AS_STRING is True
            and type == GL_UNSIGNED_BYTE.  Any other value will cause
            output in the default array output format.

        returns the pixel data array in the format defined by the
        format, type and outputType
        
glGetTexImageus( target , level , format , type = GL_UNSIGNED_SHORT , array = None , outputType = <type 'str'> )
Get a texture-level as an image
        
        target -- enum constant for the texture engine to be read
        level -- the mip-map level to read
        format -- image format to read out the data
        type -- data-type into which to read the data
        array -- optional array/offset into which to store the value

        outputType -- default (bytes) provides string output of the
            results iff OpenGL.UNSIGNED_BYTE_IMAGES_AS_STRING is True
            and type == GL_UNSIGNED_BYTE.  Any other value will cause
            output in the default array output format.

        returns the pixel data array in the format defined by the
        format, type and outputType
        

Parameters

VariablesDescription
target
Specifies which texture is to be obtained. GL_TEXTURE_1D , GL_TEXTURE_2D , GL_TEXTURE_3D , GL_TEXTURE_1D_ARRAY , GL_TEXTURE_2D_ARRAY , GL_TEXTURE_RECTANGLE , GL_TEXTURE_CUBE_MAP_POSITIVE_X , GL_TEXTURE_CUBE_MAP_NEGATIVE_X , GL_TEXTURE_CUBE_MAP_POSITIVE_Y , GL_TEXTURE_CUBE_MAP_NEGATIVE_Y , GL_TEXTURE_CUBE_MAP_POSITIVE_Z , and GL_TEXTURE_CUBE_MAP_NEGATIVE_Z are accepted.
level
Specifies the level-of-detail number of the desired image. Level 0 is the base image level. Level n is the n th mipmap reduction image.
format
Specifies a pixel format for the returned data. The supported formats are GL_STENCIL_INDEX , GL_DEPTH_COMPONENT , GL_DEPTH_STENCIL , GL_RED , GL_GREEN , GL_BLUE , GL_RG , GL_RGB , GL_RGBA , GL_BGR , GL_BGRA , GL_RED_INTEGER , GL_GREEN_INTEGER , GL_BLUE_INTEGER , GL_RG_INTEGER , GL_RGB_INTEGER , GL_RGBA_INTEGER , GL_BGR_INTEGER , GL_BGRA_INTEGER .
type
Specifies a pixel type for the returned data. The supported types are GL_UNSIGNED_BYTE , GL_BYTE , GL_UNSIGNED_SHORT , GL_SHORT , GL_UNSIGNED_INT , GL_INT , GL_HALF_FLOAT , GL_FLOAT , GL_UNSIGNED_BYTE_3_3_2 , GL_UNSIGNED_BYTE_2_3_3_REV , GL_UNSIGNED_SHORT_5_6_5 , GL_UNSIGNED_SHORT_5_6_5_REV , GL_UNSIGNED_SHORT_4_4_4_4 , GL_UNSIGNED_SHORT_4_4_4_4_REV , GL_UNSIGNED_SHORT_5_5_5_1 , GL_UNSIGNED_SHORT_1_5_5_5_REV , GL_UNSIGNED_INT_8_8_8_8 , GL_UNSIGNED_INT_8_8_8_8_REV , GL_UNSIGNED_INT_10_10_10_2 , GL_UNSIGNED_INT_2_10_10_10_REV , GL_UNSIGNED_INT_24_8 , GL_UNSIGNED_INT_10F_11F_11F_REV , GL_UNSIGNED_INT_5_9_9_9_REV , and GL_FLOAT_32_UNSIGNED_INT_24_8_REV .
img
Returns the texture image. Should be a pointer to an array of the type specified by type .

Sample Code References

The following code samples have been found which appear to reference the functions described here. Take care that the code may be old, broken or not even use PyOpenGL.

glGetTexImage
OpenGLContext tests/getteximage.py Lines: 28

MathML Rendering

Powered by MathJax