Package-level declarations

Types

Link copied to clipboard
data class SkiaOnFrameState(val frameTexture: Image, val canvas: Canvas)

Represents the state for rendering a Frame, see renderToTexture.

Link copied to clipboard
data class Transform(val orientation: CameraOrientation, val isMirrored: Boolean)

Describes how a Frame's pixel data is oriented relative to the target output's coordinate system.

Functions

Link copied to clipboard

Clears the internal offscreen surface cache, disposing every cached surface (and the GPU contexts of the rendering threads).

Link copied to clipboard
fun Image.makeNonTextureImage(): Image

Copies this image to the CPU (React Native Skia's SkImage.makeNonTextureImage(), which skiko lacks): the result is a raster image that can be used on any thread, e.g. to display it in the UI or to encode it.

Link copied to clipboard
fun renderToTexture(frame: Frame, onDraw: (state: SkiaOnFrameState) -> Unit): Image

Renders the given frame to a Skia Image and returns it.

Link copied to clipboard
fun transformPoint(normalizedPoint: Point, transform: Transform): Point

Transforms the given normalizedPoint (values ranging from 0...1) using the given transform's Transform.orientation and Transform.isMirrored.