Method

ClutterImageset_area

Declaration [src]

gboolean
clutter_image_set_area (
  ClutterImage* image,
  const guint8* data,
  CoglPixelFormat pixel_format,
  const MtkRectangle* rect,
  guint row_stride,
  GError** error
)

Description [src]

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.

Parameters

data

Type: An array of guint8

The image data, as an array of bytes.

The data is owned by the caller of the method.
pixel_format

Type: CoglPixelFormat

The Cogl pixel format of the image data.

rect

Type: MtkRectangle

A rectangle indicating the area that should be set.

The data is owned by the caller of the method.
row_stride

Type: guint

The length of each row inside data.

error

Type: GError **

The return location for a recoverable error.

The argument can be NULL.
If the return location is not NULL, then you must initialize it to a NULL GError*.
The argument will be left initialized to NULL by the method if there are no errors.
In case of error, the argument will be set to a newly allocated GError; the caller will take ownership of the data, and be responsible for freeing it.

Return value

Type: gboolean

TRUE if the image data was successfully loaded, and FALSE otherwise.