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 CameraViewercomponent.- prelude
- use_
camera use_camerahook and theCamerahandle.
Functions§
- init
- Request access to the system cameras. Always
trueon Linux/Windows. On macOS, blocks on the authorization prompt and returns whether access was granted; call once frommainbefore launching the app.