gtkmm 4.16.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | Related Symbols | List of all members
Gdk::MemoryTextureBuilder Class Reference

Gdk::MemoryTextureBuilder is a builder used to construct Gdk::Texture objects from system memory provided via Glib::Bytes. More...

#include <gdkmm/memorytexturebuilder.h>

Inheritance diagram for Gdk::MemoryTextureBuilder:
Inheritance graph
[legend]

Public Member Functions

 MemoryTextureBuilder (MemoryTextureBuilder &&src) noexcept
 
MemoryTextureBuilderoperator= (MemoryTextureBuilder &&src) noexcept
 
 ~MemoryTextureBuilder () noexcept override
 
GdkMemoryTextureBuildergobj ()
 Provides access to the underlying C GObject.
 
const GdkMemoryTextureBuildergobj () const
 Provides access to the underlying C GObject.
 
GdkMemoryTextureBuildergobj_copy ()
 Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
 
Glib::RefPtr< Glib::Bytes > get_bytes () const
 Gets the bytes previously set via set_bytes() or nullptr if none was set.
 
void set_bytes (const Glib::RefPtr< const Glib::Bytes > &context)
 Sets the data to be shown but the texture.
 
gsize get_stride () const
 Gets the stride previously set via set_stride().
 
void set_stride (gsize stride)
 Sets the rowstride of the bytes used.
 
int get_width () const
 Gets the width previously set via set_width() or 0 if the width wasn't set.
 
void set_width (int width)
 Sets the width of the texture.
 
int get_height () const
 Gets the height previously set via set_height() or 0 if the height wasn't set.
 
void set_height (int height)
 Sets the height of the texture.
 
MemoryFormat get_format () const
 Gets the format previously set via set_format().
 
void set_format (MemoryFormat format)
 Sets the format of the bytes.
 
Glib::RefPtr< ColorStateget_color_state () const
 Gets the colorstate previously set via set_color_state().
 
void set_color_state (const Glib::RefPtr< const ColorState > &color_state)
 Sets the colorstate describing the data.
 
Glib::RefPtr< Textureget_update_texture ()
 Gets the texture previously set via set_update_texture() or nullptr if none was set.
 
Glib::RefPtr< const Textureget_update_texture () const
 Gets the texture previously set via set_update_texture() or nullptr if none was set.
 
void set_update_texture (const Glib::RefPtr< Texture > &texture)
 Sets the texture to be updated by this texture.
 
::Cairo::RefPtr< ::Cairo::Region > get_update_region ()
 Gets the region previously set via set_update_region() or nullptr if none was set.
 
::Cairo::RefPtr< const ::Cairo::Region > get_update_region () const
 Gets the region previously set via set_update_region() or nullptr if none was set.
 
void set_update_region (const ::Cairo::RefPtr< ::Cairo::Region > &region)
 Sets the region to be updated by this texture.
 
Glib::RefPtr< Texturebuild ()
 Builds a new Gdk::Texture with the values set up in the builder.
 
Glib::PropertyProxy< Glib::RefPtr< Glib::Bytes > > property_bytes ()
 The bytes holding the data.
 
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Glib::Bytes > > property_bytes () const
 The bytes holding the data.
 
Glib::PropertyProxy< Glib::RefPtr< ColorState > > property_color_state ()
 The colorstate describing the data.
 
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< ColorState > > property_color_state () const
 The colorstate describing the data.
 
Glib::PropertyProxy< MemoryFormatproperty_format ()
 The format of the data.
 
Glib::PropertyProxy_ReadOnly< MemoryFormatproperty_format () const
 The format of the data.
 
Glib::PropertyProxy< int > property_height ()
 The height of the texture.
 
Glib::PropertyProxy_ReadOnly< int > property_height () const
 The height of the texture.
 
Glib::PropertyProxy< gsizeproperty_stride ()
 The rowstride of the texture.
 
Glib::PropertyProxy_ReadOnly< gsizeproperty_stride () const
 The rowstride of the texture.
 
Glib::PropertyProxy< ::Cairo::RefPtr< ::Cairo::Region > > property_update_region ()
 The update region for property_update_texture().
 
Glib::PropertyProxy_ReadOnly< ::Cairo::RefPtr< ::Cairo::Region > > property_update_region () const
 The update region for property_update_texture().
 
Glib::PropertyProxy< Glib::RefPtr< Texture > > property_update_texture ()
 The texture property_update_region() is an update for.
 
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Texture > > property_update_texture () const
 The texture property_update_region() is an update for.
 
Glib::PropertyProxy< int > property_width ()
 The width of the texture.
 
Glib::PropertyProxy_ReadOnly< int > property_width () const
 The width of the texture.
 

Static Public Member Functions

static GType get_type ()
 Get the GType for this class, for use with the underlying GObject type system.
 
static Glib::RefPtr< MemoryTextureBuildercreate ()
 

Protected Member Functions

 MemoryTextureBuilder ()
 

Related Symbols

(Note that these are not member symbols.)

Glib::RefPtr< Gdk::MemoryTextureBuilderwrap (GdkMemoryTextureBuilder *object, bool take_copy=false)
 A Glib::wrap() method for this object.
 

Detailed Description

Gdk::MemoryTextureBuilder is a builder used to construct Gdk::Texture objects from system memory provided via Glib::Bytes.

The operation is quite simple: Create a texture builder, set all the necessary properties - keep in mind that property_bytes(), property_stride(), property_width(), and property_height() are mandatory - and then call build() to create the new texture.

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

Since gtkmm 4.16:

Constructor & Destructor Documentation

◆ MemoryTextureBuilder() [1/2]

Gdk::MemoryTextureBuilder::MemoryTextureBuilder ( MemoryTextureBuilder &&  src)
noexcept

◆ ~MemoryTextureBuilder()

Gdk::MemoryTextureBuilder::~MemoryTextureBuilder ( )
overridenoexcept

◆ MemoryTextureBuilder() [2/2]

Gdk::MemoryTextureBuilder::MemoryTextureBuilder ( )
protected

Member Function Documentation

◆ build()

Glib::RefPtr< Texture > Gdk::MemoryTextureBuilder::build ( )

Builds a new Gdk::Texture 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 gtkmm 4.16:
Returns
A newly built Gdk::Texture.

◆ create()

static Glib::RefPtr< MemoryTextureBuilder > Gdk::MemoryTextureBuilder::create ( )
static

◆ get_bytes()

Glib::RefPtr< Glib::Bytes > Gdk::MemoryTextureBuilder::get_bytes ( ) const

Gets the bytes previously set via set_bytes() or nullptr if none was set.

Since gtkmm 4.16:
Returns
The bytes.

◆ get_color_state()

Glib::RefPtr< ColorState > Gdk::MemoryTextureBuilder::get_color_state ( ) const

Gets the colorstate previously set via set_color_state().

Since gtkmm 4.16:
Returns
The colorstate.

◆ get_format()

MemoryFormat Gdk::MemoryTextureBuilder::get_format ( ) const

Gets the format previously set via set_format().

Since gtkmm 4.16:
Returns
The format.

◆ get_height()

int Gdk::MemoryTextureBuilder::get_height ( ) const

Gets the height previously set via set_height() or 0 if the height wasn't set.

Since gtkmm 4.16:
Returns
The height.

◆ get_stride()

gsize Gdk::MemoryTextureBuilder::get_stride ( ) const

Gets the stride previously set via set_stride().

Since gtkmm 4.16:
Returns
The stride.

◆ get_type()

static GType Gdk::MemoryTextureBuilder::get_type ( )
static

Get the GType for this class, for use with the underlying GObject type system.

◆ get_update_region() [1/2]

::Cairo::RefPtr< ::Cairo::Region > Gdk::MemoryTextureBuilder::get_update_region ( )

Gets the region previously set via set_update_region() or nullptr if none was set.

Since gtkmm 4.16:
Returns
The update region.

◆ get_update_region() [2/2]

::Cairo::RefPtr< const ::Cairo::Region > Gdk::MemoryTextureBuilder::get_update_region ( ) const

Gets the region previously set via set_update_region() or nullptr if none was set.

Since gtkmm 4.16:
Returns
The update region.

◆ get_update_texture() [1/2]

Glib::RefPtr< Texture > Gdk::MemoryTextureBuilder::get_update_texture ( )

Gets the texture previously set via set_update_texture() or nullptr if none was set.

Since gtkmm 4.16:
Returns
The update texture.

◆ get_update_texture() [2/2]

Glib::RefPtr< const Texture > Gdk::MemoryTextureBuilder::get_update_texture ( ) const

Gets the texture previously set via set_update_texture() or nullptr if none was set.

Since gtkmm 4.16:
Returns
The update texture.

◆ get_width()

int Gdk::MemoryTextureBuilder::get_width ( ) const

Gets the width previously set via set_width() or 0 if the width wasn't set.

Since gtkmm 4.16:
Returns
The width.

◆ gobj() [1/2]

GdkMemoryTextureBuilder * Gdk::MemoryTextureBuilder::gobj ( )
inline

Provides access to the underlying C GObject.

◆ gobj() [2/2]

const GdkMemoryTextureBuilder * Gdk::MemoryTextureBuilder::gobj ( ) const
inline

Provides access to the underlying C GObject.

◆ gobj_copy()

GdkMemoryTextureBuilder * Gdk::MemoryTextureBuilder::gobj_copy ( )

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

◆ operator=()

MemoryTextureBuilder & Gdk::MemoryTextureBuilder::operator= ( MemoryTextureBuilder &&  src)
noexcept

◆ property_bytes() [1/2]

Glib::PropertyProxy< Glib::RefPtr< Glib::Bytes > > Gdk::MemoryTextureBuilder::property_bytes ( )

The bytes holding the data.

Since gtkmm 4.16:
Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_bytes() [2/2]

Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Glib::Bytes > > Gdk::MemoryTextureBuilder::property_bytes ( ) const

The bytes holding the data.

Since gtkmm 4.16:
Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_color_state() [1/2]

Glib::PropertyProxy< Glib::RefPtr< ColorState > > Gdk::MemoryTextureBuilder::property_color_state ( )

The colorstate describing the data.

Since gtkmm 4.16:
Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_color_state() [2/2]

Glib::PropertyProxy_ReadOnly< Glib::RefPtr< ColorState > > Gdk::MemoryTextureBuilder::property_color_state ( ) const

The colorstate describing the data.

Since gtkmm 4.16:
Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_format() [1/2]

Glib::PropertyProxy< MemoryFormat > Gdk::MemoryTextureBuilder::property_format ( )

The format of the data.

Since gtkmm 4.16:

Default value: Gdk::MemoryFormat::R8G8B8A8_PREMULTIPLIED

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_format() [2/2]

Glib::PropertyProxy_ReadOnly< MemoryFormat > Gdk::MemoryTextureBuilder::property_format ( ) const

The format of the data.

Since gtkmm 4.16:

Default value: Gdk::MemoryFormat::R8G8B8A8_PREMULTIPLIED

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_height() [1/2]

Glib::PropertyProxy< int > Gdk::MemoryTextureBuilder::property_height ( )

The height of the texture.

Since gtkmm 4.16:

Default value: 0

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_height() [2/2]

Glib::PropertyProxy_ReadOnly< int > Gdk::MemoryTextureBuilder::property_height ( ) const

The height of the texture.

Since gtkmm 4.16:

Default value: 0

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_stride() [1/2]

Glib::PropertyProxy< gsize > Gdk::MemoryTextureBuilder::property_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 gtkmm 4.16:

Default value: 0

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_stride() [2/2]

Glib::PropertyProxy_ReadOnly< gsize > Gdk::MemoryTextureBuilder::property_stride ( ) const

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 gtkmm 4.16:

Default value: 0

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_update_region() [1/2]

Glib::PropertyProxy< ::Cairo::RefPtr< ::Cairo::Region > > Gdk::MemoryTextureBuilder::property_update_region ( )

The update region for property_update_texture().

Since gtkmm 4.16:
Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_update_region() [2/2]

Glib::PropertyProxy_ReadOnly< ::Cairo::RefPtr< ::Cairo::Region > > Gdk::MemoryTextureBuilder::property_update_region ( ) const

The update region for property_update_texture().

Since gtkmm 4.16:
Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_update_texture() [1/2]

Glib::PropertyProxy< Glib::RefPtr< Texture > > Gdk::MemoryTextureBuilder::property_update_texture ( )

The texture property_update_region() is an update for.

Since gtkmm 4.16:
Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_update_texture() [2/2]

Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Texture > > Gdk::MemoryTextureBuilder::property_update_texture ( ) const

The texture property_update_region() is an update for.

Since gtkmm 4.16:
Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_width() [1/2]

Glib::PropertyProxy< int > Gdk::MemoryTextureBuilder::property_width ( )

The width of the texture.

Since gtkmm 4.16:

Default value: 0

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_width() [2/2]

Glib::PropertyProxy_ReadOnly< int > Gdk::MemoryTextureBuilder::property_width ( ) const

The width of the texture.

Since gtkmm 4.16:

Default value: 0

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ set_bytes()

void Gdk::MemoryTextureBuilder::set_bytes ( const Glib::RefPtr< const Glib::Bytes > &  context)

Sets the data to be shown but the texture.

The bytes must be set before calling build().

Since gtkmm 4.16:
Parameters
contextThe bytes the texture shows or nullptr to unset.

◆ set_color_state()

void Gdk::MemoryTextureBuilder::set_color_state ( const Glib::RefPtr< const ColorState > &  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 gtkmm 4.16:
Parameters
color_stateThe colorstate describing the data.

◆ set_format()

void Gdk::MemoryTextureBuilder::set_format ( MemoryFormat  format)

Sets the format of the bytes.

The default is Gdk::MemoryFormat::R8G8B8A8_PREMULTIPLIED.

Since gtkmm 4.16:
Parameters
formatThe texture's format.

◆ set_height()

void Gdk::MemoryTextureBuilder::set_height ( int  height)

Sets the height of the texture.

The height must be set before calling build().

Since gtkmm 4.16:
Parameters
heightThe texture's height or 0 to unset.

◆ set_stride()

void Gdk::MemoryTextureBuilder::set_stride ( gsize  stride)

Sets the rowstride of the bytes used.

The rowstride must be set before calling build().

Since gtkmm 4.16:
Parameters
strideThe stride or 0 to unset.

◆ set_update_region()

void Gdk::MemoryTextureBuilder::set_update_region ( const ::Cairo::RefPtr< ::Cairo::Region > &  region)

Sets the region to be updated by this texture.

Together with property_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 gtkmm 4.16:
Parameters
regionThe region to update.

◆ set_update_texture()

void Gdk::MemoryTextureBuilder::set_update_texture ( const Glib::RefPtr< Texture > &  texture)

Sets the texture to be updated by this texture.

See set_update_region() for an explanation.

Since gtkmm 4.16:
Parameters
textureThe texture to update.

◆ set_width()

void Gdk::MemoryTextureBuilder::set_width ( int  width)

Sets the width of the texture.

The width must be set before calling build().

Since gtkmm 4.16:
Parameters
widthThe texture's width or 0 to unset.

Friends And Related Symbol Documentation

◆ wrap()

Glib::RefPtr< Gdk::MemoryTextureBuilder > wrap ( GdkMemoryTextureBuilder object,
bool  take_copy = false 
)
related

A Glib::wrap() method for this object.

Parameters
objectThe C instance.
take_copyFalse if the result should take ownership of the C instance. True if it should take a new copy or ref.
Returns
A C++ instance that wraps this C instance.