gi-gdk-4.0.8: Gdk bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Gdk.Structs.TextureDownloader

Description

The GdkTextureDownloader is used to download the contents of a 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.

Since: 4.10

Synopsis

Exported types

newtype TextureDownloader Source #

Memory-managed wrapper type.

Constructors

TextureDownloader (ManagedPtr TextureDownloader) 

Instances

Instances details
Eq TextureDownloader Source # 
Instance details

Defined in GI.Gdk.Structs.TextureDownloader

GBoxed TextureDownloader Source # 
Instance details

Defined in GI.Gdk.Structs.TextureDownloader

ManagedPtrNewtype TextureDownloader Source # 
Instance details

Defined in GI.Gdk.Structs.TextureDownloader

TypedObject TextureDownloader Source # 
Instance details

Defined in GI.Gdk.Structs.TextureDownloader

Methods

glibType :: IO GType

HasParentTypes TextureDownloader Source # 
Instance details

Defined in GI.Gdk.Structs.TextureDownloader

IsGValue (Maybe TextureDownloader) Source #

Convert TextureDownloader to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Gdk.Structs.TextureDownloader

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe TextureDownloader -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe TextureDownloader)

type ParentTypes TextureDownloader Source # 
Instance details

Defined in GI.Gdk.Structs.TextureDownloader

type ParentTypes TextureDownloader = '[] :: [Type]

Methods

Click to display all available methods, including inherited ones

Expand

Methods

copy, downloadBytes, downloadInto, free.

Getters

getFormat, getTexture.

Setters

setFormat, setTexture.

copy

textureDownloaderCopy Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> TextureDownloader

self: the downloader to copy

-> m TextureDownloader

Returns: A copy of the downloader

Creates a copy of the downloader.

This function is meant for language bindings.

Since: 4.10

downloadBytes

textureDownloaderDownloadBytes Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> TextureDownloader

self: the downloader

-> m (Bytes, CSize)

Returns: The downloaded pixels

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 textureDownloaderDownloadInto once allocation succeeded.

Since: 4.10

downloadInto

textureDownloaderDownloadInto Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> TextureDownloader

self: a texture downloader

-> Ptr Word8

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

-> CSize

stride: rowstride in bytes

-> m () 

Downloads the texture into local memory.

Since: 4.10

free

textureDownloaderFree Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> TextureDownloader

self: texture downloader to free

-> m () 

Frees the given downloader and all its associated resources.

Since: 4.10

getFormat

textureDownloaderGetFormat Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> TextureDownloader

self: a texture downloader

-> m MemoryFormat

Returns: The format of the download

Gets the format that the data will be downloaded in.

Since: 4.10

getTexture

textureDownloaderGetTexture Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> TextureDownloader

self: a texture downloader

-> m Texture

Returns: The texture to download

Gets the texture that the downloader will download.

Since: 4.10

new

textureDownloaderNew Source #

Arguments

:: (HasCallStack, MonadIO m, IsTexture a) 
=> a

texture: texture to download

-> m TextureDownloader

Returns: A new texture downloader

Creates a new texture downloader for texture.

Since: 4.10

setFormat

textureDownloaderSetFormat Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> TextureDownloader

self: a texture downloader

-> MemoryFormat

format: the format to use

-> m () 

Sets the format the downloader will download.

By default, GDK_MEMORY_DEFAULT is set.

Since: 4.10

setTexture

textureDownloaderSetTexture Source #

Arguments

:: (HasCallStack, MonadIO m, IsTexture a) 
=> TextureDownloader

self: a texture downloader

-> a

texture: the new texture to download

-> m () 

Changes the texture the downloader will download.

Since: 4.10