gtkmm 4.16.0
|
Gdk::MemoryTextureBuilder is a builder used to construct Gdk::Texture objects from system memory provided via Glib::Bytes. More...
#include <gdkmm/memorytexturebuilder.h>
Public Member Functions | |
MemoryTextureBuilder (MemoryTextureBuilder &&src) noexcept | |
MemoryTextureBuilder & | operator= (MemoryTextureBuilder &&src) noexcept |
~MemoryTextureBuilder () noexcept override | |
GdkMemoryTextureBuilder * | gobj () |
Provides access to the underlying C GObject. | |
const GdkMemoryTextureBuilder * | gobj () const |
Provides access to the underlying C GObject. | |
GdkMemoryTextureBuilder * | gobj_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< ColorState > | get_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< Texture > | get_update_texture () |
Gets the texture previously set via set_update_texture() or nullptr if none was set. | |
Glib::RefPtr< const Texture > | get_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 > ®ion) |
Sets the region to be updated by this texture. | |
Glib::RefPtr< Texture > | build () |
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< MemoryFormat > | property_format () |
The format of the data. | |
Glib::PropertyProxy_ReadOnly< MemoryFormat > | property_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< gsize > | property_stride () |
The rowstride of the texture. | |
Glib::PropertyProxy_ReadOnly< gsize > | property_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< MemoryTextureBuilder > | create () |
Protected Member Functions | |
MemoryTextureBuilder () | |
Related Symbols | |
(Note that these are not member symbols.) | |
Glib::RefPtr< Gdk::MemoryTextureBuilder > | wrap (GdkMemoryTextureBuilder *object, bool take_copy=false) |
A Glib::wrap() method for this object. | |
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.
|
noexcept |
|
overridenoexcept |
|
protected |
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.
Gdk::Texture
.
|
static |
Glib::RefPtr< Glib::Bytes > Gdk::MemoryTextureBuilder::get_bytes | ( | ) | const |
Gets the bytes previously set via set_bytes() or nullptr
if none was set.
Glib::RefPtr< ColorState > Gdk::MemoryTextureBuilder::get_color_state | ( | ) | const |
MemoryFormat Gdk::MemoryTextureBuilder::get_format | ( | ) | const |
int Gdk::MemoryTextureBuilder::get_height | ( | ) | const |
Gets the height previously set via set_height() or 0 if the height wasn't set.
gsize Gdk::MemoryTextureBuilder::get_stride | ( | ) | const |
|
static |
Get the GType for this class, for use with the underlying GObject type system.
::Cairo::RefPtr< ::Cairo::Region > Gdk::MemoryTextureBuilder::get_update_region | ( | ) |
Gets the region previously set via set_update_region() or nullptr
if none was set.
::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.
Glib::RefPtr< Texture > Gdk::MemoryTextureBuilder::get_update_texture | ( | ) |
Gets the texture previously set via set_update_texture() or nullptr
if none was set.
Gets the texture previously set via set_update_texture() or nullptr
if none was set.
int Gdk::MemoryTextureBuilder::get_width | ( | ) | const |
Gets the width previously set via set_width() or 0 if the width wasn't set.
|
inline |
Provides access to the underlying C GObject.
|
inline |
Provides access to the underlying C GObject.
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.
|
noexcept |
Glib::PropertyProxy< Glib::RefPtr< Glib::Bytes > > Gdk::MemoryTextureBuilder::property_bytes | ( | ) |
The bytes holding the data.
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Glib::Bytes > > Gdk::MemoryTextureBuilder::property_bytes | ( | ) | const |
The bytes holding the data.
Glib::PropertyProxy< Glib::RefPtr< ColorState > > Gdk::MemoryTextureBuilder::property_color_state | ( | ) |
The colorstate describing the data.
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< ColorState > > Gdk::MemoryTextureBuilder::property_color_state | ( | ) | const |
The colorstate describing the data.
Glib::PropertyProxy< MemoryFormat > Gdk::MemoryTextureBuilder::property_format | ( | ) |
The format of the data.
Default value: Gdk::MemoryFormat::R8G8B8A8_PREMULTIPLIED
Glib::PropertyProxy_ReadOnly< MemoryFormat > Gdk::MemoryTextureBuilder::property_format | ( | ) | const |
The format of the data.
Default value: Gdk::MemoryFormat::R8G8B8A8_PREMULTIPLIED
Glib::PropertyProxy< int > Gdk::MemoryTextureBuilder::property_height | ( | ) |
The height of the texture.
Default value: 0
Glib::PropertyProxy_ReadOnly< int > Gdk::MemoryTextureBuilder::property_height | ( | ) | const |
The height of the texture.
Default value: 0
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.
Default value: 0
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.
Default value: 0
Glib::PropertyProxy< ::Cairo::RefPtr< ::Cairo::Region > > Gdk::MemoryTextureBuilder::property_update_region | ( | ) |
The update region for property_update_texture().
Glib::PropertyProxy_ReadOnly< ::Cairo::RefPtr< ::Cairo::Region > > Gdk::MemoryTextureBuilder::property_update_region | ( | ) | const |
The update region for property_update_texture().
Glib::PropertyProxy< Glib::RefPtr< Texture > > Gdk::MemoryTextureBuilder::property_update_texture | ( | ) |
The texture property_update_region() is an update for.
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Texture > > Gdk::MemoryTextureBuilder::property_update_texture | ( | ) | const |
The texture property_update_region() is an update for.
Glib::PropertyProxy< int > Gdk::MemoryTextureBuilder::property_width | ( | ) |
The width of the texture.
Default value: 0
Glib::PropertyProxy_ReadOnly< int > Gdk::MemoryTextureBuilder::property_width | ( | ) | const |
The width of the texture.
Default value: 0
Sets the data to be shown but the texture.
The bytes must be set before calling build().
context | The bytes the texture shows or nullptr to unset. |
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.
color_state | The colorstate describing the data. |
void Gdk::MemoryTextureBuilder::set_format | ( | MemoryFormat | format | ) |
Sets the format of the bytes.
The default is Gdk::MemoryFormat::R8G8B8A8_PREMULTIPLIED
.
format | The texture's format. |
void Gdk::MemoryTextureBuilder::set_height | ( | int | height | ) |
Sets the height of the texture.
The height must be set before calling build().
height | The texture's height or 0 to unset. |
Sets the rowstride of the bytes used.
The rowstride must be set before calling build().
stride | The stride or 0 to unset. |
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.
region | The region to update. |
Sets the texture to be updated by this texture.
See set_update_region() for an explanation.
texture | The texture to update. |
void Gdk::MemoryTextureBuilder::set_width | ( | int | width | ) |
Sets the width of the texture.
The width must be set before calling build().
width | The texture's width or 0 to unset. |
|
related |
A Glib::wrap() method for this object.
object | The C instance. |
take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref. |