Top | ![]() |
![]() |
![]() |
![]() |
CoglHandle * | cogl-material | Read / Write |
CoglHandle * | cogl-texture | Read / Write |
gboolean | disable-slicing | Read / Write / Construct Only |
gchar * | filename | Read / Write |
ClutterTextureQuality | filter-quality | Read / Write / Construct |
gboolean | keep-aspect-ratio | Read / Write |
gboolean | load-async | Write |
gboolean | load-data-async | Write |
gboolean | pick-with-alpha | Read / Write |
CoglPixelFormat | pixel-format | Read |
gboolean | repeat-x | Read / Write |
gboolean | repeat-y | Read / Write |
gboolean | sync-size | Read / Write |
gint | tile-waste | Read |
struct | ClutterTexture |
struct | ClutterTextureClass |
enum | ClutterTextureFlags |
enum | ClutterTextureQuality |
#define | CLUTTER_TEXTURE_ERROR |
enum | ClutterTextureError |
GObject ╰── GInitiallyUnowned ╰── ClutterActor ╰── ClutterTexture ├── ClutterCairoTexture ╰── ClutterX11TexturePixmap
ClutterTexture implements ClutterContainer, ClutterScriptable, ClutterAnimatable and AtkImplementorIface.
ClutterTexture is a base class for displaying and manipulating pixel buffer type data.
The clutter_texture_set_from_rgb_data()
and
clutter_texture_set_from_file()
functions are used to copy image
data into texture memory and subsequently realize the texture.
Note: a ClutterTexture will scale its contents to fit the bounding
box requested using clutter_actor_set_size()
. To display an area of
a texture without scaling, you should set the clip area using
clutter_actor_set_clip()
.
The ClutterTexture API is deprecated since Clutter 1.12. It is strongly recommended to use ClutterImage instead.
ClutterActor *
clutter_texture_new (void
);
clutter_texture_new
has been deprecated since version 1.12 and should not be used in newly-written code.
Use ClutterImage instead
Creates a new empty ClutterTexture object.
ClutterActor * clutter_texture_new_from_file (const gchar *filename
,GError **error
);
clutter_texture_new_from_file
has been deprecated since version 1.12 and should not be used in newly-written code.
No direct replacement is available. Use ClutterImage and platform-specific image loading API, like GdkPixbuf, instead
Creates a new ClutterTexture actor to display the image contained a
file. If the image failed to load then NULL is returned and error
is set.
Since: 0.8
ClutterActor *
clutter_texture_new_from_actor (ClutterActor *actor
);
clutter_texture_new_from_actor
has been deprecated since version 1.8 and should not be used in newly-written code.
Use the ClutterOffscreenEffect and ClutterShaderEffect directly on the intended ClutterActor to replace the functionality of this function.
Creates a new ClutterTexture object with its source a prexisting actor (and associated children). The textures content will contain 'live' redirected output of the actors scene.
Note this function is intented as a utility call for uniformly applying
shaders to groups and other potential visual effects. It requires that
the CLUTTER_FEATURE_OFFSCREEN
feature is supported by the current backend
and the target system.
Some tips on usage:
The source actor must be visible
The source actor must have a parent in order for it to be
allocated a size from the layouting mechanism. If the source
actor does not have a parent when this function is called then
the ClutterTexture will adopt it and allocate it at its
preferred size. Using this you can clone an actor that is
otherwise not displayed. Because of this feature if you do
intend to display the source actor then you must make sure that
the actor is parented before calling
clutter_texture_new_from_actor()
or that you unparent it before
adding it to a container.
When getting the image for the clone texture, Clutter will attempt to render the source actor exactly as it would appear if it was rendered on screen. The source actor's parent transformations are taken into account. Therefore if your source actor is rotated along the X or Y axes so that it has some depth, the texture will appear differently depending on the on-screen location of the source actor. While painting the source actor, Clutter will set up a temporary asymmetric perspective matrix as the projection matrix so that the source actor will be projected as if a small section of the screen was being viewed. Before version 0.8.2, an orthogonal identity projection was used which meant that the source actor would be clipped if any part of it was not on the zero Z-plane.
Avoid reparenting the source with the created texture.
A group can be padded with a transparent rectangle as to provide a border to contents for shader output (blurring text for example).
The texture will automatically resize to contain a further transformed source. However, this involves overhead and can be avoided by placing the source actor in a bounding group sized large enough to contain any child tranformations.
Uploading pixel data to the texture (e.g by using
clutter_texture_set_from_file()
) will destroy the offscreen texture
data and end redirection.
cogl_texture_get_data() with the handle returned by
clutter_texture_get_cogl_texture()
can be used to read the
offscreen texture pixels into a pixbuf.
Since: 0.6
gboolean clutter_texture_set_from_file (ClutterTexture *texture
,const gchar *filename
,GError **error
);
clutter_texture_set_from_file
has been deprecated since version 1.12 and should not be used in newly-written code.
Use ClutterImage and platform-specific image loading API, like GdkPixbuf, instead
Sets the ClutterTexture image data from an image file. In case of
failure, FALSE
is returned and error
is set.
If “load-async” is set to TRUE
, this function
will return as soon as possible, and the actual image loading
from disk will be performed asynchronously. “size-change”
will be emitten when the size of the texture is available and
“load-finished” will be emitted when the image has been
loaded or if an error occurred.
texture |
||
filename |
The filename of the image in GLib file name encoding |
|
error |
Return location for a GError, or |
Since: 0.8
gboolean clutter_texture_set_from_rgb_data (ClutterTexture *texture
,const guchar *data
,gboolean has_alpha
,gint width
,gint height
,gint rowstride
,gint bpp
,ClutterTextureFlags flags
,GError **error
);
clutter_texture_set_from_rgb_data
has been deprecated since version 1.12 and should not be used in newly-written code.
Use ClutterImage and clutter_image_set_data()
instead
Sets ClutterTexture image data.
texture |
||
data |
image data in RGBA type colorspace. |
[array] |
has_alpha |
set to |
|
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 and 4 supported, depending
on the value of |
|
flags |
||
error |
return location for a GError, or |
Since: 0.4
gboolean clutter_texture_set_from_yuv_data (ClutterTexture *texture
,const guchar *data
,gint width
,gint height
,ClutterTextureFlags flags
,GError **error
);
clutter_texture_set_from_yuv_data
has been deprecated since version 1.10 and should not be used in newly-written code.
Use a custom ClutterContent implementation and set up the Cogl pipeline using a ClutterPipelineNode with a fragment shader instead.
Sets a ClutterTexture from YUV image data. If an error occurred,
FALSE
is returned and error
is set.
The YUV support depends on the driver; the format supported by the few drivers exposing this capability are not really useful.
The proper way to convert image data in any YUV colorspace to any RGB colorspace is to use a fragment shader associated with the ClutterTexture material.
texture |
||
data |
Image data in YUV type colorspace. |
[array] |
width |
Width in pixels of image data. |
|
height |
Height in pixels of image data |
|
flags |
||
error |
Return location for a GError, or |
Since: 0.4
gboolean clutter_texture_set_area_from_rgb_data (ClutterTexture *texture
,const guchar *data
,gboolean has_alpha
,gint x
,gint y
,gint width
,gint height
,gint rowstride
,gint bpp
,ClutterTextureFlags flags
,GError **error
);
clutter_texture_set_area_from_rgb_data
has been deprecated since version 1.12 and should not be used in newly-written code.
Use ClutterImage and clutter_image_set_area()
instead
Updates a sub-region of the pixel data in a ClutterTexture.
texture |
||
data |
Image data in RGB type colorspace. |
[array] |
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 on source buffer. |
|
bpp |
bytes per pixel (Currently only 3 and 4 supported,
depending on |
|
flags |
||
error |
return location for a GError, or |
Since: 0.6
void clutter_texture_get_base_size (ClutterTexture *texture
,gint *width
,gint *height
);
clutter_texture_get_base_size
has been deprecated since version 1.12 and should not be used in newly-written code.
Use ClutterImage and clutter_content_get_preferred_size()
instead
Gets the size in pixels of the untransformed underlying image
CoglPixelFormat
clutter_texture_get_pixel_format (ClutterTexture *texture
);
clutter_texture_get_pixel_format
has been deprecated since version 1.12 and should not be used in newly-written code.
There is no direct replacement for this function
Retrieves the pixel format used by texture
. This is
equivalent to:
1 2 3 4 |
handle = clutter_texture_get_pixel_format (texture); if (handle != COGL_INVALID_HANDLE) format = cogl_texture_get_format (handle); |
Since: 1.0
gint
clutter_texture_get_max_tile_waste (ClutterTexture *texture
);
clutter_texture_get_max_tile_waste
has been deprecated since version 1.12 and should not be used in newly-written code.
No replacement is available
Gets the maximum waste that will be used when creating a texture or -1 if slicing is disabled.
Since: 0.8
ClutterTextureQuality
clutter_texture_get_filter_quality (ClutterTexture *texture
);
clutter_texture_get_filter_quality
has been deprecated since version 1.12 and should not be used in newly-written code.
Use ClutterImage and clutter_actor_get_content_scaling_filters()
instead
Gets the filter quality used when scaling a texture.
Since: 0.8
void clutter_texture_set_filter_quality (ClutterTexture *texture
,ClutterTextureQuality filter_quality
);
clutter_texture_set_filter_quality
has been deprecated since version 1.12 and should not be used in newly-written code.
Use ClutterImage and clutter_actor_set_content_scaling_filters()
instead
Sets the filter quality when scaling a texture. The quality is an
enumeration currently the following values are supported:
CLUTTER_TEXTURE_QUALITY_LOW
which is fast but only uses nearest neighbour
interpolation. CLUTTER_TEXTURE_QUALITY_MEDIUM
which is computationally a
bit more expensive (bilinear interpolation), and
CLUTTER_TEXTURE_QUALITY_HIGH
which uses extra texture memory resources to
improve scaled down rendering as well (by using mipmaps). The default value
is CLUTTER_TEXTURE_QUALITY_MEDIUM
.
Since: 0.8
CoglHandle
clutter_texture_get_cogl_texture (ClutterTexture *texture
);
clutter_texture_get_cogl_texture
has been deprecated since version 1.12 and should not be used in newly-written code.
No replacement available; it's not advisable to modify the Cogl pipeline of an actor. Use a ClutterContent implementation and set up the pipeline during the paint sequence instead.
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.
The texture handle returned is the first layer of the material
handle used by the ClutterTexture. If you need to access the other
layers you should use clutter_texture_get_cogl_material()
instead
and use the CoglMaterial API.
a CoglHandle for the texture. The returned handle is owned by the ClutterTexture and it should not be unreferenced.
[transfer none]
Since: 0.8
void clutter_texture_set_cogl_texture (ClutterTexture *texture
,CoglHandle cogl_tex
);
clutter_texture_set_cogl_texture
has been deprecated since version 1.12 and should not be used in newly-written code.
No replacement available; it's not advisable to modify the Cogl pipeline of an actor. Use a ClutterContent implementation and set up the pipeline during the paint sequence instead.
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.
Since: 0.8
CoglHandle
clutter_texture_get_cogl_material (ClutterTexture *texture
);
clutter_texture_get_cogl_material
has been deprecated since version 1.12 and should not be used in newly-written code.
No replacement is available; it's not advisable to modify the Cogl pipeline of an actor. Use a ClutterContent implementation and modify the pipeline during the paint sequence
Returns a handle to the underlying COGL material used for drawing the actor.
a handle for a CoglMaterial. The material is owned by the ClutterTexture and it should not be unreferenced.
[transfer none]
Since: 1.0
void clutter_texture_set_cogl_material (ClutterTexture *texture
,CoglHandle cogl_material
);
clutter_texture_set_cogl_material
has been deprecated since version 1.12 and should not be used in newly-written code.
No replacement is available; it's not advisable to modify the Cogl pipeline of an actor. Use a ClutterContent implementation and modify the pipeline during the paint sequence
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. ClutterTexture requires that the material have a texture
layer so you should set one on the material before calling this
function.
Since: 0.8
gboolean
clutter_texture_get_sync_size (ClutterTexture *texture
);
clutter_texture_get_sync_size
has been deprecated since version 1.12 and should not be used in newly-written code.
There is no direct replacement
Retrieves the value set with clutter_texture_set_sync_size()
Since: 1.0
void clutter_texture_set_sync_size (ClutterTexture *texture
,gboolean sync_size
);
clutter_texture_set_sync_size
has been deprecated since version 1.12 and should not be used in newly-written code.
No replacement is available. A ClutterActor using
ClutterImage with a CLUTTER_REQUEST_CONTENT_SIZE
request mode
will automatically bind the preferred size of the content to the
preferred size of the actor
Sets whether texture
should have the same preferred size as the
underlying image data.
texture |
||
sync_size |
|
Since: 1.0
void clutter_texture_get_repeat (ClutterTexture *texture
,gboolean *repeat_x
,gboolean *repeat_y
);
clutter_texture_get_repeat
has been deprecated since version 1.12 and should not be used in newly-written code.
Use ClutterImage and clutter_actor_get_content_repeat()
instead
Retrieves the horizontal and vertical repeat values set
using clutter_texture_set_repeat()
texture |
||
repeat_x |
return location for the horizontal repeat. |
[out] |
repeat_y |
return location for the vertical repeat. |
[out] |
Since: 1.0
void clutter_texture_set_repeat (ClutterTexture *texture
,gboolean repeat_x
,gboolean repeat_y
);
clutter_texture_set_repeat
has been deprecated since version 1.12 and should not be used in newly-written code.
Use ClutterImage and clutter_actor_set_content_repeat()
instead
Sets whether the texture
should repeat horizontally or
vertically when the actor size is bigger than the image size
texture |
||
repeat_x |
|
|
repeat_y |
|
Since: 1.0
gboolean
clutter_texture_get_keep_aspect_ratio (ClutterTexture *texture
);
clutter_texture_get_keep_aspect_ratio
has been deprecated since version 1.12 and should not be used in newly-written code.
Use ClutterImage and clutter_actor_get_content_gravity()
instead
Retrieves the value set using clutter_texture_set_keep_aspect_ratio()
Since: 1.0
void clutter_texture_set_keep_aspect_ratio (ClutterTexture *texture
,gboolean keep_aspect
);
clutter_texture_set_keep_aspect_ratio
has been deprecated since version 1.12 and should not be used in newly-written code.
Use ClutterImage and clutter_actor_set_content_gravity()
with CLUTTER_CONTENT_GRAVITY_RESIZE_ASPECT
instead
Sets whether texture
should have a preferred size maintaining
the aspect ratio of the underlying image
Since: 1.0
gboolean
clutter_texture_get_load_async (ClutterTexture *texture
);
clutter_texture_get_load_async
has been deprecated since version 1.12 and should not be used in newly-written code.
There is no direct replacement for this function
Retrieves the value set using clutter_texture_set_load_async()
Since: 1.0
void clutter_texture_set_load_async (ClutterTexture *texture
,gboolean load_async
);
clutter_texture_set_load_async
has been deprecated since version 1.12 and should not be used in newly-written code.
There is no direct replacement for this function. Use ClutterImage and platform-specific API for loading image data asynchronously, like GdkPixbuf
Sets whether texture
should use a worker thread to load the data
from disk asynchronously. Setting load_async
to TRUE
will make
clutter_texture_set_from_file()
return immediately.
See the “load-async” property documentation, and
clutter_texture_set_load_data_async()
.
Since: 1.0
gboolean
clutter_texture_get_load_data_async (ClutterTexture *texture
);
clutter_texture_get_load_data_async
has been deprecated since version 1.12 and should not be used in newly-written code.
There is no direct replacement for this function
Retrieves the value set by clutter_texture_set_load_data_async()
Since: 1.0
void clutter_texture_set_load_data_async (ClutterTexture *texture
,gboolean load_async
);
clutter_texture_set_load_data_async
has been deprecated since version 1.12 and should not be used in newly-written code.
There is no direct replacement for this function. Use ClutterImage and platform-specific API for loading image data asynchronously, like GdkPixbuf
Sets whether texture
should use a worker thread to load the data
from disk asynchronously. Setting load_async
to TRUE
will make
clutter_texture_set_from_file()
block until the ClutterTexture has
determined the width and height of the image data.
See the “load-async” property documentation, and
clutter_texture_set_load_async()
.
Since: 1.0
gboolean
clutter_texture_get_pick_with_alpha (ClutterTexture *texture
);
clutter_texture_get_pick_with_alpha
has been deprecated since version 1.12 and should not be used in newly-written code.
There is no direct replacement for this function
Retrieves the value set by clutter_texture_set_load_data_async()
Since: 1.4
void clutter_texture_set_pick_with_alpha (ClutterTexture *texture
,gboolean pick_with_alpha
);
clutter_texture_set_pick_with_alpha
has been deprecated since version 1.12 and should not be used in newly-written code.
There is no direct replacement for this function
Sets whether texture
should have it's shape defined by the alpha
channel when picking.
Be aware that this is a bit more costly than the default picking due to the texture lookup, extra test against the alpha value and the fact that it will also interrupt the batching of geometry done internally.
Also there is currently no control over the threshold used to determine what value of alpha is considered pickable, and so only fully opaque parts of the texture will react to picking.
Since: 1.4
struct ClutterTexture;
The ClutterTexture structure contains only private data and should be accessed using the provided API
Since: 0.2
struct ClutterTextureClass { void (* size_change) (ClutterTexture *texture, gint width, gint height); void (* pixbuf_change) (ClutterTexture *texture); void (* load_finished) (ClutterTexture *texture, const GError *error); };
The ClutterTextureClass structure contains only private data
handler for the “size-change” signal |
||
handler for the “pixbuf-change” signal |
||
handler for the “load-finished” signal |
Since: 0.2
ClutterTextureFlags
has been deprecated since version 1.22 and should not be used in newly-written code.
The ClutterTexture class was the only user of this API
Flags for clutter_texture_set_from_rgb_data()
and
clutter_texture_set_from_yuv_data()
.
Since: 0.4
ClutterTextureQuality
has been deprecated since version 1.22 and should not be used in newly-written code.
The ClutterTexture class was the only used ot
this API; use ClutterImage and clutter_actor_set_content_scaling_filters()
instead.
Enumaration controlling the texture quality.
fastest rendering will use nearest neighbour interpolation when rendering. good setting. |
||
higher quality rendering without using extra resources. |
||
render the texture with the best quality available using extra memory. |
Since: 0.8
#define CLUTTER_TEXTURE_ERROR (clutter_texture_error_quark ())
Error domain for ClutterTexture errors
Since: 0.4
“cogl-material”
property “cogl-material” CoglHandle *
The underlying Cogl material handle used to draw this actor.
Flags: Read / Write
“cogl-texture”
property “cogl-texture” CoglHandle *
The underlying Cogl texture handle used to draw this actor.
Flags: Read / Write
“disable-slicing”
property “disable-slicing” gboolean
Forces the underlying texture to be singular and not made of smaller space saving individual textures.
Flags: Read / Write / Construct Only
Default value: FALSE
“filename”
property “filename” gchar *
The path of the file containing the image data to be displayed by the texture.
This property is unset when using the clutter_texture_set_from_*_data() family of functions.
ClutterTexture:filename
has been deprecated since version 1.12 and should not be used in newly-written code.
Use ClutterImage and platform-specific image loading API, like GdkPixbuf
Flags: Read / Write
Default value: NULL
“filter-quality”
property“filter-quality” ClutterTextureQuality
Rendering quality used when drawing the texture.
Flags: Read / Write / Construct
Default value: CLUTTER_TEXTURE_QUALITY_MEDIUM
“keep-aspect-ratio”
property “keep-aspect-ratio” gboolean
Keep the aspect ratio of the texture when requesting the preferred width or height.
Flags: Read / Write
Default value: FALSE
“load-async”
property “load-async” gboolean
Tries to load a texture from a filename by using a local thread to perform the read operations. The initially created texture has dimensions 0x0 when the true size becomes available the “size-change” signal is emitted and when the image has completed loading the “load-finished” signal is emitted.
Threading is only enabled if g_thread_init()
has been called prior to
clutter_init()
, otherwise ClutterTexture will use the main loop to load
the image.
The upload of the texture data on the GL pipeline is not asynchronous, as
it must be performed from within the same thread that called
clutter_main()
.
ClutterTexture:load-async
has been deprecated since version 1.12 and should not be used in newly-written code.
Use platform-specific image loading API, like GdkPixbuf
Flags: Write
Default value: FALSE
Since: 1.0
“load-data-async”
property “load-data-async” gboolean
Like “load-async” but loads the width and height synchronously causing some blocking.
ClutterTexture:load-data-async
has been deprecated since version 1.12 and should not be used in newly-written code.
Use platform-specific image loading API, like GdkPixbuf
Flags: Write
Default value: FALSE
Since: 1.0
“pick-with-alpha”
property “pick-with-alpha” gboolean
Shape actor with alpha channel when picking.
Flags: Read / Write
Default value: FALSE
“pixel-format”
property “pixel-format” CoglPixelFormat
The Cogl pixel format to use.
Flags: Read
Default value: COGL_PIXEL_FORMAT_RGBA_8888
“repeat-x”
property “repeat-x” gboolean
Repeat the contents rather than scaling them horizontally.
Flags: Read / Write
Default value: FALSE
“repeat-y”
property “repeat-y” gboolean
Repeat the contents rather than scaling them vertically.
Flags: Read / Write
Default value: FALSE
“sync-size”
property “sync-size” gboolean
Auto sync size of actor to underlying pixbuf dimensions.
Flags: Read / Write
Default value: TRUE
“load-finished”
signalvoid user_function (ClutterTexture *texture, GError *error, gpointer user_data)
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
ClutterTexture::load-finished
has been deprecated since version 1.12 and should not be used in newly-written code.
No replacement is available
texture |
the texture which received the signal |
|
error |
A set error, or |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since: 1.0
“pixbuf-change”
signalvoid user_function (ClutterTexture *texture, gpointer user_data)
The ::pixbuf-change signal is emitted each time the pixbuf
used by texture
changes.
ClutterTexture::pixbuf-change
has been deprecated since version 1.12 and should not be used in newly-written code.
No replacement is available
texture |
the texture which received the signal |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“size-change”
signalvoid user_function (ClutterTexture *texture, gint width, gint height, gpointer user_data)
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.
ClutterTexture::size-change
has been deprecated since version 1.12 and should not be used in newly-written code.
No replacement is available
texture |
the texture which received the signal |
|
width |
the width of the new texture |
|
height |
the height of the new texture |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last