Skip to main content

Module camera

Module camera 

Source
Expand description

Live camera capture: an in-app viewfinder frame source.

Unlike the one-shot image_picker (which presents the system camera UI), this exposes a running capture session whose latest frame the app polls to render its own viewfinder and run per-frame detection — matching the Android/desktop live-preview experience.

The platform backend installs an implementation via set_platform_camera (iOS AVCaptureSession, desktop nokhwa, …). No default: camera returns None where live capture is unsupported, so the app can fall back to the image picker.

Structs§

CameraFrame
A single captured frame as tightly-packed RGBA8 (width * height * 4 bytes, row-major, no padding).

Enums§

CameraError

Traits§

Camera
A running (or startable) live camera. Implementations are Send + Sync so a background preview pump can start/stop and poll frames off the UI thread.

Functions§

camera
The registered live camera, or None where live capture is unsupported.
clear_platform_camera
Removes any registered platform camera (tests/teardown).
set_platform_camera
Installs the platform live camera, replacing any previous one.

Type Aliases§

CameraRef