1.31 <GdkMemoryTextureBuilder>

Class: <GdkMemoryTextureBuilder>

It derives from <GObject>.

Constructs <GdkTexture> objects from system memory provided via <GBytes>.

The operation is quite simple: Create a texture builder, set all the necessary properties - keep in mind that the properties memory-texture-builder:bytes, memory-texture-builder:stride, memory-texture-builder:width, and memory-texture-builder:height are mandatory - and then call memory-texture-builder: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.

Properties

Property: memory-texture-builder:bytes self

The bytes holding the data.

Its value is a <GBytes>, or #f.

Set it with (set! (memory-texture-builder:bytes self) value).

Property: memory-texture-builder:color-state self

The colorstate describing the data.

Its value is a <GdkColorState>, or #f.

Set it with (set! (memory-texture-builder:color-state self) value).

Property: memory-texture-builder:format self

The format of the data.

Its value is a <GdkMemoryFormat> (or, to set it, one of its symbols).

Set it with (set! (memory-texture-builder:format self) value).

Property: memory-texture-builder:height self

The height of the texture.

Its value is a 32-bit integer.

Set it with (set! (memory-texture-builder:height self) value).

Property: memory-texture-builder:stride self

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.

Its value is an unsigned 64-bit integer.

Set it with (set! (memory-texture-builder:stride self) value).

Property: memory-texture-builder:update-region self

The update region for memory-texture-builder:update-texture.

Its value is a <CairoRegion>, or #f.

Set it with (set! (memory-texture-builder:update-region self) value).

Property: memory-texture-builder:update-texture self

The texture memory-texture-builder:update-region is an update for.

Its value is a <GdkTexture>, or #f.

Set it with (set! (memory-texture-builder:update-texture self) value).

Property: memory-texture-builder:width self

The width of the texture.

Its value is a 32-bit integer.

Set it with (set! (memory-texture-builder:width self) value).

Procedures

Method: memory-texture-builder:build self ⇒ %return
Method: build self ⇒ %return

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.

self

Passed: a <GdkMemoryTextureBuilder>.

a <GdkMemoryTextureBuilder>

%return

Returned: a <GdkTexture>.

a newly built <GdkTexture>

Method: memory-texture-builder:get-bytes self ⇒ %return
Method: get-bytes self ⇒ %return

Gets the bytes previously set via memory-texture-builder:set-bytes or #f if none was set.

self

Passed: a <GdkMemoryTextureBuilder>.

a <GdkMemoryTextureBuilder>

%return

Returned: a <GBytes>, or #f.

The bytes

Method: memory-texture-builder:get-color-state self ⇒ %return
Method: get-color-state self ⇒ %return

Gets the colorstate previously set via memory-texture-builder:set-color-state.

self

Passed: a <GdkMemoryTextureBuilder>.

a <GdkMemoryTextureBuilder>

%return

Returned: a <GdkColorState>.

The colorstate

Method: memory-texture-builder:get-format self ⇒ %return
Method: get-format self ⇒ %return

Gets the format previously set via memory-texture-builder:set-format.

self

Passed: a <GdkMemoryTextureBuilder>.

a <GdkMemoryTextureBuilder>

%return

Returned: a <GdkMemoryFormat>.

The format

Method: memory-texture-builder:get-height self ⇒ %return
Method: get-height self ⇒ %return

Gets the height previously set via memory-texture-builder:set-height or 0 if the height wasn’t set.

self

Passed: a <GdkMemoryTextureBuilder>.

a <GdkMemoryTextureBuilder>

%return

Returned: a 32-bit integer.

The height

Method: memory-texture-builder:get-offset self plane ⇒ %return
Method: get-offset self plane ⇒ %return

Gets the offset previously set via memory-texture-builder:set-offset.

self

Passed: a <GdkMemoryTextureBuilder>.

a <GdkMemoryTextureBuilder>

plane

Passed: an unsigned 32-bit integer.

a plane

%return

Returned: an unsigned 64-bit integer.

The offset associated to a plane

Method: memory-texture-builder:get-stride self ⇒ %return
Method: get-stride self ⇒ %return

Gets the stride previously set via memory-texture-builder:set-stride.

self

Passed: a <GdkMemoryTextureBuilder>.

a <GdkMemoryTextureBuilder>

%return

Returned: an unsigned 64-bit integer.

the stride

Method: memory-texture-builder:get-stride-for-plane self plane ⇒ %return
Method: get-stride-for-plane self plane ⇒ %return

Gets the stride previously set via memory-texture-builder:set-stride-for-plane.

self

Passed: a <GdkMemoryTextureBuilder>.

a <GdkMemoryTextureBuilder>

plane

Passed: an unsigned 32-bit integer.

a plane

%return

Returned: an unsigned 64-bit integer.

The stride associated to a plane

Method: memory-texture-builder:get-update-region self ⇒ %return
Method: get-update-region self ⇒ %return

Gets the region previously set via memory-texture-builder:set-update-region or #f if none was set.

self

Passed: a <GdkMemoryTextureBuilder>.

a <GdkMemoryTextureBuilder>

%return

Returned: a <CairoRegion>, or #f.

The update region

Method: memory-texture-builder:get-update-texture self ⇒ %return
Method: get-update-texture self ⇒ %return

Gets the texture previously set via memory-texture-builder:set-update-texture or #f if none was set.

self

Passed: a <GdkMemoryTextureBuilder>.

a <GdkMemoryTextureBuilder>

%return

Returned: a <GdkTexture>, or #f.

The update texture

Method: memory-texture-builder:get-width self ⇒ %return
Method: get-width self ⇒ %return

Gets the width previously set via memory-texture-builder:set-width or 0 if the width wasn’t set.

self

Passed: a <GdkMemoryTextureBuilder>.

a <GdkMemoryTextureBuilder>

%return

Returned: a 32-bit integer.

The width

Procedure: memory-texture-builder:new ⇒ %return

Creates a new texture builder.

%return

Returned: a <GdkMemoryTextureBuilder>.

the new GdkTextureBuilder

Method: memory-texture-builder:set-bytes self [bytes]
Method: set-bytes self [bytes]

Sets the data to be shown but the texture.

The bytes must be set before calling memory-texture-builder:build.

self

Passed: a <GdkMemoryTextureBuilder>.

a <GdkMemoryTextureBuilder>

bytes

Passed, or left out: a <GBytes>, or #f.

The bytes the texture shows or #f to unset

Method: memory-texture-builder:set-color-state self color-state
Method: set-color-state self 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.

self

Passed: a <GdkMemoryTextureBuilder>.

a <GdkMemoryTextureBuilder>

color-state

Passed: a <GdkColorState>.

The colorstate describing the data

Method: memory-texture-builder:set-format self format
Method: set-format self format

Sets the format of the bytes.

The default is r8g8b8a8-premultiplied.

self

Passed: a <GdkMemoryTextureBuilder>.

a <GdkMemoryTextureBuilder>

format

Passed: a <GdkMemoryFormat>, or one of its symbols.

The texture’s format

Method: memory-texture-builder:set-height self height
Method: set-height self height

Sets the height of the texture.

The height must be set before calling memory-texture-builder:build and conform to size requirements of the provided format.

self

Passed: a <GdkMemoryTextureBuilder>.

a <GdkMemoryTextureBuilder>

height

Passed: a 32-bit integer.

The texture’s height or 0 to unset

Method: memory-texture-builder:set-offset self plane offset
Method: set-offset self plane offset

Sets the offset of the texture for plane.

self

Passed: a <GdkMemoryTextureBuilder>.

a <GdkMemoryTextureBuilder>

plane

Passed: an unsigned 32-bit integer.

a plane

offset

Passed: an unsigned 64-bit integer.

the texture’s offset for plane

Method: memory-texture-builder:set-stride self stride
Method: set-stride self stride

Sets the rowstride of the bytes used.

The rowstride must be set before calling memory-texture-builder:build.

self

Passed: a <GdkMemoryTextureBuilder>.

a <GdkMemoryTextureBuilder>

stride

Passed: an unsigned 64-bit integer.

the stride or 0 to unset

Method: memory-texture-builder:set-stride-for-plane self plane stride
Method: set-stride-for-plane self plane stride

Sets the stride of the texture for plane.

self

Passed: a <GdkMemoryTextureBuilder>.

a <GdkMemoryTextureBuilder>

plane

Passed: an unsigned 32-bit integer.

a plane

stride

Passed: an unsigned 64-bit integer.

the texture’s stride for plane

Method: memory-texture-builder:set-update-region self [region]
Method: set-update-region self [region]

Sets the region to be updated by this texture.

Together with memory-texture-builder: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.

self

Passed: a <GdkMemoryTextureBuilder>.

a <GdkMemoryTextureBuilder>

region

Passed, or left out: a <CairoRegion>, or #f.

the region to update

Method: memory-texture-builder:set-update-texture self [texture]
Method: set-update-texture self [texture]

Sets the texture to be updated by this texture.

See memory-texture-builder:set-update-region for an explanation.

self

Passed: a <GdkMemoryTextureBuilder>.

a <GdkMemoryTextureBuilder>

texture

Passed, or left out: a <GdkTexture>, or #f.

the texture to update

Method: memory-texture-builder:set-width self width
Method: set-width self width

Sets the width of the texture.

The width must be set before calling memory-texture-builder:build and conform to size requirements of the provided format.

self

Passed: a <GdkMemoryTextureBuilder>.

a <GdkMemoryTextureBuilder>

width

Passed: a 32-bit integer.

The texture’s width or 0 to unset