Skip to main content

camera_stream/
frame.rs

1use crate::types::{PixelFormat, Resolution};
2use core::time::Duration;
3
4/// A single plane of image data.
5pub struct Plane<'a> {
6    pub data: &'a [u8],
7    pub bytes_per_row: usize,
8}
9
10/// A borrowed video frame. Lifetime tied to callback scope (zero-copy).
11pub trait Frame {
12    fn pixel_format(&self) -> PixelFormat;
13    fn resolution(&self) -> Resolution;
14    fn planes(&self) -> &[Plane<'_>];
15    fn timestamp(&self) -> Duration;
16}