TextureProtocol
public protocol TextureProtocol : ObjectProtocol, PaintableProtocolThe TextureProtocol protocol exposes the methods and properties of an underlying GdkTexture instance.
The default implementation of these can be found in the protocol extension below.
For a concrete class that implements these methods and properties, see Texture.
Alternatively, use TextureRef as a lighweight, unowned reference if you already have an instance you just want to use.
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().
- 
                  
                  Untyped pointer to the underlying GdkTextureinstance.DeclarationSwift var ptr: UnsafeMutableRawPointer! { get }
- 
                  texture_ptrDefault implementationTyped pointer to the underlying GdkTextureinstance.Default ImplementationReturn the stored, untyped pointer as a typed pointer to the GdkTextureinstance.DeclarationSwift var texture_ptr: UnsafeMutablePointer<GdkTexture>! { get }
- 
                  
                  Required Initialiser for types conforming to TextureProtocolDeclarationSwift init(raw: UnsafeMutableRawPointer)
- 
                  bind(property:Extension methodto: _: flags: transformFrom: transformTo: ) Bind a TexturePropertyNamesource property to a given target object.DeclarationSwift @discardableResult @inlinable func bind<Q, T>(property source_property: TexturePropertyName, to target: T, _ target_property: Q, flags f: BindingFlags = .default, transformFrom transform_from: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }, transformTo transform_to: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }) -> BindingRef! where Q : PropertyNameProtocol, T : ObjectProtocolParameterssource_propertythe source property to bind targetthe target object to bind to target_propertythe target property to bind to flagsthe flags to pass to the Bindingtransform_fromValueTransformerto use for forward transformationtransform_toValueTransformerto use for backwards transformationReturn Valuebinding reference or nilin case of an error
- 
                  get(property:Extension method) Get the value of a Texture property DeclarationSwift @inlinable func get(property: TexturePropertyName) -> GLibObject.ValueParameterspropertythe property to get the value for Return Valuethe value of the named property 
- 
                  set(property:Extension methodvalue: ) Set the value of a Texture property. Note that this will only have an effect on properties that are writable and not construct-only! DeclarationSwift @inlinable func set(property: TexturePropertyName, value v: GLibObject.Value)Parameterspropertythe property to get the value for Return Valuethe value of the named property 
- 
                  download(data:Extension methodstride: ) Downloads the textureinto 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_FORMAT_ARGB32, so every downloaded pixel requires 4 bytes of memory.Downloading a texture into a Cairo image surface: surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, gdk_texture_get_width (texture), gdk_texture_get_height (texture)); gdk_texture_download (texture, cairo_image_surface_get_data (surface), cairo_image_surface_get_stride (surface)); cairo_surface_mark_dirty (surface);DeclarationSwift @inlinable func download(data: UnsafeMutablePointer<guchar>!, stride: Int)
- 
                  getHeight()Extension methodReturns the height of the texture, in pixels.DeclarationSwift @inlinable func getHeight() -> Int
- 
                  getWidth()Extension methodReturns the width of texture, in pixels.DeclarationSwift @inlinable func getWidth() -> Int
- 
                  saveToPng(filename:Extension method) Store the given textureto thefilenameas a PNG file.This is a utility function intended for debugging and testing. If you want more control over formats, proper error handling or want to store to a GFileor other location, you might want to look into using the gdk-pixbuf library.DeclarationSwift @inlinable func saveToPng(filename: UnsafePointer<CChar>!) -> Bool
- 
                  pixbufGetFromTexture()Extension methodCreates a new pixbuf from texture.This should generally not be used in newly written code as later stages will almost certainly convert the pixbuf back into a texture to draw it on screen. DeclarationSwift @inlinable func pixbufGetFromTexture() -> PixbufRef!
- 
                  heightExtension methodThe height of the texture, in pixels. DeclarationSwift @inlinable var height: Int { get }
- 
                  widthExtension methodThe width of the texture, in pixels. DeclarationSwift @inlinable var width: Int { get }
 View on GitHub
            View on GitHub
           Install in Dash
            Install in Dash
           TextureProtocol Protocol Reference
      TextureProtocol Protocol Reference