Texture
open class Texture : GLibObject.Object, TextureProtocol
The Texture type acts as a reference-counted owner of an underlying GdkTexture instance.
It provides the methods that can operate on this data type through TextureProtocol conformance.
Use Texture as a strong reference or owner of a GdkTexture instance.
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
GdkPixbuf, or a Cairo surface, or other pixel data.
The ownership of the pixel data is transferred to the GdkTexture
instance; you can only make a copy of it, via
[methodGdk.Texture.download].
GdkTexture is an immutable object: That means you cannot change
anything about it other than increasing the reference count via
g_object_ref().
-
Designated initialiser from the underlying `C` data type.This creates an instance without performing an unbalanced retain i.e., ownership is transferred to the
Textureinstance.Declaration
Swift
@inlinable public init(_ op: UnsafeMutablePointer<GdkTexture>)Parameters
oppointer to the underlying object
-
Designated initialiser from a constant pointer to the underlying
Cdata type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to theTextureinstance.Declaration
Swift
@inlinable public init(_ op: UnsafePointer<GdkTexture>)Parameters
oppointer to the underlying object
-
Optional initialiser from a non-mutating
gpointerto the underlyingCdata type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to theTextureinstance.Declaration
Swift
@inlinable override public init!(gpointer op: gpointer?)Parameters
opgpointer to the underlying object
-
Optional initialiser from a non-mutating
gconstpointerto the underlyingCdata type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to theTextureinstance.Declaration
Swift
@inlinable override public init!(gconstpointer op: gconstpointer?)Parameters
oppointer to the underlying object
-
Optional initialiser from a constant pointer to the underlying
Cdata type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to theTextureinstance.Declaration
Swift
@inlinable public init!(_ op: UnsafePointer<GdkTexture>?)Parameters
oppointer to the underlying object
-
Optional initialiser from the underlying
Cdata type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to theTextureinstance.Declaration
Swift
@inlinable public init!(_ op: UnsafeMutablePointer<GdkTexture>?)Parameters
oppointer to the underlying object
-
Designated initialiser from the underlying
Cdata type. Will retainGdkTexture. i.e., ownership is transferred to theTextureinstance.Declaration
Swift
@inlinable public init(retaining op: UnsafeMutablePointer<GdkTexture>)Parameters
oppointer to the underlying object
-
Reference intialiser for a related type that implements
TextureProtocolWill retainGdkTexture.Declaration
Swift
@inlinable public init<T>(texture other: T) where T : TextureProtocolParameters
otheran instance of a related type that implements
TextureProtocol -
Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
TextureProtocol.Declaration
Swift
@inlinable override public init<T>(cPointer p: UnsafeMutablePointer<T>)Parameters
cPointerpointer to the underlying object
-
Unsafe typed, retaining initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
TextureProtocol.Declaration
Swift
@inlinable override public init<T>(retainingCPointer cPointer: UnsafeMutablePointer<T>)Parameters
cPointerpointer to the underlying object
-
Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
TextureProtocol.Declaration
Swift
@inlinable override public init(raw p: UnsafeRawPointer)Parameters
praw pointer to the underlying object
-
Unsafe untyped, retaining initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
TextureProtocol.Declaration
Swift
@inlinable override public init(retainingRaw raw: UnsafeRawPointer) -
Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
TextureProtocol.Declaration
Swift
@inlinable public required init(raw p: UnsafeMutableRawPointer)Parameters
pmutable raw pointer to the underlying object
-
Unsafe untyped, retaining initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
TextureProtocol.Declaration
Swift
@inlinable required public init(retainingRaw raw: UnsafeMutableRawPointer)Parameters
rawmutable raw pointer to the underlying object
-
Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
TextureProtocol.Declaration
Swift
@inlinable override public init(opaquePointer p: OpaquePointer)Parameters
popaque pointer to the underlying object
-
Unsafe untyped, retaining initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
TextureProtocol.Declaration
Swift
@inlinable override public init(retainingOpaquePointer p: OpaquePointer)Parameters
popaque pointer to the underlying object
-
Creates a new texture object representing the
GdkPixbuf.Declaration
Swift
@inlinable public init<PixbufT>(pixbuf: PixbufT) where PixbufT : PixbufProtocol -
Creates a new texture by loading an image from a file.
The file format is detected automatically. The supported formats are PNG and JPEG, though more formats might be available.
If
nilis returned, thenerrorwill be set.Declaration
Swift
@inlinable public init<FileT>(file: FileT) throws where FileT : FileProtocol -
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_pathdoes 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 [ctorGdk.Texture.new_from_file] to load it.Declaration
Swift
@inlinable public init(resource resourcePath: UnsafePointer<CChar>!) -
Creates a new texture object representing the
GdkPixbuf.Declaration
Swift
@inlinable public static func newFor<PixbufT>(pixbuf: PixbufT) -> Texture! where PixbufT : PixbufProtocol -
Creates a new texture by loading an image from a file.
The file format is detected automatically. The supported formats are PNG and JPEG, though more formats might be available.
If
nilis returned, thenerrorwill be set.Declaration
Swift
@inlinable public static func newFrom<FileT>(file: FileT) throws -> Texture! where FileT : FileProtocol -
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_pathdoes 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 [ctorGdk.Texture.new_from_file] to load it.Declaration
Swift
@inlinable public static func newFrom(resource resourcePath: UnsafePointer<CChar>!) -> Texture!
View on GitHub
Install in Dash
Texture Class Reference