Class: Clutter::Image
- Inherits:
-
Object
- Object
- Clutter::Image
- Defined in:
- (unknown)
Overview
The Clutter::ImageClass structure contains private data.
Class Method Summary collapse
-
.new ⇒ Clutter::Content
Creates a new Clutter::Image instance.
Instance Method Summary collapse
-
#set_area(data, pixel_format, rect, row_stride) ⇒ Boolean
Sets the image data to be display by image, using rect to indicate the position and size of the image data to be set.
-
#set_bytes(data, pixel_format, width, height, row_stride) ⇒ Boolean
Sets the image data stored inside a #GBytes to be displayed by image.
-
#set_data(data, pixel_format, width, height, row_stride) ⇒ Boolean
Sets the image data to be displayed by image.
Class Method Details
.new ⇒ Clutter::Content
Creates a new Clutter::Image instance.
Instance Method Details
#set_area(data, pixel_format, rect, row_stride) ⇒ Boolean
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 Clutter::Image 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.
#set_bytes(data, pixel_format, width, height, row_stride) ⇒ Boolean
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.
#set_data(data, pixel_format, width, height, row_stride) ⇒ Boolean
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.
The image data is expected to be a linear array of RGBA or RGB pixel data; how to retrieve that data is left to platform specific image loaders. For instance, if you use the GdkPixbuf library:
ClutterContent *image = clutter_image_new ();
GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file (filename, NULL);
clutter_image_set_data (CLUTTER_IMAGE (image),
gdk_pixbuf_get_pixels (pixbuf),
gdk_pixbuf_get_has_alpha (pixbuf)
? COGL_PIXEL_FORMAT_RGBA_8888
: COGL_PIXEL_FORMAT_RGB_888,
gdk_pixbuf_get_width (pixbuf),
gdk_pixbuf_get_height (pixbuf),
gdk_pixbuf_get_rowstride (pixbuf),
&error);
g_object_unref (pixbuf);