Creator


Object Hierarchy:

Object hierarchy for Creator

Description:

[ CCode ( type_id = "gly_creator_get_type ()" ) ]
[ Version ( since = "2.0" ) ]
public class Creator : Object

Image creator

```c 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, NULL);

// 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); } } ```


Namespace: Gly
Package: glycin-2

Content:

Properties:

Creation methods:

Methods:

Inherited Members: