Class pyglet.image.ImageDataRegion

AbstractImage --+    
                |    
        ImageData --+
                    |
                   ImageDataRegion

Methods

  __init__(self, x, y, width, height, image_data)
Initialise image data.
  __getstate__(self)
sequence of bytes, or str get_data(self, format, pitch)
Get the byte data of the image.
ImageDataRegion get_region(self, x, y, width, height)
Retrieve a rectangular region of this image data.
  __repr__(self) (Inherited from pyglet.image.AbstractImage)
  blit(self, x, y, z=0, width=None, height=None)
Draw this image to the active framebuffers.
(Inherited from pyglet.image.ImageData)
  blit_into(self, source, x, y, z)
Draw source on this image.
(Inherited from pyglet.image.AbstractImage)
  blit_to_texture(self, target, level, x, y, z, internalformat=None)
Draw this image to to the currently bound texture at target.
(Inherited from pyglet.image.ImageData)
cls or cls.region_class create_texture(self, cls, rectangle=False)
Create a texture containing this image.
(Inherited from pyglet.image.ImageData)
ImageData get_image_data(self)
Get an ImageData view of this image.
(Inherited from pyglet.image.ImageData)
Texture get_mipmapped_texture(self)
Return a Texture with mipmaps.
(Inherited from pyglet.image.ImageData)
Texture get_texture(self, rectangle=False)
A Texture view of this image.
(Inherited from pyglet.image.ImageData)
  save(self, filename=None, file=None, encoder=None)
Save this image to a file.
(Inherited from pyglet.image.AbstractImage)
  set_data(self, format, pitch, data)
Set the byte data of the image.
(Inherited from pyglet.image.ImageData)
  set_mipmap_image(self, level, image)
Set a mipmap image for a particular level.
(Inherited from pyglet.image.ImageData)

Properties

str data
Pixel data, encoded according to format and pitch.
ImageData image_data
An ImageData view of this image.
(Inherited from pyglet.image.AbstractImage)
Texture mipmapped_texture
A Texture view of this image.
(Inherited from pyglet.image.AbstractImage)
Texture texture
Get a Texture view of this image.
(Inherited from pyglet.image.AbstractImage)

Instance Variables

int anchor_x = 0
X coordinate of anchor, relative to left edge of image data
(Inherited from pyglet.image.AbstractImage)
int anchor_y = 0
Y coordinate of anchor, relative to bottom edge of image data
(Inherited from pyglet.image.AbstractImage)
str format
The format string to use when reading or writing data.
(Inherited from pyglet.image.ImageData)
int height
Height of image
(Inherited from pyglet.image.AbstractImage)
int pitch
Number of bytes per row.
(Inherited from pyglet.image.ImageData)
int width
Width of image
(Inherited from pyglet.image.AbstractImage)

Method Details

__init__

(Constructor) __init__(self, x, y, width, height, image_data)
Initialise image data.
Overrides:
ImageData.__init__

__getstate__

__getstate__(self)
Overrides:
ImageData.__getstate__

get_data

get_data(self, format, pitch)
Get the byte data of the image.
Returns: sequence of bytes, or str
Overrides:
ImageData.get_data

Since: pyglet 1.1

get_region

get_region(self, x, y, width, height)
Retrieve a rectangular region of this image data.
Returns: ImageDataRegion
Overrides:
ImageData.get_region

Property Details

data

Pixel data, encoded according to format and pitch.

Deprecated: Use get_data and set_data.