Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
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
- newtype TextureDownloader = TextureDownloader (ManagedPtr TextureDownloader)
- textureDownloaderCopy :: (HasCallStack, MonadIO m) => TextureDownloader -> m TextureDownloader
- textureDownloaderDownloadBytes :: (HasCallStack, MonadIO m) => TextureDownloader -> m (Bytes, CSize)
- textureDownloaderDownloadInto :: (HasCallStack, MonadIO m) => TextureDownloader -> Ptr Word8 -> CSize -> m ()
- textureDownloaderFree :: (HasCallStack, MonadIO m) => TextureDownloader -> m ()
- textureDownloaderGetFormat :: (HasCallStack, MonadIO m) => TextureDownloader -> m MemoryFormat
- textureDownloaderGetTexture :: (HasCallStack, MonadIO m) => TextureDownloader -> m Texture
- textureDownloaderNew :: (HasCallStack, MonadIO m, IsTexture a) => a -> m TextureDownloader
- textureDownloaderSetFormat :: (HasCallStack, MonadIO m) => TextureDownloader -> MemoryFormat -> m ()
- textureDownloaderSetTexture :: (HasCallStack, MonadIO m, IsTexture a) => TextureDownloader -> a -> m ()
Exported types
newtype TextureDownloader Source #
Memory-managed wrapper type.
TextureDownloader (ManagedPtr TextureDownloader) |
Instances
Eq TextureDownloader Source # | |
Defined in GI.Gdk.Structs.TextureDownloader (==) :: TextureDownloader -> TextureDownloader -> Bool # (/=) :: TextureDownloader -> TextureDownloader -> Bool # | |
GBoxed TextureDownloader Source # | |
Defined in GI.Gdk.Structs.TextureDownloader | |
ManagedPtrNewtype TextureDownloader Source # | |
Defined in GI.Gdk.Structs.TextureDownloader toManagedPtr :: TextureDownloader -> ManagedPtr TextureDownloader | |
TypedObject TextureDownloader Source # | |
Defined in GI.Gdk.Structs.TextureDownloader | |
HasParentTypes TextureDownloader Source # | |
Defined in GI.Gdk.Structs.TextureDownloader | |
IsGValue (Maybe TextureDownloader) Source # | Convert |
Defined in GI.Gdk.Structs.TextureDownloader gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe TextureDownloader -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe TextureDownloader) | |
type ParentTypes TextureDownloader Source # | |
Defined in GI.Gdk.Structs.TextureDownloader |
Methods
Click to display all available methods, including inherited ones
copy
textureDownloaderCopy Source #
:: (HasCallStack, MonadIO m) | |
=> TextureDownloader |
|
-> 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 #
:: (HasCallStack, MonadIO m) | |
=> TextureDownloader |
|
-> 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 #
:: (HasCallStack, MonadIO m) | |
=> TextureDownloader |
|
-> Ptr Word8 |
|
-> CSize |
|
-> m () |
Downloads the texture
into local memory.
Since: 4.10
free
textureDownloaderFree Source #
:: (HasCallStack, MonadIO m) | |
=> TextureDownloader |
|
-> m () |
Frees the given downloader and all its associated resources.
Since: 4.10
getFormat
textureDownloaderGetFormat Source #
:: (HasCallStack, MonadIO m) | |
=> TextureDownloader |
|
-> m MemoryFormat | Returns: The format of the download |
Gets the format that the data will be downloaded in.
Since: 4.10
getTexture
textureDownloaderGetTexture Source #
:: (HasCallStack, MonadIO m) | |
=> TextureDownloader |
|
-> m Texture | Returns: The texture to download |
Gets the texture that the downloader will download.
Since: 4.10
new
:: (HasCallStack, MonadIO m, IsTexture a) | |
=> a |
|
-> m TextureDownloader | Returns: A new texture downloader |
Creates a new texture downloader for texture
.
Since: 4.10
setFormat
textureDownloaderSetFormat Source #
:: (HasCallStack, MonadIO m) | |
=> TextureDownloader |
|
-> MemoryFormat |
|
-> m () |
Sets the format the downloader will download.
By default, GDK_MEMORY_DEFAULT is set.
Since: 4.10
setTexture
textureDownloaderSetTexture Source #
:: (HasCallStack, MonadIO m, IsTexture a) | |
=> TextureDownloader |
|
-> a |
|
-> m () |
Changes the texture the downloader will download.
Since: 4.10