:right-sidebar: True TextureDownloader =================================================================== .. currentmodule:: gi.repository.Gdk .. versionadded:: 4.10 .. class:: TextureDownloader(**kwargs) :no-contents-entry: :Constructors: :: new(texture:Gdk.Texture) -> Gdk.TextureDownloader Constructors ------------ .. rst-class:: interim-class .. class:: TextureDownloader :no-index: .. classmethod:: new(texture: ~gi.repository.Gdk.Texture) -> ~gi.repository.Gdk.TextureDownloader Creates a new texture downloader for ``texture``. .. versionadded:: 4.10 :param texture: texture to download Methods ------- .. rst-class:: interim-class .. class:: TextureDownloader :no-index: .. method:: download_bytes() -> tuple[~gi.repository.GLib.Bytes, int] 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 :obj:`~gi.repository.Gdk.TextureDownloader.download_into` once allocation succeeded. .. versionadded:: 4.10 .. method:: download_into(data: ~typing.Sequence[int], stride: int) -> None Downloads the ``texture`` into local memory. .. versionadded:: 4.10 :param data: pointer to enough memory to be filled with the downloaded data of the texture :param stride: rowstride in bytes .. method:: free() -> None Frees the given downloader and all its associated resources. .. versionadded:: 4.10 .. method:: get_format() -> ~gi.repository.Gdk.MemoryFormat Gets the format that the data will be downloaded in. .. versionadded:: 4.10 .. method:: get_texture() -> ~gi.repository.Gdk.Texture Gets the texture that the downloader will download. .. versionadded:: 4.10 .. method:: set_format(format: ~gi.repository.Gdk.MemoryFormat) -> None Sets the format the downloader will download. By default, GDK_MEMORY_DEFAULT is set. .. versionadded:: 4.10 :param format: the format to use .. method:: set_texture(texture: ~gi.repository.Gdk.Texture) -> None Changes the texture the downloader will download. .. versionadded:: 4.10 :param texture: the new texture to download