Klasse MemoryTextureBuilder

Alle implementierten Schnittstellen:
PointerInterface

public class MemoryTextureBuilder extends PropertyHolder
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.

https://docs.gtk.org/gdk4/class.MemoryTextureBuilder.html

  • Konstruktordetails

    • MemoryTextureBuilder

      public MemoryTextureBuilder(PointerContainer pointer)
    • MemoryTextureBuilder

      public MemoryTextureBuilder()
      Creates a new texture builder.
  • Methodendetails

    • getClassHandler

      public static ClassHandler getClassHandler()
    • build

      public Texture 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.
      Gibt zurück:
      a newly built `GdkTexture`
    • getBytes

      public Bytes getBytes()
      Gets the bytes previously set via gdk_memory_texture_builder_set_bytes()
      or %NULL if none was set.
      Gibt zurück:
      The bytes
    • getColorState

      public ColorState getColorState()
      Gets the colorstate previously set via gdk_memory_texture_builder_set_color_state().
      Gibt zurück:
      The colorstate
    • getFormat

      public int getFormat()
      Gets the format previously set via gdk_memory_texture_builder_set_format().
      Gibt zurück:
      The format
    • getHeight

      public int getHeight()
      Gets the height previously set via gdk_memory_texture_builder_set_height()
      or 0 if the height wasn't set.
      Gibt zurück:
      The height
    • getStride

      public long getStride()
      Gets the stride previously set via gdk_memory_texture_builder_set_stride().
      Gibt zurück:
      the stride
    • getUpdateRegion

      public Region getUpdateRegion()
      Gets the region previously set via gdk_memory_texture_builder_set_update_region()
      or %NULL if none was set.
      Gibt zurück:
      The update region
    • getUpdateTexture

      public Texture getUpdateTexture()
      Gets the texture previously set via gdk_memory_texture_builder_set_update_texture()
      or %NULL if none was set.
      Gibt zurück:
      The update texture
    • getWidth

      public int getWidth()
      Gets the width previously set via gdk_memory_texture_builder_set_width()
      or 0 if the width wasn't set.
      Gibt zurück:
      The width
    • setBytes

      public void setBytes(@Nullable Bytes bytes)
      Sets the data to be shown but the texture.

      The bytes must be set before calling [method@Gdk.MemoryTextureBuilder.build].
      Parameter:
      bytes - The bytes the texture shows or %NULL to unset
    • setColorState

      public void setColorState(@Nullable ColorState 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.
      Parameter:
      color_state - The colorstate describing the data
    • setFormat

      public void setFormat(int format)
      Sets the format of the bytes.

      The default is `GDK_MEMORY_R8G8B8A8_PREMULTIPLIED`.
      Parameter:
      format - The texture's format
    • setHeight

      public void setHeight(int height)
      Sets the height of the texture.

      The height must be set before calling [method@Gdk.MemoryTextureBuilder.build].
      Parameter:
      height - The texture's height or 0 to unset
    • setStride

      public void setStride(long stride)
      Sets the rowstride of the bytes used.

      The rowstride must be set before calling [method@Gdk.MemoryTextureBuilder.build].
      Parameter:
      stride - the stride or 0 to unset
    • setUpdateRegion

      public void setUpdateRegion(@Nullable Region 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.
      Parameter:
      region - the region to update
    • setUpdateTexture

      public void setUpdateTexture(@Nullable Texture texture)
      Sets the texture to be updated by this texture.

      See [method@Gdk.MemoryTextureBuilder.set_update_region] for an explanation.
      Parameter:
      texture - the texture to update
    • setWidth

      public void setWidth(int width)
      Sets the width of the texture.

      The width must be set before calling [method@Gdk.MemoryTextureBuilder.build].
      Parameter:
      width - The texture's width or 0 to unset
    • getTypeID

      public static long getTypeID()
    • getParentTypeID

      public static long getParentTypeID()
    • getTypeSize

      public static TypeSystem.TypeSize getTypeSize()
    • getParentTypeSize

      public static TypeSystem.TypeSize getParentTypeSize()
    • getInstanceSize

      public static int getInstanceSize()