clutter.Texture

clutter.Texture

Synopsis

class clutter.Texture(clutter.Actor):
    __init__(filename=None, disable_slicing=False, load_async=False, load_data_async=False)
def set_from_rgb_data(data, has_alpha, width, height, rowstride, bpp, flags)
def set_from_yuv_data(data, width, height, flags)
def set_area_from_rgb_data(data, has_alpha, x, y, width, height, rowstride, bpp, flags)
def set_from_file(filename)
def get_base_size()
def set_filter_quality(filter_quality)
def get_filter_quality()
def get_max_tile_waste()
def get_pixel_format()
def get_cogl_material()
def set_cogl_material(cogl_material)
def get_cogl_texture()
def set_cogl_texture(cogl_tex)
def get_sync_size()
def set_sync_size(sync_size)
def get_repeat()
def set_repeat(repeat_x, repeat_y)
def get_keep_aspect_ratio()
def set_keep_aspect_ratio(keep_aspect)

Ancestry

+-- GObject
  +-- clutter.Actor
    +-- clutter.Texture

Constructor

    __init__(filename=None, disable_slicing=False, load_async=False, load_data_async=False)

filename :

a filename or None

disable_slicing :

if True slicing is disabled

load_async :

if True a worker thread is used to load the data from disk async, returning inmediately.

load_data_async :

if True a worker thread is used to load the data from disk async, blocking until the widht and height of the data are determined.

Returns :

a clutter.Actor

Methods

clutter.Texture.set_from_rgb_data

    def set_from_rgb_data(data, has_alpha, width, height, rowstride, bpp, flags)

data :

Image data in RGB colorspace.

has_alpha :

Set to True if image data has alpha channel.

width :

Width in pixels of image data.

height :

Height in pixels of image data.

rowstride :

Distance in bytes between row starts.

bpp :

bytes per pixel (Currently only 3 or 4 are supported, depending on has_alpha.)

flags :

a ClutterTextureFlags

Returns :

True on success, False on failure.

Sets the texture from RGB image data. If an error ocurred False is returned.

clutter.Texture.set_from_yuv_data

    def set_from_yuv_data(data, width, height, flags)

data :

Image data in YUV type colorspace.

width :

Width in pixels of image data.

height :

Height in pixels of image data.

flags :

a ClutterTextureFlags

Returns :

True on success, False on failure.

Sets the texture from YUV image data. If an error ocurred False is returned.

clutter.Texture.set_area_from_rgb_data

    def set_area_from_rgb_data(data, has_alpha, x, y, width, height, rowstride, bpp, flags)

data :

Image data in RGB type colorspace.

has_alpha :

Set to True if image data has an alpha channel.

x :

X coordinate of upper left corner of region to update.

y :

Y coordinate of upper left corner of region to update.

width :

Width in pixels of region to update.

height :

Height in pixels of region to update.

rowstride :

Distance in bytes between row starts.

bpp :

bytes per pixel (Currently only 3 and 4 supported, depending on has_alpha)

flags :

a ClutterTextureFlags

Returns :

True on success, False on failure.

Updates a sub-region of the pixel data. If an error ocurred False is returned.

clutter.Texture.set_from_file

    def set_from_file(filename)

filename :

The filename of the image.

Returns :

True if the image was successfully loaded and set.

Sets the image data from a file. In case of failure False is returned.

clutter.Texture.get_base_size

    def get_base_size()

Returns :

a 2-tuple with the width and height

Gets the size in pixels of the untransformed underlying image.

clutter.Texture.set_filter_quality

    def set_filter_quality(filter_quality)

filter_quality :

a ClutterTextureQuality

Sets the filter quality when scaling a texture. The quality is an enumeration currently the following values are supported: TEXTURE_QUALITY_LOW which is fast but only uses nearest neighbour interpolation. TEXTURE_QUALITY_MEDIUM which is computationally a bit more expensive (bilinear interpolation), and TEXTURE_QUALITY_HIGH which uses extra texture memory resources to improve scaled down rendering as well (by using mipmaps). The default value is TEXTURE_QUALITY_MEDIUM.

clutter.Texture.get_filter_quality

    def get_filter_quality()

Returns :

a ClutterTextureQuality

Returns the filter quality used when scaling a texture.

clutter.Texture.get_max_tile_waste

    def get_max_tile_waste()

Returns :

The maximum waste or -1 if the texture waste is unlimited.

Returns the maximum waste that will be used when creating a texture or -1 if slicing is disabled.

clutter.Texture.get_pixel_format

    def get_pixel_format()

Returns :

a CoglPixelFormat value

Retrieves the pixel format used by texture.

clutter.Texture.get_cogl_material

    def get_cogl_material()

Returns :

a CoglHandle

Returns the handle to the underlying COGL material used for drawing the actor.

clutter.Texture.set_cogl_material

    def set_cogl_material(cogl_material)

cogl_material :

a CoglHandle for material

Replaces the underlying COGL material drawn by this actor with cogl_material.

clutter.Texture.get_cogl_texture

    def get_cogl_texture()

Returns :

a CoglHandle

Retrieves the handle to the underlying COGL texture used for drawing the actor.

clutter.Texture.set_cogl_texture

    def set_cogl_texture(cogl_tex)

cogl_tex :

a CoglHandle

Replaces the underlying COGL texture drawn by this actor with cogl_tex.

clutter.Texture.get_sync_size

    def get_sync_size()

Returns :

True if the texture should have the same preference size of the underlying image.

Retrieves the value set using set_sync_size

clutter.Texture.set_sync_size

    def set_sync_size(sync_size)

sync_size :

True to maintain the aspect ratio.

Sets whether the texture should have the same preferred size as the underlying image.

clutter.Texture.get_repeat

    def get_repeat()

Returns :

a 2-tuple with the horizontal and vertical repeat limits.

Retrieves the value set using set_repeat

clutter.Texture.set_repeat

    def set_repeat(repeat_x, repeat_y)

repeat_x :

True to maintain the aspect ratio.

repeat_y :

True to maintain the aspect ratio.

Sets whether the texture should repeat horizontally or vertically when the actor size is bigger than the image size.

clutter.Texture.get_keep_aspect_ratio

    def get_keep_aspect_ratio()

Returns :

True if the texture should maintain the aspect ratio of the underlying image.

Retrieves the value set using set_keep_aspect_ratio

clutter.Texture.set_keep_aspect_ratio

    def set_keep_aspect_ratio(keep_aspect)

keep_aspect :

True to maintain the aspect ratio.

Sets whether the texture should have a preferred size maintaining the aspect ratio of the underlying image.