![]() |
![]() |
![]() |
Clutter Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces |
struct ClutterImage; struct ClutterImageClass; #define CLUTTER_IMAGE_ERROR enum ClutterImageError; ClutterContent * clutter_image_new (void
); gboolean clutter_image_set_data (ClutterImage *image
,const guint8 *data
,CoglPixelFormat pixel_format
,guint width
,guint height
,guint row_stride
,GError **error
); gboolean clutter_image_set_bytes (ClutterImage *image
,GBytes *data
,CoglPixelFormat pixel_format
,guint width
,guint height
,guint row_stride
,GError **error
); gboolean clutter_image_set_area (ClutterImage *image
,const guint8 *data
,CoglPixelFormat pixel_format
,const cairo_rectangle_int_t *rect
,guint row_stride
,GError **error
); CoglTexture * clutter_image_get_texture (ClutterImage *image
);
ClutterImage is a ClutterContent implementation that displays image data.
1 |
ClutterImage is available since Clutter 1.10.
struct ClutterImage;
The ClutterImage structure contains private data and should only be accessed using the provided API.
Since 1.10
struct ClutterImageClass { };
The ClutterImageClass structure contains private data.
Since 1.10
#define CLUTTER_IMAGE_ERROR (clutter_image_error_quark ())
Error domain for the ClutterImageError enumeration.
Since 1.10
typedef enum { CLUTTER_IMAGE_ERROR_INVALID_DATA } ClutterImageError;
Error enumeration for ClutterImage.
Invalid data passed to the
clutter_image_set_data() function.
|
Since 1.10
ClutterContent * clutter_image_new (void
);
Creates a new ClutterImage instance.
Returns : |
the newly created ClutterImage instance.
Use g_object_unref() when done. [transfer full]
|
Since 1.10
gboolean clutter_image_set_data (ClutterImage *image
,const guint8 *data
,CoglPixelFormat pixel_format
,guint width
,guint height
,guint row_stride
,GError **error
);
Sets the image data to be displayed by image
.
If the image data was successfully loaded, the image
will be invalidated.
In case of error, the error
value will be set, and this function will
return FALSE
.
The image data is copied in texture memory.
|
a ClutterImage |
|
the image data, as an array of bytes. [array] |
|
the Cogl pixel format of the image data |
|
the width of the image data |
|
the height of the image data |
|
the length of each row inside data
|
|
return location for a GError, or NULL
|
Returns : |
TRUE if the image data was successfully loaded,
and FALSE otherwise. |
Since 1.10
gboolean clutter_image_set_bytes (ClutterImage *image
,GBytes *data
,CoglPixelFormat pixel_format
,guint width
,guint height
,guint row_stride
,GError **error
);
Sets the image data stored inside a GBytes to be displayed by image
.
If the image data was successfully loaded, the image
will be invalidated.
In case of error, the error
value will be set, and this function will
return FALSE
.
The image data contained inside the GBytes is copied in texture memory,
and no additional reference is acquired on the data
.
|
a ClutterImage |
|
the image data, as a GBytes |
|
the Cogl pixel format of the image data |
|
the width of the image data |
|
the height of the image data |
|
the length of each row inside data
|
|
return location for a GError, or NULL
|
Returns : |
TRUE if the image data was successfully loaded,
and FALSE otherwise. |
Since 1.12
gboolean clutter_image_set_area (ClutterImage *image
,const guint8 *data
,CoglPixelFormat pixel_format
,const cairo_rectangle_int_t *rect
,guint row_stride
,GError **error
);
Sets the image data to be display by image
, using rect
to indicate
the position and size of the image data to be set.
If the image
does not have any image data set when this function is
called, a new texture will be created with the size of the width and
height of the rectangle, i.e. calling this function on a newly created
ClutterImage will be the equivalent of calling clutter_image_set_data()
.
If the image data was successfully loaded, the image
will be invalidated.
In case of error, the error
value will be set, and this function will
return FALSE
.
The image data is copied in texture memory.
|
a ClutterImage |
|
the image data, as an array of bytes. [array] |
|
the Cogl pixel format of the image data |
|
a rectangle indicating the area that should be set |
|
the length of each row inside data
|
|
return location for a GError, or NULL
|
Returns : |
TRUE if the image data was successfully loaded,
and FALSE otherwise. |
Since 1.10
CoglTexture * clutter_image_get_texture (ClutterImage *image
);
Retrieves a pointer to the Cogl texture used by image
.
If you change the contents of the returned Cogl texture you will need
to manually invalidate the image
with clutter_content_invalidate()
in order to update the actors using image
as their content.
|
a ClutterImage |
Returns : |
a pointer to the Cogl texture, or NULL . [transfer none]
|
Since 1.10
Stability Level: Unstable