3.13 <GdkTextureDownloader>

Structure: <GdkTextureDownloader>

Used to download the contents of a <GdkTexture>.

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.

Procedures

Method: texture-downloader:copy self ⇒ %return
Method: copy self ⇒ %return

Creates a copy of the downloader.

This function is meant for language bindings.

self

Passed: a <GdkTextureDownloader>.

the downloader to copy

%return

Returned: a <GdkTextureDownloader>.

A copy of the downloader

Method: texture-downloader:download-bytes self ⇒ %return out-stride
Method: download-bytes self ⇒ %return 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 texture-downloader:download-into once allocation succeeded.

This function cannot be used with a multiplanar format. Use texture-downloader:download-bytes-with-planes! for that purpose.

self

Passed: a <GdkTextureDownloader>.

the downloader

%return

Returned: a <GBytes>.

The downloaded pixels

out-stride

Returned: an unsigned 64-bit integer.

The stride of the resulting data in bytes

Method: texture-downloader:download-bytes-with-planes! self out-offsets out-strides ⇒ %return out-offsets out-strides
Method: download-bytes-with-planes! self out-offsets out-strides ⇒ %return out-offsets out-strides

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.

self

Passed: a <GdkTextureDownloader>.

the downloader

out-offsets

Passed: an u64vector, or a list or vector, each an unsigned 64-bit integer. It is filled in, and returned: an u64vector.

The offsets of the resulting data planes in bytes

out-strides

Passed: an u64vector, or a list or vector, each an unsigned 64-bit integer. It is filled in, and returned: an u64vector.

The stride of the resulting data planes in bytes

%return

Returned: a <GBytes>.

The downloaded pixels

Method: texture-downloader:download-into self data stride
Method: download-into self data stride

Downloads the texture into local memory.

This function cannot be used with a multiplanar format.

self

Passed: a <GdkTextureDownloader>.

a texture downloader

data

Passed: a foreign pointer, or a bytevector.

pointer to enough memory to be filled with the downloaded data of the texture

stride

Passed: an unsigned 64-bit integer.

rowstride in bytes

Method: texture-downloader:free self
Method: free self

Frees the given downloader and all its associated resources.

self

Passed: a <GdkTextureDownloader>.

texture downloader to free

Method: texture-downloader:get-color-state self ⇒ %return
Method: get-color-state self ⇒ %return

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

self

Passed: a <GdkTextureDownloader>.

a texture downloader

%return

Returned: a <GdkColorState>.

The color state of the download

Method: texture-downloader:get-format self ⇒ %return
Method: get-format self ⇒ %return

Gets the format that the data will be downloaded in.

self

Passed: a <GdkTextureDownloader>.

a texture downloader

%return

Returned: a <GdkMemoryFormat>.

The format of the download

Method: texture-downloader:get-texture self ⇒ %return
Method: get-texture self ⇒ %return

Gets the texture that the downloader will download.

self

Passed: a <GdkTextureDownloader>.

a texture downloader

%return

Returned: a <GdkTexture>.

The texture to download

Procedure: texture-downloader:new texture ⇒ %return

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

Passed: a <GdkTexture>.

texture to download

%return

Returned: a <GdkTextureDownloader>.

A new texture downloader

Method: texture-downloader:set-color-state self color-state
Method: set-color-state self color-state

Sets the color state the downloader will convert the data to.

By default, the sRGB colorstate returned by ColorState.get_srgb is used.

self

Passed: a <GdkTextureDownloader>.

a texture downloader

color-state

Passed: a <GdkColorState>.

the color state to use

Method: texture-downloader:set-format self format
Method: set-format self format

Sets the format the downloader will download.

By default, GDK_MEMORY_DEFAULT is set.

self

Passed: a <GdkTextureDownloader>.

a texture downloader

format

Passed: a <GdkMemoryFormat>, or one of its symbols.

the format to use

Method: texture-downloader:set-texture self texture
Method: set-texture self texture

Changes the texture the downloader will download.

self

Passed: a <GdkTextureDownloader>.

a texture downloader

texture

Passed: a <GdkTexture>.

the new texture to download