Constructs [classGdk.Texture] objects from system memory provided via [structGlib.Bytes].
The operation is quite simple: Create a texture builder, set all the necessary properties - keep in mind that the properties [propertyGdk.MemoryTextureBuilder:bytes], [propertyGdk.MemoryTextureBuilder:stride], [propertyGdk.MemoryTextureBuilder:width], and [propertyGdk.MemoryTextureBuilder:height] are mandatory - and then call [methodGdk.MemoryTextureBuilder.build] 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.
function Build
(Self : not null access Gdk_Memory_Texture_Builder_Record)
return Gdk.Texture.Gdk_Texture
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: gtk+ 4.16
a newly built GdkTexture. Has transfer-ownership='full'.
Bytes_Property : constant Glib.Properties.Property_Boxed;
Type: GLib.Bytes The bytes holding the data.
Color_State_Property : constant Glib.Properties.Property_Boxed;
Type: Color_State The colorstate describing the data.
Format_Property : constant Glib.Properties.Property_Boxed;
Type: Memory_Format The format of the data.
type Gdk_Memory_Texture_Builder is access all Gdk_Memory_Texture_Builder_Record'Class;
function Gdk_Memory_Texture_Builder_New return Gdk_Memory_Texture_Builder
Creates a new texture builder. Since: gtk+ 4.16
type Gdk_Memory_Texture_Builder_Record is new GObject_Record with null record;
procedure Gdk_New (Self : out Gdk_Memory_Texture_Builder)
Creates a new texture builder. Since: gtk+ 4.16
function Get_Bytes
(Self : not null access Gdk_Memory_Texture_Builder_Record)
return Glib.Bytes.Gbytes
Gets the bytes previously set via Gdk.Memory_Texture_Builder.Set_Bytes or null if none was set. Since: gtk+ 4.16
The bytes. Has transfer-ownership='none'.
function Get_Color_State
(Self : not null access Gdk_Memory_Texture_Builder_Record)
return Gdk.Color_State.Gdk_Color_State
Gets the colorstate previously set via Gdk.Memory_Texture_Builder.Set_Color_State. Since: gtk+ 4.16
The colorstate. Has transfer-ownership='none'.
function Get_Format
(Self : not null access Gdk_Memory_Texture_Builder_Record)
return Gdk.Texture.Gdk_Memory_Format
Gets the format previously set via Gdk.Memory_Texture_Builder.Set_Format. Since: gtk+ 4.16
The format
function Get_Height
(Self : not null access Gdk_Memory_Texture_Builder_Record)
return Glib.Gint
Gets the height previously set via Gdk.Memory_Texture_Builder.Set_Height or 0 if the height wasn't set. Since: gtk+ 4.16
The height
function Get_Offset
(Self : not null access Gdk_Memory_Texture_Builder_Record;
Plane : Guint) return Gsize
Gets the offset previously set via Gdk.Memory_Texture_Builder.Set_Offset. Since: gtk+ 4.20
a plane
The offset associated to a Plane
function Get_Stride
(Self : not null access Gdk_Memory_Texture_Builder_Record)
return Gsize
Gets the stride previously set via Gdk.Memory_Texture_Builder.Set_Stride. Since: gtk+ 4.16
the stride
function Get_Stride_For_Plane
(Self : not null access Gdk_Memory_Texture_Builder_Record;
Plane : Guint) return Gsize
Gets the stride previously set via Gdk.Memory_Texture_Builder.Set_Stride_For_Plane. Since: gtk+ 4.20
a plane
The stride associated to a Plane
function Get_Type return Glib.GType
function Get_Update_Region
(Self : not null access Gdk_Memory_Texture_Builder_Record)
return Cairo.Region.Cairo_Region
Gets the region previously set via Gdk.Memory_Texture_Builder.Set_Update_Region or null if none was set. Since: gtk+ 4.16
The update region
function Get_Update_Texture
(Self : not null access Gdk_Memory_Texture_Builder_Record)
return Gdk.Texture.Gdk_Texture
Gets the texture previously set via Gdk.Memory_Texture_Builder.Set_Update_Texture or null if none was set. Since: gtk+ 4.16
The update texture. Has transfer-ownership='none'.
function Get_Width
(Self : not null access Gdk_Memory_Texture_Builder_Record)
return Glib.Gint
Gets the width previously set via Gdk.Memory_Texture_Builder.Set_Width or 0 if the width wasn't set. Since: gtk+ 4.16
The width
Height_Property : constant Glib.Properties.Property_Int;
The height of the texture.
procedure Initialize
(Self : not null access Gdk_Memory_Texture_Builder_Record'Class)
Creates a new texture builder. Since: gtk+ 4.16 Initialize does nothing if the object was already created with another call to Initialize* or G_New.
procedure Set_Bytes
(Self : not null access Gdk_Memory_Texture_Builder_Record;
Bytes : Glib.Bytes.Gbytes)
Sets the data to be shown but the texture. The bytes must be set before calling [methodGdk.MemoryTextureBuilder.build]. Since: gtk+ 4.16
The bytes the texture shows or null to unset
procedure Set_Color_State
(Self : not null access Gdk_Memory_Texture_Builder_Record;
Color_State : Gdk.Color_State.Gdk_Color_State)
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: gtk+ 4.16
The colorstate describing the data
procedure Set_Format
(Self : not null access Gdk_Memory_Texture_Builder_Record;
Format : Gdk.Texture.Gdk_Memory_Format)
Sets the format of the bytes. The default is GDK_MEMORY_R8G8B8A8_PREMULTIPLIED. Since: gtk+ 4.16
The texture's format
procedure Set_Height
(Self : not null access Gdk_Memory_Texture_Builder_Record;
Height : Glib.Gint)
Sets the height of the texture. The height must be set before calling [methodGdk.MemoryTextureBuilder.build] and conform to size requirements of the provided format. Since: gtk+ 4.16
The texture's height or 0 to unset
procedure Set_Offset
(Self : not null access Gdk_Memory_Texture_Builder_Record;
Plane : Guint;
Offset : Gsize)
Sets the offset of the texture for Plane. Since: gtk+ 4.20
a plane
the texture's offset for Plane
procedure Set_Stride
(Self : not null access Gdk_Memory_Texture_Builder_Record;
Stride : Gsize)
Sets the rowstride of the bytes used. The rowstride must be set before calling [methodGdk.MemoryTextureBuilder.build]. Since: gtk+ 4.16
the stride or 0 to unset
procedure Set_Stride_For_Plane
(Self : not null access Gdk_Memory_Texture_Builder_Record;
Plane : Guint;
Stride : Gsize)
Sets the stride of the texture for Plane. Since: gtk+ 4.20
a plane
the texture's stride for Plane
procedure Set_Update_Region
(Self : not null access Gdk_Memory_Texture_Builder_Record;
Region : Cairo.Region.Cairo_Region)
Sets the region to be updated by this texture. Together with [propertyGdk.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. Since: gtk+ 4.16
the region to update
procedure Set_Update_Texture
(Self : not null access Gdk_Memory_Texture_Builder_Record;
Texture : access Gdk.Texture.Gdk_Texture_Record'Class)
Sets the texture to be updated by this texture. See [methodGdk.MemoryTextureBuilder.set_update_region] for an explanation. Since: gtk+ 4.16
the texture to update
procedure Set_Width
(Self : not null access Gdk_Memory_Texture_Builder_Record;
Width : Glib.Gint)
Sets the width of the texture. The width must be set before calling [methodGdk.MemoryTextureBuilder.build] and conform to size requirements of the provided format. Since: gtk+ 4.16
The texture's width or 0 to unset
Stride_Property : constant Glib.Properties.Property_Uint;
Type: Guint64 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.
Update_Region_Property : constant Glib.Properties.Property_Boxed;
Type: cairo.Region The update region for [propertyGdk.MemoryTextureBuilder:update-texture].
Update_Texture_Property : constant Glib.Properties.Property_Boxed;
Type: Texture The texture [propertyGdk.MemoryTextureBuilder:update-region] is an update for.
Width_Property : constant Glib.Properties.Property_Int;
The width of the texture.