Package ch.bailu.gtk.gdk
Klasse GLTextureBuilder
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.gobject.Object
ch.bailu.gtk.type.PropertyHolder
ch.bailu.gtk.gdk.GLTextureBuilder
- Alle implementierten Schnittstellen:
PointerInterface
Constructs [class@Gdk.Texture] objects from GL textures.
The operation is quite simple: Create a texture builder, set all the necessary
properties - keep in mind that the properties [property@Gdk.GLTextureBuilder:context],
[property@Gdk.GLTextureBuilder:id], [property@Gdk.GLTextureBuilder:width], and
[property@Gdk.GLTextureBuilder:height] are mandatory - and then call
[method@Gdk.GLTextureBuilder.build] to create the new texture.
`GdkGLTextureBuilder` can be used for quick one-shot construction of
textures as well as kept around and reused to construct multiple textures.
The operation is quite simple: Create a texture builder, set all the necessary
properties - keep in mind that the properties [property@Gdk.GLTextureBuilder:context],
[property@Gdk.GLTextureBuilder:id], [property@Gdk.GLTextureBuilder:width], and
[property@Gdk.GLTextureBuilder:height] are mandatory - and then call
[method@Gdk.GLTextureBuilder.build] to create the new texture.
`GdkGLTextureBuilder` can be used for quick one-shot construction of
textures as well as kept around and reused to construct multiple textures.
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenVon Klasse geerbte verschachtelte Klassen/Schnittstellen ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify
-
Feldübersicht
Von Klasse geerbte Felder ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungbuild
(GLTextureBuilder.OnDestroyNotify destroy, Pointer data) Builds a new `GdkTexture` with the values set up in the builder.static ClassHandler
Gets the color state previously set via gdk_gl_texture_builder_set_color_state().Gets the context previously set via gdk_gl_texture_builder_set_context() or
%NULL if none was set.int
Gets the format previously set via gdk_gl_texture_builder_set_format().boolean
Gets whether the texture has a mipmap.int
Gets the height previously set via gdk_gl_texture_builder_set_height() or
0 if the height wasn't set.int
getId()
Gets the texture id previously set via gdk_gl_texture_builder_set_id() or
0 if the id wasn't set.static int
static long
static TypeSystem.TypeSize
getSync()
Gets the `GLsync` previously set via gdk_gl_texture_builder_set_sync().static long
static TypeSystem.TypeSize
Gets the region previously set via gdk_gl_texture_builder_set_update_region() or
%NULL if none was set.Gets the texture previously set via gdk_gl_texture_builder_set_update_texture() or
%NULL if none was set.int
getWidth()
Gets the width previously set via gdk_gl_texture_builder_set_width() or
0 if the width wasn't set.void
setColorState
(ColorState color_state) Sets the color state for the texture.void
setContext
(GLContext context) Sets the context to be used for the texture.void
setFormat
(int format) Sets the format of the texture.void
setHasMipmap
(boolean has_mipmap) Sets whether the texture has a mipmap.void
setHeight
(int height) Sets the height of the texture.void
setId
(int id) Sets the texture id of the texture.void
Sets the GLSync object to use for the texture.void
setUpdateRegion
(Region region) Sets the region to be updated by this texture.void
setUpdateTexture
(Texture texture) Sets the texture to be updated by this texture.void
setWidth
(int width) Sets the width of the texture.Von Klasse geerbte Methoden ch.bailu.gtk.type.PropertyHolder
getBooleanProperty, getIntProperty, getObjectProperty, getStringProperty, getStrProperty, setBooleanProperty, setIntProperty, setObjectProperty, setStringProperty, setStrProperty
Von Klasse geerbte Methoden ch.bailu.gtk.gobject.Object
addToggleRef, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, disconnect, disconnect, dupData, dupData, dupQdata, forceFloating, freezeNotify, get, get, getData, getData, getProperty, getProperty, getQdata, interfaceFindProperty, interfaceInstallProperty, isFloating, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, replaceData, replaceData, replaceQdata, runDispose, set, set, setData, setData, setDataFull, setDataFull, setProperty, setProperty, setQdata, setQdataFull, stealData, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref
Von Klasse geerbte Methoden ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Von Klasse geerbte Methoden ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Von Klasse geerbte Methoden java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Von Schnittstelle geerbte Methoden ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Konstruktordetails
-
GLTextureBuilder
-
GLTextureBuilder
public GLTextureBuilder()Creates a new texture builder.
-
-
Methodendetails
-
getClassHandler
-
build
Builds a new `GdkTexture` with the values set up in the builder.
The `destroy` function gets called when the returned texture gets released;
either when the texture is finalized or by an explicit call to
[method@Gdk.GLTexture.release]. It should release all GL resources associated
with the texture, such as the [property@Gdk.GLTextureBuilder:id] and the
[property@Gdk.GLTextureBuilder:sync].
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.- Parameter:
destroy
- destroy function to be called when the texture is releaseddata
- user data to pass to the destroy function- Gibt zurück:
- a newly built `GdkTexture`
-
getColorState
Gets the color state previously set via gdk_gl_texture_builder_set_color_state().- Gibt zurück:
- the color state
-
getContext
Gets the context previously set via gdk_gl_texture_builder_set_context() or
%NULL if none was set.- Gibt zurück:
- The context
-
getFormat
public int getFormat()Gets the format previously set via gdk_gl_texture_builder_set_format().- Gibt zurück:
- The format
-
getHasMipmap
public boolean getHasMipmap()Gets whether the texture has a mipmap.- Gibt zurück:
- Whether the texture has a mipmap
-
getHeight
public int getHeight()Gets the height previously set via gdk_gl_texture_builder_set_height() or
0 if the height wasn't set.- Gibt zurück:
- The height
-
getId
public int getId()Gets the texture id previously set via gdk_gl_texture_builder_set_id() or
0 if the id wasn't set.- Gibt zurück:
- The id
-
getSync
Gets the `GLsync` previously set via gdk_gl_texture_builder_set_sync().- Gibt zurück:
- the `GLSync`
-
getUpdateRegion
Gets the region previously set via gdk_gl_texture_builder_set_update_region() or
%NULL if none was set.- Gibt zurück:
- The region
-
getUpdateTexture
Gets the texture previously set via gdk_gl_texture_builder_set_update_texture() or
%NULL if none was set.- Gibt zurück:
- The texture
-
getWidth
public int getWidth()Gets the width previously set via gdk_gl_texture_builder_set_width() or
0 if the width wasn't set.- Gibt zurück:
- The width
-
setColorState
Sets the color state for the texture.
By default, the sRGB colorstate is used. If you don't know what
colorstates are, this is probably the right thing.- Parameter:
color_state
- a `GdkColorState`
-
setContext
Sets the context to be used for the texture. This is the context that owns
the texture.
The context must be set before calling [method@Gdk.GLTextureBuilder.build].- Parameter:
context
- The context the texture belongs to or %NULL to unset
-
setFormat
public void setFormat(int format) Sets the format of the texture. The default is `GDK_MEMORY_R8G8B8A8_PREMULTIPLIED`.
The format is the preferred format the texture data should be downloaded to. The
format must be supported by the GL version of [property@Gdk.GLTextureBuilder:context].
GDK's texture download code assumes that the format corresponds to the storage
parameters of the GL texture in an obvious way. For example, a format of
`GDK_MEMORY_R16G16B16A16_PREMULTIPLIED` is expected to be stored as `GL_RGBA16`
texture, and `GDK_MEMORY_G8A8` is expected to be stored as `GL_RG8` texture.
Setting the right format is particularly useful when using high bit depth textures
to preserve the bit depth, to set the correct value for unpremultiplied textures
and to make sure opaque textures are treated as such.
Non-RGBA textures need to have swizzling parameters set up properly to be usable
in GSK's shaders.- Parameter:
format
- The texture's format
-
setHasMipmap
public void setHasMipmap(boolean has_mipmap) Sets whether the texture has a mipmap. This allows the renderer and other users of the
generated texture to use a higher quality downscaling.
Typically, the `glGenerateMipmap` function is used to generate a mimap.- Parameter:
has_mipmap
- Whether the texture has a mipmap
-
setHeight
public void setHeight(int height) Sets the height of the texture.
The height must be set before calling [method@Gdk.GLTextureBuilder.build].- Parameter:
height
- The texture's height or 0 to unset
-
setId
public void setId(int id) Sets the texture id of the texture. The texture id must remain unmodified
until the texture was finalized. See [method@Gdk.GLTextureBuilder.build]
for a longer discussion.
The id must be set before calling [method@Gdk.GLTextureBuilder.build].- Parameter:
id
- The texture id to be used for creating the texture
-
setSync
Sets the GLSync object to use for the texture.
GTK will wait on this object before using the created `GdkTexture`.
The `destroy` function that is passed to [method@Gdk.GLTextureBuilder.build]
is responsible for freeing the sync object when it is no longer needed.
The texture builder does not destroy it and it is the callers
responsibility to make sure it doesn't leak.- Parameter:
sync
- the GLSync object
-
setUpdateRegion
Sets the region to be updated by this texture. Together with
[property@Gdk.GLTextureBuilder: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.- Parameter:
region
- the region to update
-
setUpdateTexture
Sets the texture to be updated by this texture. See
[method@Gdk.GLTextureBuilder.set_update_region] for an explanation.- Parameter:
texture
- the texture to update
-
setWidth
public void setWidth(int width) Sets the width of the texture.
The width must be set before calling [method@Gdk.GLTextureBuilder.build].- Parameter:
width
- The texture's width or 0 to unset
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-