Signature
glReadPixels(
GLint (
x
)
,
GLint (
y
)
,
GLsizei (
width
)
,
GLsizei (
height
)
,
GLenum (
format
)
,
GLenum (
type
)
,
GLvoid * (
data
)
)-> void
glReadPixels(
x
,
y
,
width
,
height
,
format
,
type
,
array
= None
,
outputType
= <type 'str'>
)
Read specified pixels from the current display buffer
x,y,width,height -- location and dimensions of the image to read
from the buffer
format -- pixel format for the resulting data
type -- data-format for the resulting 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
glReadPixelsf(
x
,
y
,
width
,
height
,
format
,
type
= GL_FLOAT
,
array
= None
,
outputType
= <type 'str'>
)
Read specified pixels from the current display buffer
This typed version returns data in your specified default
array data-type format, or in the passed array, which will
be converted to the array-type required by the format.
glReadPixelsi(
x
,
y
,
width
,
height
,
format
,
type
= GL_INT
,
array
= None
,
outputType
= <type 'str'>
)
Read specified pixels from the current display buffer
This typed version returns data in your specified default
array data-type format, or in the passed array, which will
be converted to the array-type required by the format.
glReadPixelss(
x
,
y
,
width
,
height
,
format
,
type
= GL_SHORT
,
array
= None
,
outputType
= <type 'str'>
)
Read specified pixels from the current display buffer
This typed version returns data in your specified default
array data-type format, or in the passed array, which will
be converted to the array-type required by the format.
glReadPixelsui(
x
,
y
,
width
,
height
,
format
,
type
= GL_UNSIGNED_INT
,
array
= None
,
outputType
= <type 'str'>
)
Read specified pixels from the current display buffer
This typed version returns data in your specified default
array data-type format, or in the passed array, which will
be converted to the array-type required by the format.
glReadPixelsus(
x
,
y
,
width
,
height
,
format
,
type
= GL_UNSIGNED_SHORT
,
array
= None
,
outputType
= <type 'str'>
)
Read specified pixels from the current display buffer
This typed version returns data in your specified default
array data-type format, or in the passed array, which will
be converted to the array-type required by the format.
Parameters
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.
glReadPixels