package ocgtk

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Wrappers.Texture_downloader

type t = [ `texture_downloader ] Gobject.obj

The `GdkTextureDownloader` is 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.

val new_ : [ `texture | `object_ ] Gobject.obj -> t

Create a new TextureDownloader

val set_texture : t -> [ `texture | `object_ ] Gobject.obj -> unit

Changes the texture the downloader will download.

val set_format : t -> Gdk_enums.memoryformat -> unit

Sets the format the downloader will download.

By default, GDK_MEMORY_DEFAULT is set.

val get_texture : t -> [ `texture | `object_ ] Gobject.obj

Gets the texture that the downloader will download.

val get_format : t -> Gdk_enums.memoryformat

Gets the format that the data will be downloaded in.

val download_bytes : t -> Glib_bytes.t * Gsize.t

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.

val get_type : unit -> Gobject.Type.t