示例#1
0
 def get_mipmapped_texture(self):
     """Retrieve a :py:class:`~pyglet.image.Texture` instance with all mipmap levels filled in.
     Requires that image dimensions be powers of 2. 
     :rtype: :py:class:`~pyglet.image.Texture`
     .. versionadded:: 1.1
     """
     raise ImageException('Cannot retrieve mipmapped texture for %r' % self)
示例#2
0
 def get_texture(self, rectangle=False):
     """A :py:class:`~pyglet.image.Texture` view of this image.  
     By default, textures are created with dimensions that are powers of
     two.  Smaller images will return a :py:class:`~pyglet.image.TextureRegion` that covers just
     the image portion of the larger texture.  This restriction is required
     on older video cards, and for compressed textures, or where texture
     repeat modes will be used, or where mipmapping is desired.
     If the `rectangle` parameter is ``True``, this restriction is ignored
     and a texture the size of the image may be created if the driver
     supports the ``GL_ARB_texture_rectangle`` or
     ``GL_NV_texture_rectangle`` extensions.  If the extensions are not
     present, the image already is a texture, or the image has power 2
     dimensions, the `rectangle` parameter is ignored.
     Examine `Texture.target` to determine if the returned texture is a
     rectangle (``GL_TEXTURE_RECTANGLE``) or not (``GL_TEXTURE_2D``).
     Changes to the returned instance may or may not be reflected in this
     image.
     :Parameters:
         `rectangle` : bool
             True if the texture can be created as a rectangle.
             .. versionadded:: 1.1.4.
     :rtype: :py:class:`~pyglet.image.Texture`
     .. versionadded:: 1.1
     """
     raise ImageException('Cannot retrieve texture for %r' % self)
示例#3
0
 def blit(self, 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``).
     """
     raise ImageException('Cannot blit %r.' % self)
示例#4
0
 def get_image_data(self):
     """Get an ImageData view of this image.  
     
     Changes to the returned instance may or may not be reflected in this
     image.
     :rtype: :py:class:`~pyglet.image.ImageData`
     .. versionadded:: 1.1
     """
     raise ImageException('Cannot retrieve image data for %r' % self)
示例#5
0
 def blit_to_texture(self, target, level, x, y, z=0):
     """Draw this image on the currently bound texture at `target`.
     
     This image is copied into the texture such that this image's anchor
     point is aligned with the given `x` and `y` coordinates of the
     destination texture.  If the currently bound texture is a 3D texture,
     the `z` coordinate gives the image slice to blit into.
     """
     raise ImageException('Cannot blit %r to a texture.' % self)
示例#6
0
 def blit_into(self, 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().
     """
     raise ImageException('Cannot blit images onto %r.' % self)
示例#7
0
 def get_region(self, x, y, width, height):
     """Retrieve a rectangular region of this image.
     :Parameters:
         `x` : int
             Left edge of region.
         `y` : int
             Bottom edge of region.
         `width` : int
             Width of region.
         `height` : int
             Height of region.
     :rtype: AbstractImage
     """
     raise ImageException('Cannot get region for %r' % self)