![]() |
![]() |
![]() |
clutk Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Properties |
CtkLayerActorCtkLayerActor — Class to easily stack images (with masks applied to them) on top of each other |
CtkLayerActor; CtkLayerActorClass; CtkLayerActorPrivate; ClutterActor * ctk_layer_actor_new (guint width
,guint height
); guint ctk_layer_actor_get_width (CtkLayerActor *self
); void ctk_layer_actor_set_width (CtkLayerActor *self
,guint width
); guint ctk_layer_actor_get_height (CtkLayerActor *self
); void ctk_layer_actor_set_height (CtkLayerActor *self
,guint height
); guint ctk_layer_actor_get_num_layers (CtkLayerActor *self
); void ctk_layer_actor_add_layer (CtkLayerActor *self
,CtkLayer *layer
); CtkLayer * ctk_layer_actor_get_layer (CtkLayerActor *self
,guint index
); void ctk_layer_actor_flatten (CtkLayerActor *self
); gboolean ctk_layer_actor_is_flattened (CtkLayerActor *self
);
"flattened" gboolean : Read "height" guint : Read / Write "num-layers" guint : Read "width" guint : Read / Write
CtkLayerActor allows to stack multiple images (with a mask applied) on top of each other. It's like a layered image in gimp using normal alpha- blending for the various layers. Each layer has to have the same size as the actor itself. This restriction is meant to keep things simple for the moment. In the future this can be loosened, should the need arise.
ClutterActor * ctk_layer_actor_new (guint width
,guint height
);
Creates a new CtkLayerActor, which can hold multiple layers (image/mask) to form a composited actor.
|
a guint |
|
a guint |
Returns : |
a ClutterActor or NULL in case of an error |
guint ctk_layer_actor_get_width (CtkLayerActor *self
);
Get the width of self
.
|
a CtkLayerActor |
Returns : |
a guint, the width of self
|
void ctk_layer_actor_set_width (CtkLayerActor *self
,guint width
);
Set the width of self
. Do that before passing the first layer. Remember
width and height of self
and any layer added to it have to match exactly!
|
a CtkLayerActor |
|
a guint |
guint ctk_layer_actor_get_height (CtkLayerActor *self
);
Get the height of self
.
|
a CtkLayerActor |
Returns : |
a guint, the height of self
|
void ctk_layer_actor_set_height (CtkLayerActor *self
,guint height
);
Set the height of self
. Do that before passing the first layer. Remember
width and height of self
and any layer added to it have to match exactly!
|
a CtkLayerActor |
|
a guint |
guint ctk_layer_actor_get_num_layers (CtkLayerActor *self
);
Get the number of layers in self
. If self
has been flattend before this
will return 1.
|
a CtkLayerActor |
Returns : |
a guint holding the number of layers in self (enabled and
non-enabled layers)
|
void ctk_layer_actor_add_layer (CtkLayerActor *self
,CtkLayer *layer
);
Add layer
to self
. If layer
or self
are NULL nothing happens. Remember
that height and width of layer
have to exactly match those of self
!
|
a CtkLayerActor |
|
a CtkLayer |
CtkLayer * ctk_layer_actor_get_layer (CtkLayerActor *self
,guint index
);
Grab the pointer to of a layer indicated by index
. Don't unref the returned
pointer!
|
a CtkLayerActor |
|
a guint indicating, which layer (counting starts at 0) to grab |
Returns : |
a CtkLayer or NULL, if index passed in was out-of-bound or self
was invalid
|
void ctk_layer_actor_flatten (CtkLayerActor *self
);
Collapse all (enabled) layers of a layer-actor into one single layer with a
full mask. Afterwards the self
will consist of only one layer. All other
layers will be freed and removed. This is an optimization you can do to
speed up the rendering of self
. Usually one layer means on pass, thus
keeping the number of layers to a minimum improves performance.
This operation cannot be undone.
Currently not implemented. Calling this does nothing.
|
a CtkLayerActor |
gboolean ctk_layer_actor_is_flattened (CtkLayerActor *self
);
Check if the layer-actor is flattened already, meaning all enabled layers were collapsed into a single layer with a full mask. A flattened layer-actor will consist of only one single layer.
|
a CtkLayerActor |
Returns : |
a gboolean, TRUE if self is flattened, FALSE if not or in an
error-case
|
"flattened"
property "flattened" gboolean : Read
Flag indicating if layer-actor is flattened.
Default value: FALSE
"height"
property "height" guint : Read / Write
Height of layer-actor in pixels.
Default value: 0
"num-layers"
property "num-layers" guint : Read
Number of layers used in layer-actor.
Default value: 0