Texture
Object Hierarchy:
Description:
The Texture structure contains only private data
Namespace: Clutter
Package: clutter-1.0
Content:
Properties:
Creation methods:
Methods:
-
public void get_base_size (out int width, out int height)
Gets the size in pixels of the untransformed underlying image
-
public weak Handle get_cogl_material ()
Returns a handle to the underlying COGL material used for drawing the actor.
-
public weak Handle get_cogl_texture ()
Retrieves the handle to the underlying COGL texture used for drawing the actor. No extra reference is
taken so if you need to keep the handle then you should call cogl_handle_ref on it.
-
public TextureQuality get_filter_quality ()
Gets the filter quality used when scaling a texture.
-
public bool get_keep_aspect_ratio ()
-
public bool get_load_async ()
-
public bool get_load_data_async ()
-
public int get_max_tile_waste ()
Gets the maximum waste that will be used when creating a texture or -1 if slicing is disabled.
-
public bool get_pick_with_alpha ()
-
public PixelFormat get_pixel_format ()
Retrieves the pixel format used by texture. This is equivalent to:
-
public void get_repeat (out bool repeat_x, out bool repeat_y)
Retrieves the horizontal and vertical repeat values set using
set_repeat
-
public bool get_sync_size ()
-
public bool set_area_from_rgb_data (uint8[] data, bool has_alpha, int x, int y, int width, int height, int rowstride, int bpp, TextureFlags flags) throws Error
Updates a sub-region of the pixel data in a Texture.
-
public void set_cogl_material (Handle cogl_material)
Replaces the underlying Cogl material drawn by this actor with cogl_material. A reference
to the material is taken so if the handle is no longer needed it should be deref'd with cogl_handle_unref. Texture data is attached
to the material so calling this function also replaces the Cogl texture. Texture
requires that the material have a texture layer so you should set one on the material before calling this function.
-
public void set_cogl_texture (Handle cogl_tex)
Replaces the underlying COGL texture drawn by this actor with cogl_tex. A reference to
the texture is taken so if the handle is no longer needed it should be deref'd with cogl_handle_unref.
-
public void set_filter_quality (TextureQuality filter_quality)
Sets the filter quality when scaling a texture. The quality is an enumeration currently the following
values are supported: LOW which is fast but only uses nearest
neighbour interpolation. MEDIUM which is computationally a bit
more expensive (bilinear interpolation), and HIGH which uses extra
texture memory resources to improve scaled down rendering as well (by using mipmaps). The default value is
MEDIUM.
-
public bool set_from_file (string filename) throws Error
Sets the Texture image data from an image file. In
case of failure, false is returned and error is set.
-
public bool set_from_rgb_data (uint8[] data, bool has_alpha, int width, int height, int rowstride, int bpp, TextureFlags flags) throws Error
-
public bool set_from_yuv_data (uint8[] data, int width, int height, TextureFlags flags) throws Error
Sets a Texture from YUV image data. If an error
occurred, false is returned and error is set.
-
public void set_keep_aspect_ratio (bool keep_aspect)
Sets whether texture should have a preferred size maintaining the aspect ratio of the
underlying image
-
public void set_load_async (bool load_async)
Sets whether texture should use a worker thread to load the data from disk
asynchronously. Setting load_async to true will make
set_from_file return immediately.
-
public void set_load_data_async (bool load_async)
Sets whether texture should use a worker thread to load the data from disk
asynchronously. Setting load_async to true will make
set_from_file block until the
Texture has determined the width and height of the image data.
-
public void set_pick_with_alpha (bool pick_with_alpha)
Sets whether texture should have it's shape defined by the alpha channel when picking.
-
public void set_repeat (bool repeat_x, bool repeat_y)
Sets whether the texture should repeat horizontally or vertically when the actor size is
bigger than the image size
-
public void set_sync_size (bool sync_size)
Sets whether texture should have the same preferred size as the underlying image data.
Signals:
-
public virtual void load_finished (Error error)
The load_finished signal is emitted
when a texture load has completed. If there was an error during loading, error will be set, otherwise it will be
null
-
public virtual void pixbuf_change ()
The pixbuf_change signal is emitted
each time the pixbuf used by texture changes.
-
public virtual void size_change (int width, int height)
The size_change signal is emitted each
time the size of the pixbuf used by texture changes. The new size is given as argument to the callback.