Package org.gnome.gdk

Class Texture

java.lang.Object
All Implemented Interfaces:
Proxy, Paintable, Icon, LoadableIcon
Direct Known Subclasses:
DmabufTexture, GLTexture, MemoryTexture, Texture.TextureImpl

@Generated("io.github.jwharm.JavaGI") public abstract class Texture extends GObject implements Paintable, Icon, LoadableIcon
GdkTexture 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 GdkTexture objects from a Pixbuf, or from bytes stored in memory, a file, or a Gio.Resource.

The ownership of the pixel data is transferred to the GdkTexture instance; you can only make a copy of it, via download(byte[], long).

GdkTexture is an immutable object: That means you cannot change anything about it other than increasing the reference count via GObject.ref(), and consequently, it is a threadsafe object.

GDK provides a number of threadsafe texture loading functions: fromResource(java.lang.String), fromBytes(org.gnome.glib.Bytes), fromFile(org.gnome.gio.File), fromFilename(java.lang.String), forPixbuf(org.gnome.gdkpixbuf.Pixbuf). Note that these are meant for loading icons and resources that are shipped with the toolkit or application. It is recommended that you use a dedicated image loading framework such as glycin, if you need to load untrusted image data.