Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: MemoryTextureBuilder

[22:7] extends: object

Constructs [class@Gdk.Texture] objects from system memory provided via [struct@GLib.Bytes]. The operation is quite simple: Create a texture builder, set all the necessary properties - keep in mind that the properties [property@Gdk.MemoryTextureBuilder:bytes], [property@Gdk.MemoryTextureBuilder:stride], [property@Gdk.MemoryTextureBuilder:width], and [property@Gdk.MemoryTextureBuilder:height] are mandatory - and then call [method@Gdk.MemoryTextureBuilder.build] to create the new texture. GdkMemoryTextureBuilder can be used for quick one-shot construction of textures as well as kept around and reused to construct multiple textures.

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • MemoryTextureBuilder ()

    Creates a new texture builder.

  • toNativeHandle (Source)

    Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from fn.call(...), another generated wrapper exposing handle(), or null. Returns null when the argument carries no pointer.

    • @p Source is the raw handle, raw buffer, wrapper, or null.
    • @r A raw pointer carrier or null when no pointer is present.
  • getLib ()

    Returns the opened native library for this generated wrapper.

    • @r The opened native library.
  • handle ()

    Returns the wrapped NativeHandle.

    • @r The wrapped NativeHandle.
  • isNull ()

    Returns true when the wrapped handle is null.

    • @r A bool.
  • describe ()

    Returns a small string for debugging generated wrappers.

    • @r A string.
  • asObject ()

    Wraps this handle as Object.

    • @r A Object object.
  • getProperty (string Name)

    Reads one generated property by name.

  • setProperty (string Name, Value)

    Writes one generated property by name.

  • setBytes (object Value)

    The bytes holding the data.

    • @p Value is the new property value.
    • @r None.
  • setColorstate (object Value)

    The colorstate describing the data.

    • @p Value is the new property value.
    • @r None.
  • setFormat (string Value)

    The format of the data.

    • @p Value is the new property value.
    • @r None.
  • setHeight (int Value)

    The height of the texture.

    • @p Value is the new property value.
    • @r None.
  • setUpdateregion (object Value)

    The update region for [property@Gdk.MemoryTextureBuilder:update-texture].

    • @p Value is the new property value.
    • @r None.
  • setUpdatetexture (object Value)

    The texture [property@Gdk.MemoryTextureBuilder:update-region] is an update for.

    • @p Value is the new property value.
    • @r None.
  • setWidth (int Value)

    The width of the texture.

    • @p Value is the new property value.
    • @r None.
  • build ()

    Builds a new GdkTexture with the values set up in the builder. Note that it is a programming error to call this function if any mandatory property has not been set. It is possible to call this function multiple times to create multiple textures, possibly with changing properties in between.

  • get_bytes ()

    Gets the bytes previously set via gdk_memory_texture_builder_set_bytes() or %NULL if none was set.

  • get_color_state ()

    Gets the colorstate previously set via gdk_memory_texture_builder_set_color_state().

  • get_format ()

    Gets the format previously set via gdk_memory_texture_builder_set_format().

  • get_height ()

    Gets the height previously set via gdk_memory_texture_builder_set_height() or 0 if the height wasn't set.

  • get_offset (int plane)

    Gets the offset previously set via gdk_memory_texture_builder_set_offset().

    • @p plane is a plane.
  • get_stride ()

    Gets the stride previously set via gdk_memory_texture_builder_set_stride().

  • get_stride_for_plane (int plane)

    Gets the stride previously set via gdk_memory_texture_builder_set_stride_for_plane().

    • @p plane is a plane.
  • get_update_region ()

    Gets the region previously set via gdk_memory_texture_builder_set_update_region() or %NULL if none was set.

  • get_update_texture ()

    Gets the texture previously set via gdk_memory_texture_builder_set_update_texture() or %NULL if none was set.

  • get_width ()

    Gets the width previously set via gdk_memory_texture_builder_set_width() or 0 if the width wasn't set.

  • set_bytes (object bytes)

    Sets the data to be shown but the texture. The bytes must be set before calling [method@Gdk.MemoryTextureBuilder.build].

    • @p bytes is The bytes the texture shows or %NULL to unset.
    • @r None.
  • set_color_state (object color_state)

    Sets the colorstate describing the data. By default, the sRGB colorstate is used. If you don't know what colorstates are, this is probably the right thing.

    • @p color_state is The colorstate describing the data.
    • @r None.
  • set_format (string format)

    Sets the format of the bytes. The default is GDK_MEMORY_R8G8B8A8_PREMULTIPLIED.

    • @p format is The texture's format.
    • @r None.
  • set_height (int height)

    Sets the height of the texture. The height must be set before calling [method@Gdk.MemoryTextureBuilder.build] and conform to size requirements of the provided format.

    • @p height is The texture's height or 0 to unset.
    • @r None.
  • set_offset (int plane, int offset)

    Sets the offset of the texture for @plane.

    • @p plane is a plane.
    • @p offset is the texture's offset for @plane.
    • @r None.
  • set_stride (int stride)

    Sets the rowstride of the bytes used. The rowstride must be set before calling [method@Gdk.MemoryTextureBuilder.build].

    • @p stride is the stride or 0 to unset.
    • @r None.
  • set_stride_for_plane (int plane, int stride)

    Sets the stride of the texture for @plane.

    • @p plane is a plane.
    • @p stride is the texture's stride for @plane.
    • @r None.
  • set_update_region (object region)

    Sets the region to be updated by this texture. Together with [property@Gdk.MemoryTextureBuilder:update-texture], this describes an update of a previous texture. When rendering animations of large textures, it is possible that consecutive textures are only updating contents in parts of the texture. It is then possible to describe this update via these two properties, so that GTK can avoid rerendering parts that did not change. An example would be a screen recording where only the mouse pointer moves.

    • @p region is the region to update.
    • @r None.
  • set_update_texture (object texture)

    Sets the texture to be updated by this texture. See [method@Gdk.MemoryTextureBuilder.set_update_region] for an explanation.

    • @p texture is the texture to update.
    • @r None.
  • set_width (int width)

    Sets the width of the texture. The width must be set before calling [method@Gdk.MemoryTextureBuilder.build] and conform to size requirements of the provided format.

    • @p width is The texture's width or 0 to unset.
    • @r None.

class: MemoryTextureBuilderMeta

[451:14] static extends: object

Generated metadata helpers for MemoryTextureBuilder class surfaces.

Methods

  • properties ()

    Returns property metadata for MemoryTextureBuilder.

    • @r A list.