pub struct CameraFrame {
pub width: u32,
pub height: u32,
pub format: FrameFormat,
pub rotation_degrees: u16,
pub sequence: u64,
pub bytes: Vec<u8>,
}Expand description
One frame from the viewfinder.
Fields§
§width: u32§height: u32§format: FrameFormat§rotation_degrees: u16How far the frame must be rotated clockwise to be the right way up, which is the sensor’s mounting plus the device’s rotation.
sequence: u64Which frame this is in the session, so a consumer can tell a repeat from a new one and count what it missed.
bytes: Vec<u8>The pixels, in format.
Implementations§
Source§impl CameraFrame
impl CameraFrame
Sourcepub fn new(
width: u32,
height: u32,
format: FrameFormat,
rotation_degrees: u16,
sequence: u64,
bytes: Vec<u8>,
) -> Option<Self>
pub fn new( width: u32, height: u32, format: FrameFormat, rotation_degrees: u16, sequence: u64, bytes: Vec<u8>, ) -> Option<Self>
A frame, or None when the bytes do not match the size and format —
which is a backend bug, and one that reads as corrupted video rather
than as an error if it is let through.
Trait Implementations§
Source§impl Clone for CameraFrame
impl Clone for CameraFrame
Source§fn clone(&self) -> CameraFrame
fn clone(&self) -> CameraFrame
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CameraFrame
impl Debug for CameraFrame
impl Eq for CameraFrame
Source§impl PartialEq for CameraFrame
impl PartialEq for CameraFrame
impl StructuralPartialEq for CameraFrame
Auto Trait Implementations§
impl Freeze for CameraFrame
impl RefUnwindSafe for CameraFrame
impl Send for CameraFrame
impl Sync for CameraFrame
impl Unpin for CameraFrame
impl UnsafeUnpin for CameraFrame
impl UnwindSafe for CameraFrame
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more