Gly.Creator
Description: Reference for Gly.Creator

### 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, 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);
      }
    }

Available since: 2.0

#### Ancestors

- GObject

#### Constructors

###### gly_creator_new

No description available.

since: 2.0

#### Instance methods

###### gly_creator_add_frame

No description available.

since: 2.0

###### gly_creator_add_frame_with_stride

No description available.

since: 2.0

###### 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_create

No description available.

since: 2.0

###### gly_creator_create_async

Asynchronous version of `gly_creator_create()`.

since: 2.0

###### gly_creator_create_finish

Finishes the `gly_creator_create_async()` call.

since: 2.0

###### gly_creator_set_encoding_compression

No description available.

since: 2.0

###### gly_creator_set_encoding_quality

No description available.

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

##### Methods inherited from GObject (43)

Please see GObject for a full list of methods.

#### Properties

###### Gly.Creator:mime-type

No description available.

###### Gly.Creator:sandbox-selector

No description available.

#### 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.

#### Class structure

    struct GlyCreatorClass {
      GObjectClass parent_class;

    }

No description available.

###### Class members

`parent_class: GObjectClass`

  No description available.