class UIImage
Swift
final class UIImage
GPU texture handle for LavaUI Image views.
Load via Editor.loadImage(path:) (or ImageStore). Identity is the
absolute path; the engine texture id is stable for the process lifetime of
that path (TextureManager refcounts).
Sources/LavaUI/Image.swift:10
Constructors
init(path: String, cacheKey: String? = nil, textureId: UInt32, pixelWidth: Float, pixelHeight: Float, surfaceId: UInt32 = 0, surfaceMaxSide: UInt32 = 0)
Wraps a texture that has already been loaded. Apps normally get images from
ImageStore or Editor.loadImage(path:) rather than calling this.
cacheKey defaults to path.
Sources/LavaUI/Image.swift:35
Properties
let cacheKey: String
Cache and engine-texture identity: path plus the decode size.
Not the same thing as path, because the same file decoded for a 48pt
avatar and for a 200pt hero are two different textures and must not
evict or alias each other.
Sources/LavaUI/Image.swift:18
let path: String
File this was decoded from.
Sources/LavaUI/Image.swift:12
let pixelHeight: Float
Height of the decoded bitmap, in pixels.
Sources/LavaUI/Image.swift:24
let pixelWidth: Float
Width of the decoded bitmap, in pixels.
Sources/LavaUI/Image.swift:22
var size: (w: Float, h: Float) { get }
The decoded bitmap's size, in pixels.
Sources/LavaUI/Image.swift:72
let surfaceId: UInt32
Compositor surface this poster should sample, or 0 for a normal
TextureManager id in textureId. A GPU-less client cannot import
a dma-buf; it names the surface and the compositor resolves it.
Sources/LavaUI/Image.swift:28
let surfaceMaxSide: UInt32
Longest dest edge for a surfaceId poster; 0 is native.
Sources/LavaUI/Image.swift:30
let textureId: UInt32
The engine texture the image draws from; 0 for a surfaceId poster.
Sources/LavaUI/Image.swift:20
Methods
static func surfacePoster(surfaceId: UInt32, pixelWidth: Float, pixelHeight: Float, maxSide: UInt32) -> UIImage
A window poster resolved by the compositor when this image is drawn.
Sources/LavaUI/Image.swift:54