Klasse TextureDownloader

Alle implementierten Schnittstellen:
PointerInterface

public class TextureDownloader extends Record
Used to download the contents of a [class@Gdk.Texture].

It is intended to be created as a short-term object for a single download,
but can be used for multiple downloads of different textures or with different
settings.

`GdkTextureDownloader` can be used to convert data between different formats.
Create a `GdkTexture` for the existing format and then download it in a
different format.

https://docs.gtk.org/gdk4/struct.TextureDownloader.html

  • Konstruktordetails

    • TextureDownloader

      public TextureDownloader(PointerContainer pointer)
    • TextureDownloader

      public TextureDownloader(@Nonnull Texture texture)
      Creates a new texture downloader for @texture.

      By default, the downloader will convert the data to
      the default memory format, and to the sRGB color state.
      Parameter:
      texture - texture to download
  • Methodendetails

    • getClassHandler

      public static ClassHandler getClassHandler()
    • copy

      public TextureDownloader copy()
      Creates a copy of the downloader.

      This function is meant for language bindings.
      Gibt zurück:
      A copy of the downloader
    • downloadBytes

      public Bytes downloadBytes(@Nonnull Int64 out_stride)
      Downloads the given texture pixels into a `GBytes`. The rowstride will
      be stored in the stride value.

      This function will abort if it tries to download a large texture and
      fails to allocate memory. If you think that may happen, you should handle
      memory allocation yourself and use [method@Gdk.TextureDownloader.download_into]
      once allocation succeeded.
      Parameter:
      out_stride - The stride of the resulting data in bytes
      Gibt zurück:
      The downloaded pixels
    • free

      public void free()
      Frees the given downloader and all its associated resources.
    • getColorState

      public ColorState getColorState()
      Gets the color state that the data will be downloaded in.
      Gibt zurück:
      The color state of the download
    • getFormat

      public int getFormat()
      Gets the format that the data will be downloaded in.
      Gibt zurück:
      The format of the download
    • getTexture

      public Texture getTexture()
      Gets the texture that the downloader will download.
      Gibt zurück:
      The texture to download
    • setColorState

      public void setColorState(@Nonnull ColorState color_state)
      Sets the color state the downloader will convert the data to.

      By default, the sRGB colorstate returned by [func@ColorState.get_srgb]
      is used.
      Parameter:
      color_state - the color state to use
    • setFormat

      public void setFormat(int format)
      Sets the format the downloader will download.

      By default, GDK_MEMORY_DEFAULT is set.
      Parameter:
      format - the format to use
    • setTexture

      public void setTexture(@Nonnull Texture texture)
      Changes the texture the downloader will download.
      Parameter:
      texture - the new texture to download
    • 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()