gi-gdk4-4.0.10: Gdk bindings

Copyright | Will Thompson and Iñaki García Etxebarria
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria
Safe Haskell | None
Language | Haskell2010

GI.Gdk.Objects.DmabufTextureBuilder

Contents

- Exported types
- Methods
  - build
  - getColorState
  - getDisplay
  - getFd
  - getFourcc
  - getHeight
  - getModifier
  - getNPlanes
  - getOffset
  - getPremultiplied
  - getStride
  - getUpdateRegion
  - getUpdateTexture
  - getWidth
  - new
  - setColorState
  - setDisplay
  - setFd
  - setFourcc
  - setHeight
  - setModifier
  - setNPlanes
  - setOffset
  - setPremultiplied
  - setStride
  - setUpdateRegion
  - setUpdateTexture
  - setWidth
- Properties
  - colorState
  - display
  - fourcc
  - height
  - modifier
  - nPlanes
  - premultiplied
  - updateRegion
  - updateTexture
  - width

Description

Constructs `Texture` objects from DMA buffers.

DMA buffers are commonly called _dma-bufs_.

DMA buffers are a feature of the Linux kernel to enable efficient buffer and memory sharing between hardware such as codecs, GPUs, displays, cameras and the kernel drivers controlling them. For example, a decoder may want its output to be directly shared with the display server for rendering without a copy.

Any device driver which participates in DMA buffer sharing, can do so as either the exporter or importer of buffers (or both).

The memory that is shared via DMA buffers is usually stored in non-system memory (maybe in device's local memory or something else not directly accessible by the CPU), and accessing this memory from the CPU may have higher-than-usual overhead.

In particular for graphics data, it is not uncommon that data consists of multiple separate blocks of memory, for example one block for each of the red, green and blue channels. These blocks are called _planes_. DMA buffers can have up to four planes. Even if the memory is a single block, the data can be organized in multiple planes, by specifying offsets from the beginning of the data.

DMA buffers are exposed to user-space as file descriptors allowing to pass them between processes. If a DMA buffer has multiple planes, more than one file descriptor may be present, up to the number of planes. If the number of file descriptors is less than the number of planes, the remaining ones should be set to -1.

The format of the data (for graphics data, essentially its colorspace) is described by a 32-bit integer. These format identifiers are defined in the header file `drm_fourcc.h` and commonly referred to as _fourcc_ values, since they are identified by 4 ASCII characters. Additionally, each DMA buffer has a _modifier_, which is a 64-bit integer that describes driver-specific details of the memory layout, such as tiling or compression.

For historical reasons, some producers of dma-bufs don't provide an explicit modifier, but instead return `DMA_FORMAT_MOD_INVALID` to indicate that their modifier is _implicit_. GTK tries to accommodate this situation by accepting `DMA_FORMAT_MOD_INVALID` as modifier.

The operation of `GdkDmabufTextureBuilder` is quite simple: Create a texture builder, set all the necessary properties, and then call `dmabufTextureBuilderBuild` to create the new texture.

The required properties for a dma-buf texture are

- The width and height in pixels
- The `fourcc` code and `modifier` which identify the format and memory layout of the dma-buf
- The file descriptor, offset and stride for each of the planes

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

For further information, see

- The Linux kernel documentation
- The header file drm_fourcc.h

Since: 4.14

Synopsis

- newtype DmabufTextureBuilder = DmabufTextureBuilder (ManagedPtr DmabufTextureBuilder)
- class (GObject o, IsDescendantOf DmabufTextureBuilder o) => IsDmabufTextureBuilder o
- toDmabufTextureBuilder :: (MonadIO m, IsDmabufTextureBuilder o) => o -> m DmabufTextureBuilder
- dmabufTextureBuilderBuild :: (HasCallStack, MonadIO m, IsDmabufTextureBuilder a) => a -> Maybe DestroyNotify -> Ptr () -> m (Maybe Texture)
- dmabufTextureBuilderGetColorState :: (HasCallStack, MonadIO m, IsDmabufTextureBuilder a) => a -> m (Maybe ColorState)
- dmabufTextureBuilderGetDisplay :: (HasCallStack, MonadIO m, IsDmabufTextureBuilder a) => a -> m Display
- dmabufTextureBuilderGetFd :: (HasCallStack, MonadIO m, IsDmabufTextureBuilder a) => a -> Word32 -> m Int32
- dmabufTextureBuilderGetFourcc :: (HasCallStack, MonadIO m, IsDmabufTextureBuilder a) => a -> m Word32
- dmabufTextureBuilderGetHeight :: (HasCallStack, MonadIO m, IsDmabufTextureBuilder a) => a -> m Word32
- dmabufTextureBuilderGetModifier :: (HasCallStack, MonadIO m, IsDmabufTextureBuilder a) => a -> m Word64
- dmabufTextureBuilderGetNPlanes :: (HasCallStack, MonadIO m, IsDmabufTextureBuilder a) => a -> m Word32
- dmabufTextureBuilderGetOffset :: (HasCallStack, MonadIO m, IsDmabufTextureBuilder a) => a -> Word32 -> m Word32
- dmabufTextureBuilderGetPremultiplied :: (HasCallStack, MonadIO m, IsDmabufTextureBuilder a) => a -> m Bool
- dmabufTextureBuilderGetStride :: (HasCallStack, MonadIO m, IsDmabufTextureBuilder a) => a -> Word32 -> m Word32
- dmabufTextureBuilderGetUpdateRegion :: (HasCallStack, MonadIO m, IsDmabufTextureBuilder a) => a -> m (Maybe Region)
- dmabufTextureBuilderGetUpdateTexture :: (HasCallStack, MonadIO m, IsDmabufTextureBuilder a) => a -> m (Maybe Texture)
- dmabufTextureBuilderGetWidth :: (HasCallStack, MonadIO m, IsDmabufTextureBuilder a) => a -> m Word32
- dmabufTextureBuilderNew :: (HasCallStack, MonadIO m) => m DmabufTextureBuilder
- dmabufTextureBuilderSetColorState :: (HasCallStack, MonadIO m, IsDmabufTextureBuilder a) => a -> Maybe ColorState -> m ()
- dmabufTextureBuilderSetDisplay :: (HasCallStack, MonadIO m, IsDmabufTextureBuilder a, IsDisplay b) => a -> b -> m ()
- dmabufTextureBuilderSetFd :: (HasCallStack, MonadIO m, IsDmabufTextureBuilder a) => a -> Word32 -> Int32 -> m ()
- dmabufTextureBuilderSetFourcc :: (HasCallStack, MonadIO m, IsDmabufTextureBuilder a) => a -> Word32 -> m ()
- dmabufTextureBuilderSetHeight :: (HasCallStack, MonadIO m, IsDmabufTextureBuilder a) => a -> Word32 -> m ()
- dmabufTextureBuilderSetModifier :: (HasCallStack, MonadIO m, IsDmabufTextureBuilder a) => a -> Word64 -> m ()
- dmabufTextureBuilderSetNPlanes :: (HasCallStack, MonadIO m, IsDmabufTextureBuilder a) => a -> Word32 -> m ()
- dmabufTextureBuilderSetOffset :: (HasCallStack, MonadIO m, IsDmabufTextureBuilder a) => a -> Word32 -> Word32 -> m ()
- dmabufTextureBuilderSetPremultiplied :: (HasCallStack, MonadIO m, IsDmabufTextureBuilder a) => a -> Bool -> m ()
- dmabufTextureBuilderSetStride :: (HasCallStack, MonadIO m, IsDmabufTextureBuilder a) => a -> Word32 -> Word32 -> m ()
- dmabufTextureBuilderSetUpdateRegion :: (HasCallStack, MonadIO m, IsDmabufTextureBuilder a) => a -> Maybe Region -> m ()
- dmabufTextureBuilderSetUpdateTexture :: (HasCallStack, MonadIO m, IsDmabufTextureBuilder a, IsTexture b) => a -> Maybe b -> m ()
- dmabufTextureBuilderSetWidth :: (HasCallStack, MonadIO m, IsDmabufTextureBuilder a) => a -> Word32 -> m ()
- clearDmabufTextureBuilderColorState :: (MonadIO m, IsDmabufTextureBuilder o) => o -> m ()
- constructDmabufTextureBuilderColorState :: (IsDmabufTextureBuilder o, MonadIO m) => ColorState -> m (GValueConstruct o)
- getDmabufTextureBuilderColorState :: (MonadIO m, IsDmabufTextureBuilder o) => o -> m (Maybe ColorState)
- setDmabufTextureBuilderColorState :: (MonadIO m, IsDmabufTextureBuilder o) => o -> ColorState -> m ()
- constructDmabufTextureBuilderDisplay :: (IsDmabufTextureBuilder o, MonadIO m, IsDisplay a) => a -> m (GValueConstruct o)
- getDmabufTextureBuilderDisplay :: (MonadIO m, IsDmabufTextureBuilder o) => o -> m Display
- setDmabufTextureBuilderDisplay :: (MonadIO m, IsDmabufTextureBuilder o, IsDisplay a) => o -> a -> m ()
- constructDmabufTextureBuilderFourcc :: (IsDmabufTextureBuilder o, MonadIO m) => Word32 -> m (GValueConstruct o)
- getDmabufTextureBuilderFourcc :: (MonadIO m, IsDmabufTextureBuilder o) => o -> m Word32
- setDmabufTextureBuilderFourcc :: (MonadIO m, IsDmabufTextureBuilder o) => o -> Word32 -> m ()
- constructDmabufTextureBuilderHeight :: (IsDmabufTextureBuilder o, MonadIO m) => Word32 -> m (GValueConstruct o)
- getDmabufTextureBuilderHeight :: (MonadIO m, IsDmabufTextureBuilder o) => o -> m Word32
- setDmabufTextureBuilderHeight :: (MonadIO m, IsDmabufTextureBuilder o) => o -> Word32 -> m ()
- constructDmabufTextureBuilderModifier :: (IsDmabufTextureBuilder o, MonadIO m) => Word64 -> m (GValueConstruct o)
- getDmabufTextureBuilderModifier :: (MonadIO m, IsDmabufTextureBuilder o) => o -> m Word64
- setDmabufTextureBuilderModifier :: (MonadIO m, IsDmabufTextureBuilder o) => o -> Word64 -> m ()
- constructDmabufTextureBuilderNPlanes :: (IsDmabufTextureBuilder o, MonadIO m) => Word32 -> m (GValueConstruct o)
- getDmabufTextureBuilderNPlanes :: (MonadIO m, IsDmabufTextureBuilder o) => o -> m Word32
- setDmabufTextureBuilderNPlanes :: (MonadIO m, IsDmabufTextureBuilder o) => o -> Word32 -> m ()
- constructDmabufTextureBuilderPremultiplied :: (IsDmabufTextureBuilder o, MonadIO m) => Bool -> m (GValueConstruct o)
- getDmabufTextureBuilderPremultiplied :: (MonadIO m, IsDmabufTextureBuilder o) => o -> m Bool
- setDmabufTextureBuilderPremultiplied :: (MonadIO m, IsDmabufTextureBuilder o) => o -> Bool -> m ()
- clearDmabufTextureBuilderUpdateRegion :: (MonadIO m, IsDmabufTextureBuilder o) => o -> m ()
- constructDmabufTextureBuilderUpdateRegion :: (IsDmabufTextureBuilder o, MonadIO m) => Region -> m (GValueConstruct o)
- getDmabufTextureBuilderUpdateRegion :: (MonadIO m, IsDmabufTextureBuilder o) => o -> m (Maybe Region)
- setDmabufTextureBuilderUpdateRegion :: (MonadIO m, IsDmabufTextureBuilder o) => o -> Region -> m ()
- clearDmabufTextureBuilderUpdateTexture :: (MonadIO m, IsDmabufTextureBuilder o) => o -> m ()
- constructDmabufTextureBuilderUpdateTexture :: (IsDmabufTextureBuilder o, MonadIO m, IsTexture a) => a -> m (GValueConstruct o)
- getDmabufTextureBuilderUpdateTexture :: (MonadIO m, IsDmabufTextureBuilder o) => o -> m (Maybe Texture)
- setDmabufTextureBuilderUpdateTexture :: (MonadIO m, IsDmabufTextureBuilder o, IsTexture a) => o -> a -> m ()
- constructDmabufTextureBuilderWidth :: (IsDmabufTextureBuilder o, MonadIO m) => Word32 -> m (GValueConstruct o)
- getDmabufTextureBuilderWidth :: (MonadIO m, IsDmabufTextureBuilder o) => o -> m Word32
- setDmabufTextureBuilderWidth :: (MonadIO m, IsDmabufTextureBuilder o) => o -> Word32 -> m ()

# Exported types

newtype DmabufTextureBuilder Source #

Memory-managed wrapper type.

Constructors

DmabufTextureBuilder (ManagedPtr DmabufTextureBuilder) |

#### Instances

Instances details

Eq DmabufTextureBuilder Source # |
Instance details Defined in GI.Gdk.Objects.DmabufTextureBuilder Methods (==) :: DmabufTextureBuilder -> DmabufTextureBuilder -> Bool Source # (/=) :: DmabufTextureBuilder -> DmabufTextureBuilder -> Bool Source #
GObject DmabufTextureBuilder Source # |
Instance details Defined in GI.Gdk.Objects.DmabufTextureBuilder
ManagedPtrNewtype DmabufTextureBuilder Source # |
Instance details Defined in GI.Gdk.Objects.DmabufTextureBuilder Methods toManagedPtr :: DmabufTextureBuilder -> ManagedPtr DmabufTextureBuilder Source #
TypedObject DmabufTextureBuilder Source # |
Instance details Defined in GI.Gdk.Objects.DmabufTextureBuilder Methods glibType :: IO GType Source #
HasParentTypes DmabufTextureBuilder Source # |
Instance details Defined in GI.Gdk.Objects.DmabufTextureBuilder
IsGValue (Maybe DmabufTextureBuilder) Source # | Convert `DmabufTextureBuilder` to and from `GValue`. See `toGValue` and `fromGValue`.
Instance details Defined in GI.Gdk.Objects.DmabufTextureBuilder Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Maybe DmabufTextureBuilder -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe DmabufTextureBuilder) Source #
type ParentTypes DmabufTextureBuilder Source # |
Instance details Defined in GI.Gdk.Objects.DmabufTextureBuilder type ParentTypes DmabufTextureBuilder = '[Object]

class (GObject o, IsDescendantOf DmabufTextureBuilder o) => IsDmabufTextureBuilder o Source #

Type class for types which can be safely cast to `DmabufTextureBuilder`, for instance with `toDmabufTextureBuilder`.

#### Instances

Instances details

(GObject o, IsDescendantOf DmabufTextureBuilder o) => IsDmabufTextureBuilder o Source # |
Instance details Defined in GI.Gdk.Objects.DmabufTextureBuilder

toDmabufTextureBuilder :: (MonadIO m, IsDmabufTextureBuilder o) => o -> m DmabufTextureBuilder Source #

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

# Methods

### Click to display all available methods, including inherited ones

Expand

#### Methods

bindProperty, bindPropertyFull, build, forceFloating, freezeNotify, getv, isFloating, notify, notifyByPspec, ref, refSink, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.

#### Getters

getColorState, getData, getDisplay, getFd, getFourcc, getHeight, getModifier, getNPlanes, getOffset, getPremultiplied, getProperty, getQdata, getStride, getUpdateRegion, getUpdateTexture, getWidth.

#### Setters

setColorState, setData, setDataFull, setDisplay, setFd, setFourcc, setHeight, setModifier, setNPlanes, setOffset, setPremultiplied, setProperty, setStride, setUpdateRegion, setUpdateTexture, setWidth.

## build

dmabufTextureBuilderBuild Source #

Arguments

:: (HasCallStack, MonadIO m, IsDmabufTextureBuilder a) |
=> a | `self`: a `GdkDmabufTextureBuilder`
-> Maybe DestroyNotify | `destroy`: destroy function to be called when the texture is released
-> Ptr () | `data`: user data to pass to the destroy function
-> m (Maybe Texture) | Returns: a newly built `GdkTexture` or `NULL` if the format is not supported (Can throw `GError`)

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

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

Not all formats defined in the `drm_fourcc.h` header are supported. You can use `displayGetDmabufFormats` to get a list of supported formats. If the format is not supported by GTK, `Nothing` will be returned and `error` will be set.

The `destroy` function gets called when the returned texture gets released.

It is the responsibility of the caller to keep the file descriptors for the planes open until the created texture is no longer used, and close them afterwards (possibly using the `destroy` notify).

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

Since: 4.14

## getColorState

dmabufTextureBuilderGetColorState Source #

Arguments

:: (HasCallStack, MonadIO m, IsDmabufTextureBuilder a) |
=> a | `self`: a `GdkDmabufTextureBuilder`
-> m (Maybe ColorState) | Returns: the color state

Gets the color state previously set via `dmabufTextureBuilderSetColorState`.

Since: 4.16

## getDisplay

dmabufTextureBuilderGetDisplay Source #

Arguments

:: (HasCallStack, MonadIO m, IsDmabufTextureBuilder a) |
=> a | `self`: a `GdkDmabufTextureBuilder
-> m Display | Returns: the display

Returns the display that this texture builder is associated with.

Since: 4.14

## getFd

dmabufTextureBuilderGetFd Source #

Arguments

:: (HasCallStack, MonadIO m, IsDmabufTextureBuilder a) |
=> a | `self`: a `GdkDmabufTextureBuilder`
-> Word32 | `plane`: the plane to get the fd for
-> m Int32 | Returns: the file descriptor

Gets the file descriptor for a plane or -1 if none.

Since: 4.14

## getFourcc

dmabufTextureBuilderGetFourcc Source #

Arguments

:: (HasCallStack, MonadIO m, IsDmabufTextureBuilder a) |
=> a | `self`: a `GdkDmabufTextureBuilder`
-> m Word32 | Returns: The format

Gets the format previously set via `dmabufTextureBuilderSetFourcc` or 0 if the format wasn't set.

The format is specified as a fourcc code.

Since: 4.14

## getHeight

dmabufTextureBuilderGetHeight Source #

Arguments

:: (HasCallStack, MonadIO m, IsDmabufTextureBuilder a) |
=> a | `self`: a `GdkDmabufTextureBuilder`
-> m Word32 | Returns: The height

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

Since: 4.14

## getModifier

dmabufTextureBuilderGetModifier Source #

Arguments

:: (HasCallStack, MonadIO m, IsDmabufTextureBuilder a) |
=> a | `self`: a `GdkDmabufTextureBuilder`
-> m Word64 | Returns: the modifier

Gets the modifier value.

Since: 4.14

## getNPlanes

dmabufTextureBuilderGetNPlanes Source #

Arguments

:: (HasCallStack, MonadIO m, IsDmabufTextureBuilder a) |
=> a | `self`: a `GdkDmabufTextureBuilder`
-> m Word32 | Returns: The number of planes

Gets the number of planes.

Since: 4.14

## getOffset

dmabufTextureBuilderGetOffset Source #

Arguments

:: (HasCallStack, MonadIO m, IsDmabufTextureBuilder a) |
=> a | `self`: a `GdkDmabufTextureBuilder`
-> Word32 | `plane`: the plane to get the offset for
-> m Word32 | Returns: the offset

Gets the offset value for a plane.

Since: 4.14

## getPremultiplied

dmabufTextureBuilderGetPremultiplied Source #

Arguments

:: (HasCallStack, MonadIO m, IsDmabufTextureBuilder a) |
=> a | `self`: a `GdkDmabufTextureBuilder`
-> m Bool | Returns: whether the data is premultiplied

Whether the data is premultiplied.

Since: 4.14

## getStride

dmabufTextureBuilderGetStride Source #

Arguments

:: (HasCallStack, MonadIO m, IsDmabufTextureBuilder a) |
=> a | `self`: a `GdkDmabufTextureBuilder`
-> Word32 | `plane`: the plane to get the stride for
-> m Word32 | Returns: the stride

Gets the stride value for a plane.

Since: 4.14

## getUpdateRegion

dmabufTextureBuilderGetUpdateRegion Source #

Arguments

:: (HasCallStack, MonadIO m, IsDmabufTextureBuilder a) |
=> a | `self`: a `GdkDmabufTextureBuilder`
-> m (Maybe Region) | Returns: The region

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

Since: 4.14

## getUpdateTexture

dmabufTextureBuilderGetUpdateTexture Source #

Arguments

:: (HasCallStack, MonadIO m, IsDmabufTextureBuilder a) |
=> a | `self`: a `GdkDmabufTextureBuilder`
-> m (Maybe Texture) | Returns: The texture

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

Since: 4.14

## getWidth

dmabufTextureBuilderGetWidth Source #

Arguments

:: (HasCallStack, MonadIO m, IsDmabufTextureBuilder a) |
=> a | `self`: a `GdkDmabufTextureBuilder`
-> m Word32 | Returns: The width

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

Since: 4.14

## new

dmabufTextureBuilderNew Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> m DmabufTextureBuilder | Returns: the new `GdkTextureBuilder`

Creates a new texture builder.

Since: 4.14

## setColorState

dmabufTextureBuilderSetColorState Source #

Arguments

:: (HasCallStack, MonadIO m, IsDmabufTextureBuilder a) |
=> a | `self`: a `GdkDmabufTextureBuilder`
-> Maybe ColorState | `colorState`: a `GdkColorState` or `NULL` to unset the colorstate.
-> m () |

Sets the color state for the texture.

By default, the colorstate is `NULL`. In that case, GTK will choose the correct colorstate based on the format. If you don't know what colorstates are, this is probably the right thing.

Since: 4.16

## setDisplay

dmabufTextureBuilderSetDisplay Source #

Arguments

:: (HasCallStack, MonadIO m, IsDmabufTextureBuilder a, IsDisplay b) |
=> a | `self`: a `GdkDmabufTextureBuilder
-> b | `display`: the display
-> m () |

Sets the display that this texture builder is associated with.

The display is used to determine the supported dma-buf formats.

Since: 4.14

## setFd

dmabufTextureBuilderSetFd Source #

Arguments

:: (HasCallStack, MonadIO m, IsDmabufTextureBuilder a) |
=> a | `self`: a `GdkDmabufTextureBuilder`
-> Word32 | `plane`: the plane to set the fd for
-> Int32 | `fd`: the file descriptor
-> m () |

Sets the file descriptor for a plane or to -1 to unset it.

Since: 4.14

## setFourcc

dmabufTextureBuilderSetFourcc Source #

Arguments

:: (HasCallStack, MonadIO m, IsDmabufTextureBuilder a) |
=> a | `self`: a `GdkDmabufTextureBuilder`
-> Word32 | `fourcc`: the texture's format or 0 to unset
-> m () |

Sets the format of the texture.

The format is specified as a fourcc code.

The format must be set before calling `dmabufTextureBuilderBuild`.

Since: 4.14

## setHeight

dmabufTextureBuilderSetHeight Source #

Arguments

:: (HasCallStack, MonadIO m, IsDmabufTextureBuilder a) |
=> a | `self`: a `GdkDmabufTextureBuilder`
-> Word32 | `height`: the texture's height or 0 to unset
-> m () |

Sets the height of the texture.

The height must be set before calling `dmabufTextureBuilderBuild`.

Since: 4.14

## setModifier

dmabufTextureBuilderSetModifier Source #

Arguments

:: (HasCallStack, MonadIO m, IsDmabufTextureBuilder a) |
=> a | `self`: a `GdkDmabufTextureBuilder`
-> Word64 | `modifier`: the modifier value
-> m () |

Sets the modifier.

Since: 4.14

## setNPlanes

dmabufTextureBuilderSetNPlanes Source #

Arguments

:: (HasCallStack, MonadIO m, IsDmabufTextureBuilder a) |
=> a | `self`: a `GdkDmabufTextureBuilder`
-> Word32 | `nPlanes`: the number of planes
-> m () |

Sets the number of planes of the texture.

Since: 4.14

## setOffset

dmabufTextureBuilderSetOffset Source #

Arguments

:: (HasCallStack, MonadIO m, IsDmabufTextureBuilder a) |
=> a | `self`: a `GdkDmabufTextureBuilder`
-> Word32 | `plane`: the plane to set the offset for
-> Word32 | `offset`: the offset value
-> m () |

Sets the offset for a plane.

Since: 4.14

## setPremultiplied

dmabufTextureBuilderSetPremultiplied Source #

Arguments

:: (HasCallStack, MonadIO m, IsDmabufTextureBuilder a) |
=> a | `self`: a `GdkDmabufTextureBuilder`
-> Bool | `premultiplied`: whether the data is premultiplied
-> m () |

Sets whether the data is premultiplied.

Unless otherwise specified, all formats including alpha channels are assumed to be premultiplied.

Since: 4.14

## setStride

dmabufTextureBuilderSetStride Source #

Arguments

:: (HasCallStack, MonadIO m, IsDmabufTextureBuilder a) |
=> a | `self`: a `GdkDmabufTextureBuilder`
-> Word32 | `plane`: the plane to set the stride for
-> Word32 | `stride`: the stride value
-> m () |

Sets the stride for a plane.

The stride must be set for all planes before calling `dmabufTextureBuilderBuild`.

Since: 4.14

## setUpdateRegion

dmabufTextureBuilderSetUpdateRegion Source #

Arguments

:: (HasCallStack, MonadIO m, IsDmabufTextureBuilder a) |
=> a | `self`: a `GdkDmabufTextureBuilder`
-> Maybe Region | `region`: the region to update
-> m () |

Sets the region to be updated by this texture. Together with DmabufTextureBuilder: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.14

## setUpdateTexture

dmabufTextureBuilderSetUpdateTexture Source #

Arguments

:: (HasCallStack, MonadIO m, IsDmabufTextureBuilder a, IsTexture b) |
=> a | `self`: a `GdkDmabufTextureBuilder`
-> Maybe b | `texture`: the texture to update
-> m () |

Sets the texture to be updated by this texture. See `dmabufTextureBuilderSetUpdateRegion` for an explanation.

Since: 4.14

## setWidth

dmabufTextureBuilderSetWidth Source #

Arguments

:: (HasCallStack, MonadIO m, IsDmabufTextureBuilder a) |
=> a | `self`: a `GdkDmabufTextureBuilder`
-> Word32 | `width`: The texture's width or 0 to unset
-> m () |

Sets the width of the texture.

The width must be set before calling `dmabufTextureBuilderBuild`.

Since: 4.14

# Properties

## colorState

The color state of the texture.

Since: 4.16

clearDmabufTextureBuilderColorState :: (MonadIO m, IsDmabufTextureBuilder o) => o -> m () Source #

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

    clear #colorState

constructDmabufTextureBuilderColorState :: (IsDmabufTextureBuilder 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`.

getDmabufTextureBuilderColorState :: (MonadIO m, IsDmabufTextureBuilder o) => o -> m (Maybe ColorState) Source #

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

    get dmabufTextureBuilder #colorState

setDmabufTextureBuilderColorState :: (MonadIO m, IsDmabufTextureBuilder o) => o -> ColorState -> m () Source #

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

    set dmabufTextureBuilder [ #colorState := value ]

## display

The display that this texture will be used on.

Since: 4.14

constructDmabufTextureBuilderDisplay :: (IsDmabufTextureBuilder o, MonadIO m, IsDisplay a) => a -> m (GValueConstruct o) Source #

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

getDmabufTextureBuilderDisplay :: (MonadIO m, IsDmabufTextureBuilder o) => o -> m Display Source #

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

    get dmabufTextureBuilder #display

setDmabufTextureBuilderDisplay :: (MonadIO m, IsDmabufTextureBuilder o, IsDisplay a) => o -> a -> m () Source #

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

    set dmabufTextureBuilder [ #display := value ]

## fourcc

The format of the texture, as a fourcc value.

Since: 4.14

constructDmabufTextureBuilderFourcc :: (IsDmabufTextureBuilder o, MonadIO m) => Word32 -> m (GValueConstruct o) Source #

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

getDmabufTextureBuilderFourcc :: (MonadIO m, IsDmabufTextureBuilder o) => o -> m Word32 Source #

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

    get dmabufTextureBuilder #fourcc

setDmabufTextureBuilderFourcc :: (MonadIO m, IsDmabufTextureBuilder o) => o -> Word32 -> m () Source #

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

    set dmabufTextureBuilder [ #fourcc := value ]

## height

The height of the texture.

Since: 4.14

constructDmabufTextureBuilderHeight :: (IsDmabufTextureBuilder o, MonadIO m) => Word32 -> 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`.

getDmabufTextureBuilderHeight :: (MonadIO m, IsDmabufTextureBuilder o) => o -> m Word32 Source #

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

    get dmabufTextureBuilder #height

setDmabufTextureBuilderHeight :: (MonadIO m, IsDmabufTextureBuilder o) => o -> Word32 -> m () Source #

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

    set dmabufTextureBuilder [ #height := value ]

## modifier

The modifier.

Since: 4.14

constructDmabufTextureBuilderModifier :: (IsDmabufTextureBuilder o, MonadIO m) => Word64 -> m (GValueConstruct o) Source #

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

getDmabufTextureBuilderModifier :: (MonadIO m, IsDmabufTextureBuilder o) => o -> m Word64 Source #

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

    get dmabufTextureBuilder #modifier

setDmabufTextureBuilderModifier :: (MonadIO m, IsDmabufTextureBuilder o) => o -> Word64 -> m () Source #

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

    set dmabufTextureBuilder [ #modifier := value ]

## nPlanes

The number of planes of the texture.

Note that you can set properties for other planes, but they will be ignored when constructing the texture.

Since: 4.14

constructDmabufTextureBuilderNPlanes :: (IsDmabufTextureBuilder o, MonadIO m) => Word32 -> m (GValueConstruct o) Source #

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

getDmabufTextureBuilderNPlanes :: (MonadIO m, IsDmabufTextureBuilder o) => o -> m Word32 Source #

Get the value of the “`n-planes`” property. When overloading is enabled, this is equivalent to

    get dmabufTextureBuilder #nPlanes

setDmabufTextureBuilderNPlanes :: (MonadIO m, IsDmabufTextureBuilder o) => o -> Word32 -> m () Source #

Set the value of the “`n-planes`” property. When overloading is enabled, this is equivalent to

    set dmabufTextureBuilder [ #nPlanes := value ]

## premultiplied

Whether the alpha channel is premultiplied into the others.

Only relevant if the format has alpha.

Since: 4.14

constructDmabufTextureBuilderPremultiplied :: (IsDmabufTextureBuilder o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

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

getDmabufTextureBuilderPremultiplied :: (MonadIO m, IsDmabufTextureBuilder o) => o -> m Bool Source #

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

    get dmabufTextureBuilder #premultiplied

setDmabufTextureBuilderPremultiplied :: (MonadIO m, IsDmabufTextureBuilder o) => o -> Bool -> m () Source #

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

    set dmabufTextureBuilder [ #premultiplied := value ]

## updateRegion

The update region for DmabufTextureBuilder:updateTexture.

Since: 4.14

clearDmabufTextureBuilderUpdateRegion :: (MonadIO m, IsDmabufTextureBuilder o) => o -> m () Source #

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

    clear #updateRegion

constructDmabufTextureBuilderUpdateRegion :: (IsDmabufTextureBuilder 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`.

getDmabufTextureBuilderUpdateRegion :: (MonadIO m, IsDmabufTextureBuilder o) => o -> m (Maybe Region) Source #

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

    get dmabufTextureBuilder #updateRegion

setDmabufTextureBuilderUpdateRegion :: (MonadIO m, IsDmabufTextureBuilder o) => o -> Region -> m () Source #

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

    set dmabufTextureBuilder [ #updateRegion := value ]

## updateTexture

The texture DmabufTextureBuilder:updateRegion is an update for.

Since: 4.14

clearDmabufTextureBuilderUpdateTexture :: (MonadIO m, IsDmabufTextureBuilder o) => o -> m () Source #

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

    clear #updateTexture

constructDmabufTextureBuilderUpdateTexture :: (IsDmabufTextureBuilder 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`.

getDmabufTextureBuilderUpdateTexture :: (MonadIO m, IsDmabufTextureBuilder o) => o -> m (Maybe Texture) Source #

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

    get dmabufTextureBuilder #updateTexture

setDmabufTextureBuilderUpdateTexture :: (MonadIO m, IsDmabufTextureBuilder o, IsTexture a) => o -> a -> m () Source #

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

    set dmabufTextureBuilder [ #updateTexture := value ]

## width

The width of the texture.

Since: 4.14

constructDmabufTextureBuilderWidth :: (IsDmabufTextureBuilder o, MonadIO m) => Word32 -> 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`.

getDmabufTextureBuilderWidth :: (MonadIO m, IsDmabufTextureBuilder o) => o -> m Word32 Source #

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

    get dmabufTextureBuilder #width

setDmabufTextureBuilderWidth :: (MonadIO m, IsDmabufTextureBuilder o) => o -> Word32 -> m () Source #

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

    set dmabufTextureBuilder [ #width := value ]