Class
GlyCreator
since: 2.0
Description [src]
final class Gly.Creator : GObject.Object
{
/* No available fields */
}
Image creator
#include <glycin.h>
GlyCreator *creator = gly_creator_new("image/jpeg", NULL);
if (!creator)
return;
// Create frame with a single red pixel
guint8 data[] = {255, 0, 0};
gsize length = sizeof(data);
GBytes *texture = g_bytes_new(data, length);
GlyNewFrame *new_frame = gly_creator_add_frame(creator, 1, 1, GLY_MEMORY_R8G8B8, texture);
// Create JPEG
GlyEncodedImage *encoded_image = gly_creator_create(creator, NULL);
if (encoded_image)
{
GBytes *binary_data = gly_encoded_image_get_data(encoded_image);
if (binary_data)
{
// Write image to file
GFile *file = g_file_new_for_path("test.jpg");
g_file_replace_contents(
file,
g_bytes_get_data(binary_data, NULL),
g_bytes_get_size(binary_data),
NULL,
FALSE,
G_FILE_CREATE_NONE,
NULL,
NULL,
NULL);
}
}
Available since: 2.0
Instance methods
gly_creator_add_metadata_key_value
Add metadata that are stored as key-value pairs.
A prominent example are PNG’s tEXt chunks.
since: 2.0
gly_creator_set_sandbox_selector
Selects which sandbox mechanism should be used. The default without calling this function is GlySandboxSelector.AUTO.
since: 2.0
Signals
Signals inherited from GObject (1)
GObject::notify
The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.