use crate::device::{Device, Local}; use crate::format::{Format, Rgb24, Yuv420p}; // convenience aliases pub type Yuv420pFrame = Frame; pub type RgbFrame = Frame; pub struct Frame { data: D::Container, dims: (usize, usize), } impl Frame { pub fn new(data: D::Container, dims: (usize, usize)) -> Self { Self { data, dims } } #[inline(always)] pub const fn num_channels() -> usize { F::NUM_CHANNELS } } pub trait Dimensions { fn dims(&self) -> (usize, usize); } impl Dimensions for Frame { fn dims(&self) -> (usize, usize) { self.dims } }