|
| | Texture (Texture && src) noexcept |
| |
| Texture & | operator= (Texture && src) noexcept |
| |
| | ~Texture () noexcept override |
| |
| GdkTexture * | gobj () |
| | Provides access to the underlying C GObject. More...
|
| |
| const GdkTexture * | gobj () const |
| | Provides access to the underlying C GObject. More...
|
| |
| GdkTexture * | gobj_copy () |
| | Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More...
|
| |
| int | get_width () const |
| | Returns the width of texture, in pixels. More...
|
| |
| int | get_height () const |
| | Returns the height of the texture, in pixels. More...
|
| |
| void | download (guchar *data, gsize stride) const |
| | Downloads the texture into local memory. More...
|
| |
| bool | save_to_png (const Glib::ustring & filename) const |
| | Store the given texture to the filename as a PNG file. More...
|
| |
| Glib::PropertyProxy_ReadOnly< int > | property_width () const |
| | The width of the texture, in pixels. More...
|
| |
| Glib::PropertyProxy_ReadOnly< int > | property_height () const |
| | The height of the texture, in pixels. More...
|
| |
| | Paintable (Paintable && src) noexcept |
| |
| Paintable & | operator= (Paintable && src) noexcept |
| |
| | ~Paintable () noexcept override |
| |
| GdkPaintable * | gobj () |
| | Provides access to the underlying C GObject. More...
|
| |
| const GdkPaintable * | gobj () const |
| | Provides access to the underlying C GObject. More...
|
| |
| void | snapshot (const Glib::RefPtr< Gdk::Snapshot > & snapshot, double width, double height) |
| | Snapshots the given paintable with the given width and height. More...
|
| |
| Glib::RefPtr< const Paintable > | get_current_image () const |
| | Gets an immutable paintable for the current contents displayed by paintable. More...
|
| |
| Flags | get_flags () const |
| | Get flags for the paintable. More...
|
| |
| int | get_intrinsic_width () const |
| | Gets the preferred width the paintable would like to be displayed at. More...
|
| |
| int | get_intrinsic_height () const |
| | Gets the preferred height the paintable would like to be displayed at. More...
|
| |
| double | get_intrinsic_aspect_ratio () const |
| | Gets the preferred aspect ratio the paintable would like to be displayed at. More...
|
| |
| void | compute_concrete_size (double specified_width, double specified_height, double default_width, double default_height, double & concrete_width, double & concrete_height) const |
| | Compute a concrete size for the Gdk::Paintable. More...
|
| |
| void | invalidate_contents () |
| | Called by implementations of Gdk::Paintable to invalidate their contents. More...
|
| |
| void | invalidate_size () |
| | Called by implementations of Gdk::Paintable to invalidate their size. More...
|
| |
| Glib::SignalProxy< void()> | signal_invalidate_contents () |
| |
| Glib::SignalProxy< void()> | signal_invalidate_size () |
| |
Pixel data.
Gdk::Texture is the basic element used to refer to pixel data. It is primarily meant for pixel data that will not change over multiple frames, and will be used for a long time.
There are various ways to create Gdk::Texture objects from a Gdk::Pixbuf, or a Cairo surface, or other pixel data.
The ownership of the pixel data is transferred to the Gdk::Texture instance; you can only make a copy of it, via download().
Gdk::Texture is an immutable object: That means you cannot change anything about it.
- Since gtkmm 3.94:
| static Glib::RefPtr< Texture > Gdk::Texture::create_from_resource |
( |
const std::string & |
resource_path | ) |
|
|
static |
Creates a new texture by loading an image from a resource.
The file format is detected automatically. The supported formats are PNG and JPEG, though more formats might be available.
It is a fatal error if resource_path does not specify a valid image resource and the program will abort if that happens. If you are unsure about the validity of a resource, use new_from_file() to load it.
- Parameters
-
| resource_path | The path of the resource file. |
- Returns
- A newly-created
Gdk::Texture.
| void Gdk::Texture::download |
( |
guchar * |
data, |
|
|
gsize |
stride |
|
) |
| const |
Downloads the texture into local memory.
This may be an expensive operation, as the actual texture data may reside on a GPU or on a remote display server.
The data format of the downloaded data is equivalent to Cairo::Surface::Format::ARGB32, so every downloaded pixel requires 4 bytes of memory.
Downloading a texture into a Cairo image surface:
[C example ellipted]
- Parameters
-
| data | Pointer to enough memory to be filled with the downloaded data of texture. |
| stride | Rowstride in bytes. |