VisionCamera

The entry point of KMP Vision Camera: the platform's CameraFactory.

  • On Android, it is backed by CameraX (and Camera2 interop), and initialized automatically with the application context.

  • On iOS, it is backed by AVFoundation.

Properties

Link copied to clipboard

The current Camera PermissionStatus.

Link copied to clipboard

The current Microphone PermissionStatus.

Link copied to clipboard

Whether the platform supports creating multi-cam CameraSessions. Older phones may not support this.

Functions

Link copied to clipboard
open suspend override fun createCameraSession(enableMultiCam: Boolean): CameraSession

Creates a new CameraSession.

Link copied to clipboard
open override fun createDepthFrameOutput(options: DepthFrameOutputOptions = DepthFrameOutputOptions()): CameraDepthFrameOutput

Create a new CameraDepthFrameOutput with the given options, to stream Depth frames.

Link copied to clipboard
open suspend override fun createDeviceFactory(): CameraDeviceFactory

Create a new CameraDeviceFactory.

Link copied to clipboard
open override fun createFrameOutput(options: FrameOutputOptions = FrameOutputOptions()): CameraFrameOutput

Create a new CameraFrameOutput with the given options, to stream Frames (Frame Processing).

Link copied to clipboard
open override fun createFrameRenderer(): FrameRenderer

Create a new FrameRenderer, to render Frames into a FrameRendererView.

Link copied to clipboard
open override fun createNormalizedMeteringPoint(x: Double, y: Double, size: Double? = null): MeteringPoint

Create a MeteringPoint from normalized coordinates, from 0.0 to 1.0. You are responsible for handling orientation, cropping and scaling; to create a point from a tap on a PreviewView, use its createMeteringPoint instead.

Link copied to clipboard

Create a new CameraObjectOutput with the given options, to scan codes, faces and bodies.

Link copied to clipboard
open override fun createOrientationManager(orientationSource: OrientationSource): OrientationManager

Create a new OrientationManager tracking the given orientationSource.

Link copied to clipboard

Create a new CameraOutputSynchronizer synchronizing the given outputs.

Link copied to clipboard
open override fun createPhotoOutput(options: PhotoOutputOptions = PhotoOutputOptions()): CameraPhotoOutput

Create a new CameraPhotoOutput with the given options.

Link copied to clipboard
Link copied to clipboard

Create a new TapToFocusGestureController, to attach to a PreviewView.

Link copied to clipboard
open override fun createVideoOutput(options: VideoOutputOptions = VideoOutputOptions()): CameraVideoOutput

Create a new CameraVideoOutput with the given options.

Link copied to clipboard

Create a new ZoomGestureController, to attach to a PreviewView.

Link copied to clipboard
open suspend override fun requestCameraPermission(): Boolean

Request Camera permission.

Link copied to clipboard
open suspend override fun requestMicrophonePermission(): Boolean

Request Microphone permission.

Link copied to clipboard
open suspend override fun resolveConstraints(device: CameraDevice, outputConfigurations: List<CameraOutputConfiguration>, constraints: List<Constraint>, requiresMultiCam: Boolean = false): CameraSessionConfig

Resolves the given constraints to a fully validated CameraSessionConfig respecting the given device's capabilities negotiated with the given outputConfigurations.