LavaUI docs

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)

Not documented.

Sources/LavaUI/Image.swift:29

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

Not documented.

Sources/LavaUI/Image.swift:21

let pixelWidth: Float

Not documented.

Sources/LavaUI/Image.swift:20

var size: (w: Float, h: Float) { get }

Not documented.

Sources/LavaUI/Image.swift:65

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:25

let surfaceMaxSide: UInt32

Longest dest edge for a surfaceId poster; 0 is native.

Sources/LavaUI/Image.swift:27

let textureId: UInt32

Not documented.

Sources/LavaUI/Image.swift:19

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:48