gtkmm
4.8.0
|
A Gdk::Texture representing image data in memory. More...
#include <gdkmm/memorytexture.h>
Public Types | |
enum | Format { Format::B8G8R8A8_PREMULTIPLIED, Format::A8R8G8B8_PREMULTIPLIED, Format::R8G8B8A8_PREMULTIPLIED, Format::B8G8R8A8, Format::A8R8G8B8, Format::R8G8B8A8, Format::A8B8G8R8, Format::R8G8B8, Format::B8G8R8, Format::R16G16B16, Format::R16G16B16A16_PREMULTIPLIED, Format::R16G16B16A16, Format::R16G16B16_FLOAT, Format::R16G16B16A16_FLOAT_PREMULTIPLIED, Format::R16G16B16A16_FLOAT, Format::R32G32B32_FLOAT, Format::R32G32B32A32_FLOAT_PREMULTIPLIED, Format::R32G32B32A32_FLOAT, Format::N_FORMATS } |
Gdk::MemoryFormat describes formats that image data can have in memory. More... | |
![]() | |
enum | Flags { Flags::STATIC_SIZE = 1 << 0, Flags::STATIC_CONTENTS = 1 << 1 } |
Flags about a paintable object. More... | |
Public Member Functions | |
MemoryTexture (MemoryTexture&& src) noexcept | |
MemoryTexture& | operator= (MemoryTexture&& src) noexcept |
~MemoryTexture () noexcept override | |
GdkMemoryTexture* | gobj () |
Provides access to the underlying C GObject. More... | |
const GdkMemoryTexture* | gobj () const |
Provides access to the underlying C GObject. More... | |
GdkMemoryTexture* | gobj_copy () |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More... | |
![]() | |
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::RefPtr< Glib::Bytes > | save_to_png_bytes () const |
Store the given texture in memory as a PNG file. More... | |
bool | save_to_tiff (const std::string& filename) const |
Store the given texture to the filename as a TIFF file. More... | |
Glib::RefPtr< Glib::Bytes > | save_to_tiff_bytes () const |
Store the given texture in memory as a TIFF 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 () |
Static Public Member Functions | |
static GType | get_type () |
Get the GType for this class, for use with the underlying GObject type system. More... | |
static Glib::RefPtr< Texture > | create (int width, int height, Format format, const Glib::RefPtr< const Glib::Bytes >& bytes, gsize stride) |
Creates a new texture for a blob of image data. More... | |
![]() | |
static GType | get_type () |
Get the GType for this class, for use with the underlying GObject type system. More... | |
static Glib::RefPtr< Texture > | create_for_pixbuf (const Glib::RefPtr< Pixbuf >& pixbuf) |
Creates a new texture object representing the Gdk::Pixbuf . More... | |
static Glib::RefPtr< Texture > | create_from_resource (const std::string& resource_path) |
Creates a new texture by loading an image from a resource. More... | |
static Glib::RefPtr< Texture > | create_from_file (const Glib::RefPtr< Gio::File >& file) |
Creates a new texture by loading an image from a file. More... | |
static Glib::RefPtr< Texture > | create_from_filename (const std::string& path) |
Creates a new texture by loading an image from a file. More... | |
static Glib::RefPtr< Texture > | create_from_bytes (const Glib::RefPtr< const Glib::Bytes >& bytes) |
Creates a new texture by loading an image from memory,. More... | |
![]() | |
static void | add_interface (GType gtype_implementer) |
static GType | get_type () |
Get the GType for this class, for use with the underlying GObject type system. More... | |
Static Public Attributes | |
static const Format | DEFAULT_FORMAT = static_cast<Format>(GDK_MEMORY_DEFAULT) |
Default memory format used by GTK. More... | |
Protected Member Functions | |
MemoryTexture () | |
![]() | |
Texture () | |
![]() | |
Paintable () | |
You should derive from this class to use it. More... | |
virtual void | snapshot_vfunc (const Glib::RefPtr< Gdk::Snapshot >&snapshot, double width, double height) |
virtual Glib::RefPtr< Paintable > | get_current_image_vfunc () const |
virtual Flags | get_flags_vfunc () const |
virtual int | get_intrinsic_width_vfunc () const |
virtual int | get_intrinsic_height_vfunc () const |
virtual double | get_intrinsic_aspect_ratio_vfunc () const |
Related Functions | |
(Note that these are not member functions.) | |
Glib::RefPtr< Gdk::MemoryTexture > | wrap (GdkMemoryTexture* object, bool take_copy=false) |
A Glib::wrap() method for this object. More... | |
![]() | |
Glib::RefPtr< Gdk::Texture > | wrap (GdkTexture* object, bool take_copy=false) |
A Glib::wrap() method for this object. More... | |
![]() | |
Glib::RefPtr< Gdk::Paintable > | wrap (GdkPaintable* object, bool take_copy=false) |
A Glib::wrap() method for this object. More... | |
A Gdk::Texture representing image data in memory.
|
noexcept |
|
overridenoexcept |
|
protected |
|
static |
Creates a new texture for a blob of image data.
The Glib::Bytes
must contain stride × height pixels in the given format.
width | The width of the texture. |
height | The height of the texture. |
format | The format of the data. |
bytes | The Glib::Bytes containing the pixel data. |
stride | Rowstride for the data. |
Gdk::Texture
.
|
static |
Get the GType for this class, for use with the underlying GObject type system.
|
inline |
Provides access to the underlying C GObject.
|
inline |
Provides access to the underlying C GObject.
GdkMemoryTexture* Gdk::MemoryTexture::gobj_copy | ( | ) |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
|
noexcept |
|
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. |
Default memory format used by GTK.
It is the format provided by Gdk::Texture::download(). It is equal to Cairo::Surface::Format::ARGB32.
Be aware that unlike the Format values, this format is different for different endianness.