OpenGLContext.debug.bufferimage
Create PIL images from depth or stencil buffers
This module allows you to capture the current depth
or stencil buffer to a PIL image. This allows you
to, for instance, save the image to disk and examine
it with an image editor to confirm that the buffer
includes the expected results.
Functions
depth(
x
= 0
,
y
= 0
,
width
= -1
,
height
= -1
,
normalise
= 1
,
flip
= 1
)
Get the depth-buffer as a PIL image
x,y -- start position for the captured rectangle
width,height -- size of the captured rectangle
if normalise is true, the image will be
scaled to make the most-positive (deepest)
values white and the most-negative (closest)
values black.
if flip, then the image will be flipped
vertically so that it matches the PIL
conventions instead of the OpenGL conventions.
stencil(
x
= 0
,
y
= 0
,
width
= -1
,
height
= -1
,
normalise
= 1
,
flip
= 1
)
Get the stencil-buffer as a PIL image
x,y -- start position for the captured rectangle
width,height -- size of the captured rectangle
if normalise is true, the image will be
scaled to make the most-positive (deepest)
values white and the most-negative (closest)
values black.
if flip, then the image will be flipped
vertically so that it matches the PIL
conventions instead of the OpenGL conventions.