gi-gdk4-4.0.10: Gdk bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.Gdk.Structs.TextureDownloader

Description

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.

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

getColorState, getFormat, getTexture.

Setters

setColorState, 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.

This function cannot be used with a multiplanar format. Use textureDownloaderDownloadBytesWithPlanes for that purpose.

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.

This function cannot be used with a multiplanar format.

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

getColorState

textureDownloaderGetColorState Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> TextureDownloader

self: a texture downloader

-> m ColorState

Returns: The color state of the download

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

Since: 4.16

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.

By default, the downloader will convert the data to the default memory format, and to the sRGB color state.

Since: 4.10

setColorState

textureDownloaderSetColorState Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> TextureDownloader

self: a texture downloader

-> ColorState

colorState: the color state to use

-> m () 

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

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

Since: 4.16

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