An actor for displaying and manipulating images.
<clutter-texture>
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
.
<clutter-actor>
)Creates a new empty
<clutter-texture>
object.
- ret
- A newly created
<clutter-texture>
object.
mchars
) ⇒ (ret <clutter-actor>
)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.
- filename
- The name of an image file to load.
- error
- Return locatoin for an error.
- ret
- A newly created
<clutter-texture>
object or NULL on error.Since 0.8
<clutter-texture>
) (filename mchars
) ⇒ (ret bool
)Sets the
<clutter-texture>
image data from an image file. In case of failure, ‘#f
’ is returned and error is set.If
<"load-async">
is set to ‘#t
’, 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
- A
<clutter-texture>
- filename
- The filename of the image in GLib file name encoding
- error
- Return location for a
<g-error>
, or ‘#f
’- ret
- ‘
#t
’ if the image was successfully loaded and setSince 0.8
<clutter-texture>
) ⇒ (width int
) (height int
)Gets the size in pixels of the untransformed underlying image
- texture
- a
<clutter-texture>
- width
- return location for the width, or ‘
#f
’.- height
- return location for the height, or ‘
#f
’.
<clutter-texture>
) ⇒ (ret int
)Gets the maximum waste that will be used when creating a texture or -1 if slicing is disabled.
- texture
- A
<clutter-texture>
- ret
- The maximum waste or -1 if the texture waste is unlimited.
Since 0.8
<clutter-texture>
) (filter_quality <clutter-texture-quality>
)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’.
- texture
- a
<clutter-texture>
- filter-quality
- new filter quality value
Since 0.8
<clutter-texture>
) ⇒ (ret bool
)Retrieves the value set with
clutter-texture-set-sync-size
- texture
- a
<clutter-texture>
- ret
- ‘
#t
’ if the<clutter-texture>
should have the same preferred size of the underlying image dataSince 1.0
<clutter-texture>
) (sync_size bool
)Sets whether texture should have the same preferred size as the underlying image data.
- texture
- a
<clutter-texture>
- sync-size
- ‘
#t
’ if the texture should have the same size of the underlying image dataSince 1.0
<clutter-texture>
) ⇒ (repeat_x bool
) (repeat_y bool
)Retrieves the horizontal and vertical repeat values set using
clutter-texture-set-repeat
- texture
- a
<clutter-texture>
- repeat-x
- return location for the horizontal repeat.
- repeat-y
- return location for the vertical repeat.
Since 1.0
<clutter-texture>
) (repeat_x bool
) (repeat_y bool
)Sets whether the texture should repeat horizontally or vertically when the actor size is bigger than the image size
- texture
- a
<clutter-texture>
- repeat-x
- ‘
#t
’ if the texture should repeat horizontally- repeat-y
- ‘
#t
’ if the texture should repeat verticallySince 1.0
<clutter-texture>
) ⇒ (ret bool
)Retrieves the value set using
clutter-texture-set-load-async
- texture
- a
<clutter-texture>
- ret
- ‘
#t
’ if the<clutter-texture>
should load the data from disk asynchronouslySince 1.0
<clutter-texture>
) (load_async bool
)Sets whether texture should use a worker thread to load the data from disk asynchronously. Setting load-async to ‘
#t
’ will makeclutter-texture-set-from-file
return immediately.See the
<"load-async">
property documentation, andclutter-texture-set-load-data-async
.
- texture
- a
<clutter-texture>
- load-async
- ‘
#t
’ if the texture should asynchronously load data from a filenameSince 1.0
<clutter-texture>
) ⇒ (ret bool
)Retrieves the value set by
clutter-texture-set-load-data-async
- texture
- a
<clutter-texture>
- ret
- ‘
#t
’ if the<clutter-texture>
should load the image data from a file asynchronouslySince 1.0
<clutter-texture>
) (load_async bool
)Sets whether texture should use a worker thread to load the data from disk asynchronously. Setting load-async to ‘
#t
’ will makeclutter-texture-set-from-file
block until the<clutter-texture>
has determined the width and height of the image data.See the
<"load-async">
property documentation, andclutter-texture-set-load-async
.
- texture
- a
<clutter-texture>
- load-async
- ‘
#t
’ if the texture should asynchronously load data from a filenameSince 1.0
<clutter-texture>
) ⇒ (ret bool
)Retrieves the value set by
clutter-texture-set-load-data-async
- texture
- a
<clutter-texture>
- ret
- ‘
#t
’ if the<clutter-texture>
should define its shape using the alpha channel when picking.Since 1.4
<clutter-texture>
) (pick_with_alpha bool
)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.
- texture
- a
<clutter-texture>
- pick-with-alpha
- ‘
#t
’ if the alpha channel should affect the picking shapeSince 1.4