clutter.Texture
class clutter.Texture(clutter.Actor): |
__init__(filename
=None, disable_slicing
=False, load_async
=False, load_data_async
=False)
| a filename or None |
| if True slicing is disabled |
| if True a worker thread is used to load the data from disk async, returning inmediately. |
| 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 |
def set_from_rgb_data(data
, has_alpha
, width
, height
, rowstride
, bpp
, flags
)
| Image data in RGB colorspace. |
| Set to True if image data has alpha channel. |
| Width in pixels of image data. |
| Height in pixels of image data. |
| Distance in bytes between row starts. |
| bytes per pixel (Currently only 3 or 4 are supported, depending on has_alpha. ) |
| a ClutterTextureFlags |
Returns : | True on success, False on failure. |
Sets the texture from RGB image data. If an error ocurred False is returned.
def set_from_yuv_data(data
, width
, height
, flags
)
| Image data in YUV type colorspace. |
| Width in pixels of image data. |
| Height in pixels of image data. |
| a ClutterTextureFlags |
Returns : | True on success, False on failure. |
Sets the texture from YUV image data. If an error ocurred False is returned.
def set_area_from_rgb_data(data
, has_alpha
, x
, y
, width
, height
, rowstride
, bpp
, flags
)
| Image data in RGB type colorspace. |
| Set to True if image data has an alpha channel. |
| X coordinate of upper left corner of region to update. |
| Y coordinate of upper left corner of region to update. |
| Width in pixels of region to update. |
| Height in pixels of region to update. |
| Distance in bytes between row starts. |
| bytes per pixel (Currently only 3 and 4 supported, depending on has_alpha ) |
| a ClutterTextureFlags |
Returns : | True on success, False on failure. |
Updates a sub-region of the pixel data. If an error ocurred False is returned.
def set_from_file(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.
def get_base_size()
Returns : | a 2-tuple with the width and height |
Gets the size in pixels of the untransformed underlying image.
def set_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.
def get_filter_quality()
Returns : | a ClutterTextureQuality |
Returns the filter quality used when scaling a texture.
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.
def get_pixel_format()
Returns : | a CoglPixelFormat value |
Retrieves the pixel format used by texture.
def get_cogl_material()
Returns : | a CoglHandle |
Returns the handle to the underlying COGL material used for drawing the actor.
def set_cogl_material(cogl_material
)
| a CoglHandle for material |
Replaces the underlying COGL material drawn by this actor with cogl_material.
def get_cogl_texture()
Returns : | a CoglHandle |
Retrieves the handle to the underlying COGL texture used for drawing the actor.
def set_cogl_texture(cogl_tex
)
| a CoglHandle |
Replaces the underlying COGL texture drawn by this actor with cogl_tex.
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
def set_sync_size(sync_size
)
| True to maintain the aspect ratio. |
Sets whether the texture should have the same preferred size as the underlying image.
def get_repeat()
Returns : | a 2-tuple with the horizontal and vertical repeat limits. |
Retrieves the value set using set_repeat
def set_repeat(repeat_x
, repeat_y
)
| True to maintain the aspect ratio. |
| 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.
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