Scoop API

scoop:scoop.graphics:0.1.0

GpuDevice

class GpuDevice

source · line 6
public
public class GpuDevice internal constructor(
    private val resource: GraphicsResource,
    public val backend: GpuBackend
) : Closeable

An owner-thread handle to the canvas's existing GPU context and native queue.

function createBuffer

source · line 13
public
public fun createBuffer(width: Int, height: Int, format: NativeGpuFormat, layout: GpuPixelLayout, colorSpace: GpuColorSpace = GpuColorSpace.Srgb, scale: Double = 1.0): GpuBuffer

function importImage

source · line 56
public
@Unsafe
    public fun importImage(texture: NativeGpuTexture, width: Int, height: Int, format: NativeGpuFormat, layout: GpuPixelLayout, owner: NativeGpuImageOwner, origin: GpuImageOrigin = GpuImageOrigin.TopLeft, colorSpace: GpuColorSpace = GpuColorSpace.Srgb, alpha: GpuImageAlpha = GpuImageAlpha.Premultiplied): Image

Imports immutable native pixels without copying. The owner must keep storage alive and unchanged until release. Submit producers on this device's queue before importing.