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.Objects.MemoryTextureBuilder

Description

Constructs Texture objects from system memory provided via Bytes.

The operation is quite simple: Create a texture builder, set all the necessary properties - keep in mind that the properties MemoryTextureBuilder:bytes, MemoryTextureBuilder:stride, MemoryTextureBuilder:width, and MemoryTextureBuilder:height are mandatory - and then call memoryTextureBuilderBuild to create the new texture.

GdkMemoryTextureBuilder can be used for quick one-shot construction of textures as well as kept around and reused to construct multiple textures.

Since: 4.16

Synopsis

Exported types

class (GObject o, IsDescendantOf MemoryTextureBuilder o) => IsMemoryTextureBuilder o Source #

Type class for types which can be safely cast to MemoryTextureBuilder, for instance with toMemoryTextureBuilder.

Instances

Instances details
(GObject o, IsDescendantOf MemoryTextureBuilder o) => IsMemoryTextureBuilder o Source # 
Instance details

Defined in GI.Gdk.Objects.MemoryTextureBuilder

toMemoryTextureBuilder :: (MonadIO m, IsMemoryTextureBuilder o) => o -> m MemoryTextureBuilder Source #

Cast to MemoryTextureBuilder, for types for which this is known to be safe. For general casts, use castTo.

Methods

build

memoryTextureBuilderBuild Source #

Arguments

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

self: a GdkMemoryTextureBuilder

-> m Texture

Returns: a newly built GdkTexture

Builds a new GdkTexture with the values set up in the builder.

Note that it is a programming error to call this function if any mandatory property has not been set.

It is possible to call this function multiple times to create multiple textures, possibly with changing properties in between.

Since: 4.16

getBytes

memoryTextureBuilderGetBytes Source #

Arguments

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

self: a GdkMemoryTextureBuilder

-> m (Maybe Bytes)

Returns: The bytes

Gets the bytes previously set via memoryTextureBuilderSetBytes or Nothing if none was set.

Since: 4.16

getColorState

memoryTextureBuilderGetColorState Source #

Arguments

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

self: a GdkMemoryTextureBuilder

-> m ColorState

Returns: The colorstate

Gets the colorstate previously set via memoryTextureBuilderSetColorState.

Since: 4.16

getFormat

memoryTextureBuilderGetFormat Source #

Arguments

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

self: a GdkMemoryTextureBuilder

-> m MemoryFormat

Returns: The format

Gets the format previously set via memoryTextureBuilderSetFormat.

Since: 4.16

getHeight

memoryTextureBuilderGetHeight Source #

Arguments

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

self: a GdkMemoryTextureBuilder

-> m Int32

Returns: The height

Gets the height previously set via memoryTextureBuilderSetHeight or 0 if the height wasn't set.

Since: 4.16

getOffset

memoryTextureBuilderGetOffset Source #

Arguments

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

self: a GdkMemoryTextureBuilder

-> Word32

plane: a plane

-> m CSize

Returns: The offset associated to a plane

Gets the offset previously set via memoryTextureBuilderSetOffset.

Since: 4.20

getStride

memoryTextureBuilderGetStride Source #

Arguments

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

self: a GdkMemoryTextureBuilder

-> m CSize

Returns: the stride

Gets the stride previously set via memoryTextureBuilderSetStride.

Since: 4.16

getStrideForPlane

memoryTextureBuilderGetStrideForPlane Source #

Arguments

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

self: a GdkMemoryTextureBuilder

-> Word32

plane: a plane

-> m CSize

Returns: The stride associated to a plane

Gets the stride previously set via memoryTextureBuilderSetStrideForPlane.

Since: 4.20

getUpdateRegion

memoryTextureBuilderGetUpdateRegion Source #

Arguments

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

self: a GdkMemoryTextureBuilder

-> m (Maybe Region)

Returns: The update region

Gets the region previously set via memoryTextureBuilderSetUpdateRegion or Nothing if none was set.

Since: 4.16

getUpdateTexture

memoryTextureBuilderGetUpdateTexture Source #

Arguments

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

self: a GdkMemoryTextureBuilder

-> m (Maybe Texture)

Returns: The update texture

Gets the texture previously set via memoryTextureBuilderSetUpdateTexture or Nothing if none was set.

Since: 4.16

getWidth

memoryTextureBuilderGetWidth Source #

Arguments

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

self: a GdkMemoryTextureBuilder

-> m Int32

Returns: The width

Gets the width previously set via memoryTextureBuilderSetWidth or 0 if the width wasn't set.

Since: 4.16

new

memoryTextureBuilderNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m MemoryTextureBuilder

Returns: the new GdkTextureBuilder

Creates a new texture builder.

Since: 4.16

setBytes

memoryTextureBuilderSetBytes Source #

Arguments

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

self: a GdkMemoryTextureBuilder

-> Maybe Bytes

bytes: The bytes the texture shows or Nothing to unset

-> m () 

Sets the data to be shown but the texture.

The bytes must be set before calling memoryTextureBuilderBuild.

Since: 4.16

setColorState

memoryTextureBuilderSetColorState Source #

Arguments

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

self: a GdkMemoryTextureBuilder

-> ColorState

colorState: The colorstate describing the data

-> m () 

Sets the colorstate describing the data.

By default, the sRGB colorstate is used. If you don't know what colorstates are, this is probably the right thing.

Since: 4.16

setFormat

memoryTextureBuilderSetFormat Source #

Arguments

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

self: a GdkMemoryTextureBuilder

-> MemoryFormat

format: The texture's format

-> m () 

Sets the format of the bytes.

The default is GDK_MEMORY_R8G8B8A8_PREMULTIPLIED.

Since: 4.16

setHeight

memoryTextureBuilderSetHeight Source #

Arguments

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

self: a GdkMemoryTextureBuilder

-> Int32

height: The texture's height or 0 to unset

-> m () 

Sets the height of the texture.

The height must be set before calling memoryTextureBuilderBuild and conform to size requirements of the provided format.

Since: 4.16

setOffset

memoryTextureBuilderSetOffset Source #

Arguments

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

self: a GdkMemoryTextureBuilder

-> Word32

plane: a plane

-> CSize

offset: the texture's offset for plane

-> m () 

Sets the offset of the texture for plane.

Since: 4.20

setStride

memoryTextureBuilderSetStride Source #

Arguments

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

self: a GdkMemoryTextureBuilder

-> CSize

stride: the stride or 0 to unset

-> m () 

Sets the rowstride of the bytes used.

The rowstride must be set before calling memoryTextureBuilderBuild.

Since: 4.16

setStrideForPlane

memoryTextureBuilderSetStrideForPlane Source #

Arguments

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

self: a GdkMemoryTextureBuilder

-> Word32

plane: a plane

-> CSize

stride: the texture's stride for plane

-> m () 

Sets the stride of the texture for plane.

Since: 4.20

setUpdateRegion

memoryTextureBuilderSetUpdateRegion Source #

Arguments

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

self: a GdkMemoryTextureBuilder

-> Maybe Region

region: the region to update

-> m () 

Sets the region to be updated by this texture.

Together with MemoryTextureBuilder:updateTexture, this describes an update of a previous texture.

When rendering animations of large textures, it is possible that consecutive textures are only updating contents in parts of the texture. It is then possible to describe this update via these two properties, so that GTK can avoid rerendering parts that did not change.

An example would be a screen recording where only the mouse pointer moves.

Since: 4.16

setUpdateTexture

memoryTextureBuilderSetUpdateTexture Source #

Arguments

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

self: a GdkMemoryTextureBuilder

-> Maybe b

texture: the texture to update

-> m () 

Sets the texture to be updated by this texture.

See memoryTextureBuilderSetUpdateRegion for an explanation.

Since: 4.16

setWidth

memoryTextureBuilderSetWidth Source #

Arguments

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

self: a GdkMemoryTextureBuilder

-> Int32

width: The texture's width or 0 to unset

-> m () 

Sets the width of the texture.

The width must be set before calling memoryTextureBuilderBuild and conform to size requirements of the provided format.

Since: 4.16

Properties

bytes

The bytes holding the data.

Since: 4.16

clearMemoryTextureBuilderBytes :: (MonadIO m, IsMemoryTextureBuilder o) => o -> m () Source #

Set the value of the “bytes” property to Nothing. When overloading is enabled, this is equivalent to

clear #bytes

constructMemoryTextureBuilderBytes :: (IsMemoryTextureBuilder o, MonadIO m) => Bytes -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “bytes” property. This is rarely needed directly, but it is used by new.

getMemoryTextureBuilderBytes :: (MonadIO m, IsMemoryTextureBuilder o) => o -> m (Maybe Bytes) Source #

Get the value of the “bytes” property. When overloading is enabled, this is equivalent to

get memoryTextureBuilder #bytes

setMemoryTextureBuilderBytes :: (MonadIO m, IsMemoryTextureBuilder o) => o -> Bytes -> m () Source #

Set the value of the “bytes” property. When overloading is enabled, this is equivalent to

set memoryTextureBuilder [ #bytes := value ]

colorState

The colorstate describing the data.

Since: 4.16

constructMemoryTextureBuilderColorState :: (IsMemoryTextureBuilder o, MonadIO m) => ColorState -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “color-state” property. This is rarely needed directly, but it is used by new.

getMemoryTextureBuilderColorState :: (MonadIO m, IsMemoryTextureBuilder o) => o -> m ColorState Source #

Get the value of the “color-state” property. When overloading is enabled, this is equivalent to

get memoryTextureBuilder #colorState

setMemoryTextureBuilderColorState :: (MonadIO m, IsMemoryTextureBuilder o) => o -> ColorState -> m () Source #

Set the value of the “color-state” property. When overloading is enabled, this is equivalent to

set memoryTextureBuilder [ #colorState := value ]

format

The format of the data.

Since: 4.16

constructMemoryTextureBuilderFormat :: (IsMemoryTextureBuilder o, MonadIO m) => MemoryFormat -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “format” property. This is rarely needed directly, but it is used by new.

getMemoryTextureBuilderFormat :: (MonadIO m, IsMemoryTextureBuilder o) => o -> m MemoryFormat Source #

Get the value of the “format” property. When overloading is enabled, this is equivalent to

get memoryTextureBuilder #format

setMemoryTextureBuilderFormat :: (MonadIO m, IsMemoryTextureBuilder o) => o -> MemoryFormat -> m () Source #

Set the value of the “format” property. When overloading is enabled, this is equivalent to

set memoryTextureBuilder [ #format := value ]

height

The height of the texture.

Since: 4.16

constructMemoryTextureBuilderHeight :: (IsMemoryTextureBuilder o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “height” property. This is rarely needed directly, but it is used by new.

getMemoryTextureBuilderHeight :: (MonadIO m, IsMemoryTextureBuilder o) => o -> m Int32 Source #

Get the value of the “height” property. When overloading is enabled, this is equivalent to

get memoryTextureBuilder #height

setMemoryTextureBuilderHeight :: (MonadIO m, IsMemoryTextureBuilder o) => o -> Int32 -> m () Source #

Set the value of the “height” property. When overloading is enabled, this is equivalent to

set memoryTextureBuilder [ #height := value ]

stride

The rowstride of the texture.

The rowstride is the number of bytes between the first pixel in a row of image data, and the first pixel in the next row.

Since: 4.16

constructMemoryTextureBuilderStride :: (IsMemoryTextureBuilder o, MonadIO m) => Word64 -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “stride” property. This is rarely needed directly, but it is used by new.

getMemoryTextureBuilderStride :: (MonadIO m, IsMemoryTextureBuilder o) => o -> m Word64 Source #

Get the value of the “stride” property. When overloading is enabled, this is equivalent to

get memoryTextureBuilder #stride

setMemoryTextureBuilderStride :: (MonadIO m, IsMemoryTextureBuilder o) => o -> Word64 -> m () Source #

Set the value of the “stride” property. When overloading is enabled, this is equivalent to

set memoryTextureBuilder [ #stride := value ]

updateRegion

The update region for MemoryTextureBuilder:updateTexture.

Since: 4.16

clearMemoryTextureBuilderUpdateRegion :: (MonadIO m, IsMemoryTextureBuilder o) => o -> m () Source #

Set the value of the “update-region” property to Nothing. When overloading is enabled, this is equivalent to

clear #updateRegion

constructMemoryTextureBuilderUpdateRegion :: (IsMemoryTextureBuilder o, MonadIO m) => Region -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “update-region” property. This is rarely needed directly, but it is used by new.

getMemoryTextureBuilderUpdateRegion :: (MonadIO m, IsMemoryTextureBuilder o) => o -> m (Maybe Region) Source #

Get the value of the “update-region” property. When overloading is enabled, this is equivalent to

get memoryTextureBuilder #updateRegion

setMemoryTextureBuilderUpdateRegion :: (MonadIO m, IsMemoryTextureBuilder o) => o -> Region -> m () Source #

Set the value of the “update-region” property. When overloading is enabled, this is equivalent to

set memoryTextureBuilder [ #updateRegion := value ]

updateTexture

The texture MemoryTextureBuilder:updateRegion is an update for.

Since: 4.16

clearMemoryTextureBuilderUpdateTexture :: (MonadIO m, IsMemoryTextureBuilder o) => o -> m () Source #

Set the value of the “update-texture” property to Nothing. When overloading is enabled, this is equivalent to

clear #updateTexture

constructMemoryTextureBuilderUpdateTexture :: (IsMemoryTextureBuilder o, MonadIO m, IsTexture a) => a -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “update-texture” property. This is rarely needed directly, but it is used by new.

getMemoryTextureBuilderUpdateTexture :: (MonadIO m, IsMemoryTextureBuilder o) => o -> m (Maybe Texture) Source #

Get the value of the “update-texture” property. When overloading is enabled, this is equivalent to

get memoryTextureBuilder #updateTexture

setMemoryTextureBuilderUpdateTexture :: (MonadIO m, IsMemoryTextureBuilder o, IsTexture a) => o -> a -> m () Source #

Set the value of the “update-texture” property. When overloading is enabled, this is equivalent to

set memoryTextureBuilder [ #updateTexture := value ]

width

The width of the texture.

Since: 4.16

constructMemoryTextureBuilderWidth :: (IsMemoryTextureBuilder o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “width” property. This is rarely needed directly, but it is used by new.

getMemoryTextureBuilderWidth :: (MonadIO m, IsMemoryTextureBuilder o) => o -> m Int32 Source #

Get the value of the “width” property. When overloading is enabled, this is equivalent to

get memoryTextureBuilder #width

setMemoryTextureBuilderWidth :: (MonadIO m, IsMemoryTextureBuilder o) => o -> Int32 -> m () Source #

Set the value of the “width” property. When overloading is enabled, this is equivalent to

set memoryTextureBuilder [ #width := value ]