Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: GdkTextureDownloader

[18:7] extends: object

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.

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • GdkTextureDownloader (texture = null)

    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.

    • @p texture is texture to download.
  • 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.
  • copy ()

    Creates a copy of the downloader. This function is meant for language bindings.

    • @r A copy of the downloader.
  • download_bytes ()

    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. This function cannot be used with a multiplanar format. Use [method@Gdk.TextureDownloader.download_bytes_with_planes] for that purpose.

    • @p out_stride is The stride of the resulting data in bytes.
    • @r The downloaded pixels.
  • download_bytes_with_planes ()

    Downloads the given texture pixels into a GBytes. The offsets and strides of the resulting buffer will be stored in the respective values. If the format does have less than 4 planes, the remaining offsets and strides will be set to 0.

    • @p out_offsets is The offsets of the resulting data planes in bytes.
    • @p out_strides is The stride of the resulting data planes in bytes.
    • @r The downloaded pixels.
  • download_into (list data, int stride)

    Downloads the @texture into local memory. This function cannot be used with a multiplanar format.

    • @p data is pointer to enough memory to be filled with the downloaded data of the texture.
    • @p stride is rowstride in bytes.
    • @r None.
  • free ()

    Frees the given downloader and all its associated resources.

    • @r None.
  • get_color_state ()

    Gets the color state that the data will be downloaded in.

    • @r The color state of the download.
  • get_format ()

    Gets the format that the data will be downloaded in.

    • @r The format of the download.
  • get_texture ()

    Gets the texture that the downloader will download.

    • @r The texture to download.
  • set_color_state (object 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.

    • @p color_state is the color state to use.
    • @r None.
  • set_format (string format)

    Sets the format the downloader will download. By default, GDK_MEMORY_DEFAULT is set.

    • @p format is the format to use.
    • @r None.
  • set_texture (object texture)

    Changes the texture the downloader will download.

    • @p texture is the new texture to download.
    • @r None.