use thiserror::Error;
#[derive(Clone)]
pub struct Frame {
pub width: u32,
pub height: u32,
pub bgra: Vec<u8>,
}
#[derive(Debug, Clone, Error)]
pub enum CaptureError {
#[error(
"camera access denied — grant Camera permission \
(on macOS, run inside an app bundle with NSCameraUsageDescription)"
)]
AccessDenied,
#[error("no camera matched that id")]
NotFound,
#[error("camera produced no frame in time")]
Timeout,
#[error("capture setup failed: {0}")]
Setup(String),
#[error("camera capture is not implemented on this platform")]
Unsupported,
}