DepthBufferImage
(x, y, width, height)¶The depth buffer.
Constructor:
__init__
(x, y, width, height)¶Methods:
blit
(x, y[, z])Draw this image to the active framebuffers. blit_into
(source, x, y, z)Draw source on this image. blit_to_texture
(target, level, x, y, z)get_image_data
()get_mipmapped_texture
()Retrieve a Texture instance with all mipmap levels filled in. get_region
(x, y, width, height)get_texture
([rectangle, force_rectangle])save
([filename, file, encoder])Save this image to a file.
Attributes:
anchor_x
anchor_y
format
image_data
An ImageData view of this image. mipmapped_texture
A Texture view of this image. owner
texture
Get a Texture view of this image.
DepthBufferImage.
blit_to_texture
(target, level, x, y, z)¶DepthBufferImage.
get_texture
(rectangle=False, force_rectangle=False)¶Methods
DepthBufferImage.
blit
(x, y, z=0)Draw this image to the active framebuffers.
The image will be drawn with the lower-left corner at (
x -
anchor_x,y -
anchor_y,z
).
DepthBufferImage.
blit_into
(source, x, y, z)Draw source on this image.
source will be copied into this image such that its anchor point is aligned with the x and y parameters. If this image is a 3D texture, the z coordinate gives the image slice to copy into.
Note that if source is larger than this image (or the positioning would cause the copy to go out of bounds) then you must pass a region of source to this method, typically using get_region().
DepthBufferImage.
get_image_data
()
DepthBufferImage.
get_mipmapped_texture
()Retrieve a Texture instance with all mipmap levels filled in.
Requires that image dimensions be powers of 2.
Return type: Texture Note
Since pyglet 1.1
DepthBufferImage.
get_region
(x, y, width, height)
DepthBufferImage.
save
(filename=None, file=None, encoder=None)Save this image to a file.
Parameters:
- filename (str) – Used to set the image file format, and to open the output file if file is unspecified.
- file (file-like object or None) – File to write image data to.
- encoder (ImageEncoder or None) – If unspecified, all encoders matching the filename extension are tried. If all fail, the exception from the first one attempted is raised.
Attributes
DepthBufferImage.
anchor_x
= 0
DepthBufferImage.
anchor_y
= 0
DepthBufferImage.
image_data
An ImageData view of this image.
Changes to the returned instance may or may not be reflected in this image. Read-only.
Warning
Deprecated. Use get_image_data.
Type: ImageData
DepthBufferImage.
mipmapped_texture
A Texture view of this image.
The returned Texture will have mipmaps filled in for all levels. Requires that image dimensions be powers of 2. Read-only.
Warning
Deprecated. Use get_mipmapped_texture.
Type: Texture
DepthBufferImage.
owner
= None
DepthBufferImage.
texture
Get a Texture view of this image.
Changes to the returned instance may or may not be reflected in this image.
Warning
Deprecated. Use get_texture.
Type: Texture