PreviewViewRef

A reference to a NativePreviewView, giving access to its methods (the equivalent of a ref on VisionCamera's <NativePreviewView />). Create it with rememberPreviewViewRef and pass it to NativePreviewView.

View coordinates are in Compose pixels, as in pointer events (e.g. the offset of a tap).

Properties

Link copied to clipboard

Whether the NativePreviewView is displayed and its methods can be called.

Functions

Link copied to clipboard

Converts a point in camera sensor coordinates into a point of the view.

Returns a new ScannedObject where all coordinates of the given scannedObject (its bounding box, and the corner points of a me.nathanfallet.visioncamera.ScannedCode) are converted into view coordinates, in Compose pixels. iOS only, like V5.

Link copied to clipboard

Converts a point of the view into camera sensor coordinates.

Link copied to clipboard
fun createMeteringPoint(viewPoint: Offset, size: Float? = null): MeteringPoint

Creates a MeteringPoint from a point of the view (e.g. a tap), taking orientation, scaling and cropping into account, to focus with me.nathanfallet.visioncamera.CameraController.focusTo.

Link copied to clipboard
suspend fun takeSnapshot(): Image

Takes a snapshot of the preview's current contents, and returns it as an Image. Android only, like V5.