Gdk.MemoryTextureBuilder¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class Gdk.MemoryTextureBuilder(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Constructs [class`Gdk`.Texture] objects from system memory provided via [struct`GLib`.Bytes].
The operation is quite simple: Create a texture builder, set all the necessary properties - keep in mind that the properties [property`Gdk`.MemoryTextureBuilder:bytes], [property`Gdk`.MemoryTextureBuilder:stride], [property`Gdk`.MemoryTextureBuilder:width], and [property`Gdk`.MemoryTextureBuilder:height] are mandatory - and then call [method`Gdk`.MemoryTextureBuilder.build] to create the new texture.
GdkMemoryTextureBuildercan be used for quick one-shot construction of textures as well as kept around and reused to construct multiple textures.Added in version 4.16.
- classmethod new()[source]¶
- Returns:
the new
GdkTextureBuilder- Return type:
Creates a new texture builder.
Added in version 4.16.
- build()[source]¶
- Returns:
a newly built
GdkTexture- Return type:
Builds a new
GdkTexturewith 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.
Added in version 4.16.
- get_bytes()[source]¶
- Returns:
The bytes
- Return type:
GLib.BytesorNone
Gets the bytes previously set via
Gdk.MemoryTextureBuilder.set_bytes() orNoneif none was set.Added in version 4.16.
- get_color_state()[source]¶
- Returns:
The colorstate
- Return type:
Gets the colorstate previously set via
Gdk.MemoryTextureBuilder.set_color_state().Added in version 4.16.
- get_format()[source]¶
- Returns:
The format
- Return type:
Gets the format previously set via
Gdk.MemoryTextureBuilder.set_format().Added in version 4.16.
- get_height()[source]¶
- Returns:
The height
- Return type:
Gets the height previously set via
Gdk.MemoryTextureBuilder.set_height() or 0 if the height wasn’t set.Added in version 4.16.
- get_offset(plane)[source]¶
-
Gets the offset previously set via
Gdk.MemoryTextureBuilder.set_offset().Added in version 4.20.
- get_stride()[source]¶
- Returns:
the stride
- Return type:
Gets the stride previously set via
Gdk.MemoryTextureBuilder.set_stride().Added in version 4.16.
- get_stride_for_plane(plane)[source]¶
-
Gets the stride previously set via
Gdk.MemoryTextureBuilder.set_stride_for_plane().Added in version 4.20.
- get_update_region()[source]¶
- Returns:
The update region
- Return type:
cairo.RegionorNone
Gets the region previously set via
Gdk.MemoryTextureBuilder.set_update_region() orNoneif none was set.Added in version 4.16.
- get_update_texture()[source]¶
- Returns:
The update texture
- Return type:
Gdk.TextureorNone
Gets the texture previously set via
Gdk.MemoryTextureBuilder.set_update_texture() orNoneif none was set.Added in version 4.16.
- get_width()[source]¶
- Returns:
The width
- Return type:
Gets the width previously set via
Gdk.MemoryTextureBuilder.set_width() or 0 if the width wasn’t set.Added in version 4.16.
- set_bytes(bytes)[source]¶
- Parameters:
bytes (
GLib.BytesorNone) – The bytes the texture shows orNoneto unset
Sets the data to be shown but the texture.
The bytes must be set before calling [method`Gdk`.MemoryTextureBuilder.build].
Added in version 4.16.
- set_color_state(color_state)[source]¶
- Parameters:
color_state (
Gdk.ColorState) – The colorstate describing the data
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.
Added in version 4.16.
- set_format(format)[source]¶
- Parameters:
format (
Gdk.MemoryFormat) – The texture’s format
Sets the format of the bytes.
The default is
GDK_MEMORY_R8G8B8A8_PREMULTIPLIED.Added in version 4.16.
- set_height(height)[source]¶
- Parameters:
height (
int) – The texture’s height or 0 to unset
Sets the height of the texture.
The height must be set before calling [method`Gdk`.MemoryTextureBuilder.build] and conform to size requirements of the provided format.
Added in version 4.16.
- set_stride(stride)[source]¶
- Parameters:
stride (
int) – the stride or 0 to unset
Sets the rowstride of the bytes used.
The rowstride must be set before calling [method`Gdk`.MemoryTextureBuilder.build].
Added in version 4.16.
- set_stride_for_plane(plane, stride)[source]¶
-
Sets the stride of the texture for plane.
Added in version 4.20.
- set_update_region(region)[source]¶
- Parameters:
region (
cairo.RegionorNone) – the region to update
Sets the region to be updated by this texture.
Together with [property`Gdk`.MemoryTextureBuilder:update-texture], 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.
Added in version 4.16.
- set_update_texture(texture)[source]¶
- Parameters:
texture (
Gdk.TextureorNone) – the texture to update
Sets the texture to be updated by this texture.
See [method`Gdk`.MemoryTextureBuilder.set_update_region] for an explanation.
Added in version 4.16.
Property Details¶
- Gdk.MemoryTextureBuilder.props.bytes¶
- Name:
bytes- Type:
- Default Value:
- Flags:
The bytes holding the data.
Added in version 4.16.
- Gdk.MemoryTextureBuilder.props.color_state¶
- Name:
color-state- Type:
- Default Value:
- Flags:
The colorstate describing the data.
Added in version 4.16.
- Gdk.MemoryTextureBuilder.props.format¶
- Name:
format- Type:
- Default Value:
- Flags:
The format of the data.
Added in version 4.16.
- Gdk.MemoryTextureBuilder.props.height¶
- Name:
height- Type:
- Default Value:
0- Flags:
The height of the texture.
Added in version 4.16.
- Gdk.MemoryTextureBuilder.props.stride¶
- Name:
stride- Type:
- Default Value:
0- Flags:
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.
Added in version 4.16.
- Gdk.MemoryTextureBuilder.props.update_region¶
- Name:
update-region- Type:
- Default Value:
- Flags:
The update region for [property`Gdk`.MemoryTextureBuilder:update-texture].
Added in version 4.16.
- Gdk.MemoryTextureBuilder.props.update_texture¶
- Name:
update-texture- Type:
- Default Value:
- Flags:
The texture [property`Gdk`.MemoryTextureBuilder:update-region] is an update for.
Added in version 4.16.
- Gdk.MemoryTextureBuilder.props.width¶
- Name:
width- Type:
- Default Value:
0- Flags:
The width of the texture.
Added in version 4.16.