Skip to main content

VisionCamera

Classes

  • Camera
  • CameraCaptureError
  • CameraRuntimeError
  • Interfaces

  • CameraDevice
  • CameraDeviceFormat
  • CameraProps
  • CodeScanner
  • CodeScannerFrame
  • DeviceFilter
  • DrawableFrame
  • DrawableFrameProcessor
  • ErrorWithCause
  • FormatFilter
  • Frame
  • FrameProcessorPlugin
  • NativeBuffer
  • OnShutterEvent
  • PhotoFile
  • Point
  • ReadonlyFrameProcessor
  • RecordVideoOptions
  • TakePhotoOptions
  • TakeSnapshotOptions
  • VideoFile
  • Type Aliases

    AutoFocusSystem

    Ƭ AutoFocusSystem : "contrast-detection" | "phase-detection" | "none"

    Indicates a format's autofocus system.

  • "none" : Indicates that autofocus is not available
  • "contrast-detection" : Indicates that autofocus is achieved by contrast detection. Contrast detection performs a focus scan to find the optimal position
  • "phase-detection" : Indicates that autofocus is achieved by phase detection. Phase detection has the ability to achieve focus in many cases without a focus scan. Phase detection autofocus is typically less visually intrusive than contrast detection autofocus
  • Defined in

    types/CameraDevice.ts:34

    CameraPermissionRequestResult

    Ƭ CameraPermissionRequestResult : "granted" | "denied"

    Defined in

    Camera.tsx:31

    CameraPermissionStatus

    Ƭ CameraPermissionStatus : "granted" | "not-determined" | "denied" | "restricted"

    Defined in

    Camera.tsx:30

    CameraPosition

    Ƭ CameraPosition : "front" | "back" | "external"

    Represents the camera device position.

  • "back" : Indicates that the device is physically located on the back of the phone
  • "front" : Indicates that the device is physically located on the front of the phone
  • "external" : The camera device is an external camera, and has no fixed facing relative to the phone. (e.g. USB or Continuity Cameras)
  • Defined in

    types/CameraDevice.ts:10

    CaptureError

    Ƭ CaptureError : "capture/recording-in-progress" | "capture/recording-canceled" | "capture/no-recording-in-progress" | "capture/file-io-error" | "capture/create-temp-file-error" | "capture/create-recorder-error" | "capture/insufficient-storage" | "capture/video-not-enabled" | "capture/photo-not-enabled" | "capture/frame-invalid" | "capture/no-data" | "capture/recorder-error" | "capture/focus-canceled" | "capture/focus-requires-preview" | "capture/timed-out" | "capture/snapshot-failed" | "capture/snapshot-failed-preview-not-enabled" | "capture/image-data-access-error" | "capture/encoder-error" | "capture/invalid-image-type" | "capture/failed-writing-metadata" | "capture/unknown"

    Defined in

    CameraError.ts:37

    CodeScannerError

    Ƭ CodeScannerError : "code-scanner/not-compatible-with-outputs" | "code-scanner/code-type-not-supported" | "code-scanner/cannot-load-model"

    Defined in

    CameraError.ts:33

    CodeType

    Ƭ CodeType : "code-128" | "code-39" | "code-93" | "codabar" | "ean-13" | "ean-8" | "itf" | "upc-e" | "upc-a" | "qr" | "pdf-417" | "aztec" | "data-matrix"

    The type of the code to scan.

    Defined in

    types/CodeScanner.ts:6

    DeviceError

    Ƭ DeviceError : "device/configuration-error" | "device/no-device" | "device/invalid-device" | "device/microphone-unavailable" | "device/pixel-format-not-supported" | "device/low-light-boost-not-supported" | "device/focus-not-supported" | "device/camera-not-available-on-simulator" | "device/camera-already-in-use"

    Defined in

    CameraError.ts:7

    FormatError

    Ƭ FormatError : "format/invalid-fps" | "format/invalid-video-hdr" | "format/photo-hdr-and-video-hdr-not-suppoted-simultaneously" | "format/low-light-boost-not-supported-with-hdr" | "format/invalid-video-stabilization-mode" | "format/incompatible-pixel-format-with-hdr-setting" | "format/invalid-format" | "format/format-required"

    Defined in

    CameraError.ts:17

    Orientation

    Ƭ Orientation : "portrait" | "portrait-upside-down" | "landscape-left" | "landscape-right"

    Represents Orientation. Depending on the context, this might be a sensor orientation (relative to the phone's orentation), or view orientation.

  • portrait : (home-button at the bottom)
  • landscape-left : 90° (home-button on the left)
  • portrait-upside-down : 180° (home-button at the top)
  • landscape-right : 270° (home-button on the right)
  • Defined in

    types/Orientation.ts:10

    OutputOrientation

    Ƭ OutputOrientation : "device" | "preview" | Orientation

    Represents the orientation of the camera outputs.

    Output orientation can either be automatically calculated ( 'device' or 'preview' ), or fixed to a specific orientation ( Orientation ).

    Defined in

    types/OutputOrientation.ts:9

    ParameterError

    Ƭ ParameterError : "parameter/invalid-parameter" | "parameter/unsupported-output" | "parameter/unsupported-input" | "parameter/invalid-combination"

    Defined in

    CameraError.ts:2

    PermissionError

    Ƭ PermissionError : "permission/microphone-permission-denied" | "permission/camera-permission-denied"

    Defined in

    CameraError.ts:1

    PhysicalCameraDeviceType

    Ƭ PhysicalCameraDeviceType : "ultra-wide-angle-camera" | "wide-angle-camera" | "telephoto-camera"

    Indentifiers for a physical camera (one that actually exists on the back/front of the device)

  • "ultra-wide-angle-camera" : A built-in camera with a shorter focal length than that of a wide-angle camera. (FOV of 94° or higher)
  • "wide-angle-camera" : A built-in wide-angle camera. (FOV between 60° and 94°)
  • "telephoto-camera" : A built-in camera device with a longer focal length than a wide-angle camera. (FOV of 60° or lower)
  • Some Camera devices consist of multiple physical devices. They can be interpreted as logical devices , for example:

  • "ultra-wide-angle-camera" + "wide-angle-camera" = dual wide-angle camera .
  • "wide-angle-camera" + "telephoto-camera" = dual camera .
  • "ultra-wide-angle-camera" + "wide-angle-camera" + "telephoto-camera" = triple camera .
  • Defined in

    types/CameraDevice.ts:25

    PixelFormat

    Ƭ PixelFormat : "yuv" | "rgb" | "unknown"

    Represents the pixel format of a Frame .

    If you intend to read Pixels from this Frame or use an ML model for processing, make sure that you are using the expected PixelFormat , otherwise the plugin might not be able to properly understand the Frame's content.

    Most ML models operate in either yuv (recommended) or rgb .

  • yuv : Frame is in YUV pixel-format (Y'CbCr 4:2:0 or NV21, 8-bit)
  • rgb : Frame is in RGB pixel-format (RGBA or BGRA, 8-bit)
  • unknown : Frame has unknown/unsupported pixel-format.
  • Defined in

    types/PixelFormat.ts:13

    SessionError

    Ƭ SessionError : "session/camera-not-ready" | "session/audio-in-use-by-other-app" | "session/no-outputs" | "session/audio-session-failed-to-activate" | "session/hardware-cost-too-high" | "session/invalid-output-configuration"

    Defined in

    CameraError.ts:26

    SnapshotFile

    Ƭ SnapshotFile : Pick < PhotoFile , "path" | "width" | "height" | "orientation" | "isMirrored" >

    Defined in

    types/Snapshot.ts:11

    SystemError

    Ƭ SystemError : "system/camera-module-not-found" | "system/camera-is-restricted" | "system/location-not-enabled" | "system/no-camera-manager" | "system/frame-processors-unavailable" | "system/recording-while-frame-processing-unavailable" | "system/view-not-found" | "system/max-cameras-in-use" | "system/do-not-disturb-bug"

    Defined in

    CameraError.ts:60

    UnknownError

    Ƭ UnknownError : "unknown/unknown"

    Defined in

    CameraError.ts:70

    VideoStabilizationMode

    Ƭ VideoStabilizationMode : "off" | "standard" | "cinematic" | "cinematic-extended" | "auto"

    Indicates a format's supported video stabilization mode. Enabling video stabilization may introduce additional latency into the video capture pipeline.

  • "off" : No video stabilization. Indicates that video should not be stabilized
  • "standard" : Standard software-based video stabilization. Standard video stabilization reduces the field of view by about 10%.
  • "cinematic" : Advanced software-based video stabilization. This applies more aggressive cropping or transformations than standard.
  • "cinematic-extended" : Extended software- and hardware-based stabilization that aggressively crops and transforms the video to apply a smooth cinematic stabilization.
  • "auto" : Indicates that the most appropriate video stabilization mode for the device and format should be chosen automatically
  • Defined in

    types/CameraDevice.ts:45

    Variables

    Templates

    Const Templates : Record < PredefinedTemplates , FormatFilter []>

    Predefined templates for use in useCameraFormat / getCameraFormat .

    Example