1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//! Camera capture for Freya.
//!
//! - [`use_camera`](use_camera::use_camera): a hook that streams frames from a
//! camera into reactive state.
//! - [`CameraViewer`](camera_viewer::CameraViewer): a component that renders
//! the captured frames.
//!
//! This crate is reexported in `freya::camera`.
//!
//! # Example
//!
//! ```rust, no_run
//! 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.
pub
pub use nokhwa;
/// 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.