Top |
ChafaFrame * | chafa_frame_new () |
ChafaFrame * | chafa_frame_new_borrow () |
ChafaFrame * | chafa_frame_new_steal () |
void | chafa_frame_ref () |
void | chafa_frame_unref () |
A ChafaFrame contains the specific of a single frame of image data. It can be added to a ChafaImage.
ChafaFrame * chafa_frame_new (gconstpointer data
,ChafaPixelType pixel_type
,gint width
,gint height
,gint rowstride
);
Creates a new ChafaFrame containing a copy of the image data pointed to
by data
.
data |
Pointer to an image data buffer to copy from |
|
pixel_type |
The ChafaPixelType of the source data |
|
width |
Width of the image, in pixels |
|
height |
Height of the image, in pixels |
|
rowstride |
Number of bytes to advance from the start of one row to the next |
Since: 1.14
ChafaFrame * chafa_frame_new_borrow (gpointer data
,ChafaPixelType pixel_type
,gint width
,gint height
,gint rowstride
);
Creates a new ChafaFrame embedding the data
pointer. It's the caller's
responsibility to ensure the pointer remains valid for the lifetime of
the frame. The frame will not free the buffer when its reference count drops
to zero.
THIS IS DANGEROUS API which should only be used when the life cycle of the frame is short, stealing the buffer is impossible, and copying would cause unacceptable performance degradation.
Use chafa_frame_new()
instead.
data |
Pointer to an image data buffer to assign |
|
pixel_type |
The ChafaPixelType of the buffer |
|
width |
Width of the image, in pixels |
|
height |
Height of the image, in pixels |
|
rowstride |
Number of bytes to advance from the start of one row to the next |
Since: 1.14
ChafaFrame * chafa_frame_new_steal (gpointer data
,ChafaPixelType pixel_type
,gint width
,gint height
,gint rowstride
);
Creates a new ChafaFrame, which takes ownership of the data
buffer. The
buffer will be freed with
when the frame's reference count drops
to zero.g_free()
data |
Pointer to an image data buffer to assign |
|
pixel_type |
The ChafaPixelType of the buffer |
|
width |
Width of the image, in pixels |
|
height |
Height of the image, in pixels |
|
rowstride |
Number of bytes to advance from the start of one row to the next |
Since: 1.14
void
chafa_frame_ref (ChafaFrame *frame
);
Adds a reference to frame
.
Since: 1.14
void
chafa_frame_unref (ChafaFrame *frame
);
Removes a reference from frame
. When the reference count drops to zero,
the frame is freed and can no longer be used.
Since: 1.14