Basics
Guides
API Reference
Basics
Guides
API Reference
[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.
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.
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 exposinghandle(), or null. Returns null when the argument carries no pointer.
Source is the raw handle, raw buffer, wrapper, or null.A raw pointer carrier or null when no pointer is present.getLib ()
Returns the opened native library for this generated wrapper.
The opened native library.handle ()
Returns the wrapped NativeHandle.
The wrapped NativeHandle.isNull ()
Returns true when the wrapped handle is null.
A bool.describe ()
Returns a small string for debugging generated wrappers.
A string.copy ()
Creates a copy of the downloader. This function is meant for language bindings.
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.
out_stride is The stride of the resulting data in bytes.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 to0.
out_offsets is The offsets of the resulting data planes in bytes.out_strides is The stride of the resulting data planes in bytes.The downloaded pixels.download_into (list data, int stride)
Downloads the @texture into local memory. This function cannot be used with a multiplanar format.
data is pointer to enough memory to be filled with the downloaded data of the texture.stride is rowstride in bytes.None.free ()
Frees the given downloader and all its associated resources.
None.get_color_state ()
Gets the color state that the data will be downloaded in.
The color state of the download.get_format ()
Gets the format that the data will be downloaded in.
The format of the download.get_texture ()
Gets the texture that the downloader will download.
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.
color_state is the color state to use.None.set_format (string format)
Sets the format the downloader will download. By default, GDK_MEMORY_DEFAULT is set.
format is the format to use.None.set_texture (object texture)
Changes the texture the downloader will download.
texture is the new texture to download.None.
Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.