Skip to main content

Crate freya_camera

Crate freya_camera 

Source
Expand description

Camera capture for Freya.

  • use_camera: a hook that streams frames from a camera into reactive state.
  • CameraViewer: a component that renders the captured frames.

This crate is reexported in freya::camera.

§Example

use freya::{
    camera::*,
    prelude::*,
};

fn app() -> impl IntoElement {
    let camera = use_camera(CameraConfig::default);
    CameraViewer::new(camera)
}

On macOS the system requires a one time authorization step before any camera can be opened. Call init from main to request it.

Re-exports§

pub use nokhwa;

Modules§

camera
Camera configuration types.
camera_viewer
CameraViewer component.
prelude
use_camera
use_camera hook and the Camera handle.

Functions§

init
Request access to the system cameras. Always true on Linux/Windows. On macOS, blocks on the authorization prompt and returns whether access was granted; call once from main before launching the app.