Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
The Image
structure contains
private data and should only be accessed using the provided
API.
Since: 1.10
Synopsis
- newtype Image = Image (ManagedPtr Image)
- class (GObject o, IsDescendantOf Image o) => IsImage o
- toImage :: (MonadIO m, IsImage o) => o -> m Image
- imageNew :: (HasCallStack, MonadIO m) => m Content
- imageSetArea :: (HasCallStack, MonadIO m, IsImage a) => a -> Ptr Word8 -> PixelFormat -> RectangleInt -> Word32 -> m ()
- imageSetBytes :: (HasCallStack, MonadIO m, IsImage a) => a -> Bytes -> PixelFormat -> Word32 -> Word32 -> Word32 -> m ()
- imageSetData :: (HasCallStack, MonadIO m, IsImage a) => a -> Ptr Word8 -> PixelFormat -> Word32 -> Word32 -> Word32 -> m ()
Exported types
Memory-managed wrapper type.
Instances
Eq Image Source # | |
GObject Image Source # | |
Defined in GI.Clutter.Objects.Image | |
ManagedPtrNewtype Image Source # | |
Defined in GI.Clutter.Objects.Image toManagedPtr :: Image -> ManagedPtr Image # | |
TypedObject Image Source # | |
Defined in GI.Clutter.Objects.Image | |
HasParentTypes Image Source # | |
Defined in GI.Clutter.Objects.Image | |
IsGValue (Maybe Image) Source # | Convert |
Defined in GI.Clutter.Objects.Image | |
type ParentTypes Image Source # | |
Defined in GI.Clutter.Objects.Image |
class (GObject o, IsDescendantOf Image o) => IsImage o Source #
Instances
(GObject o, IsDescendantOf Image o) => IsImage o Source # | |
Defined in GI.Clutter.Objects.Image |
Methods
Click to display all available methods, including inherited ones
Methods
bindProperty, bindPropertyFull, forceFloating, freezeNotify, getv, invalidate, isFloating, notify, notifyByPspec, ref, refSink, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.
Getters
getData, getPreferredSize, getProperty, getQdata.
Setters
new
:: (HasCallStack, MonadIO m) | |
=> m Content | Returns: the newly created |
Creates a new Image
instance.
Since: 1.10
setArea
:: (HasCallStack, MonadIO m, IsImage a) | |
=> a |
|
-> Ptr Word8 |
|
-> PixelFormat |
|
-> RectangleInt |
|
-> Word32 |
|
-> m () | (Can throw |
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
Image
will be the equivalent of calling imageSetData
.
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.
Since: 1.10
setBytes
:: (HasCallStack, MonadIO m, IsImage a) | |
=> a |
|
-> Bytes |
|
-> PixelFormat |
|
-> Word32 |
|
-> Word32 |
|
-> Word32 |
|
-> m () | (Can throw |
Sets the image data stored inside a Bytes
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 Bytes
is copied in texture memory,
and no additional reference is acquired on the data
.
Since: 1.12
setData
:: (HasCallStack, MonadIO m, IsImage a) | |
=> a |
|
-> Ptr Word8 |
|
-> PixelFormat |
|
-> Word32 |
|
-> Word32 |
|
-> Word32 |
|
-> m () | (Can throw |
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:
C code
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);
Since: 1.10