Skip to main content

FrameMut

Struct FrameMut 

Source
pub struct FrameMut<'a> {
    pub geometry: Geometry,
    pub timestamp: Micros,
    pub sequence: u32,
    pub planes: PlanesMut<'a>,
}
Expand description

A frame whose memory is being written or transformed in place: what a source fills, a scaler or a colour conversion works on, before the read-only Frame view moves down the pipeline.

Fields§

§geometry: Geometry

Dimensions and format.

§timestamp: Micros

Capture instant.

§sequence: u32

Frame counter.

§planes: PlanesMut<'a>

The pixels.

Implementations§

Source§

impl<'a> FrameMut<'a>

Source

pub fn packed( geometry: Geometry, timestamp: Micros, sequence: u32, data: &'a mut [u8], ) -> Result<Self>

A packed frame over data, with the same checks as Frame::packed except the JPEG-magic check (the bytes are about to be written).

Source

pub fn yuv420p( geometry: Geometry, timestamp: Micros, sequence: u32, y: (&'a mut [u8], usize), u: (&'a mut [u8], usize), v: (&'a mut [u8], usize), ) -> Result<Self>

A planar 4:2:0 frame over three buffers, as Frame::yuv420p.

Source

pub fn as_frame(&self) -> Result<Frame<'_>>

The read-only view, for handing on once the writing is done. A packed compressed frame is checked for its magic here, as Frame::packed does.

Source

pub fn packed_mut(&mut self) -> Option<&mut [u8]>

The packed bytes, mutable, when the frame is packed.

Trait Implementations§

Source§

impl<'a> Debug for FrameMut<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> !UnwindSafe for FrameMut<'a>

§

impl<'a> Freeze for FrameMut<'a>

§

impl<'a> RefUnwindSafe for FrameMut<'a>

§

impl<'a> Send for FrameMut<'a>

§

impl<'a> Sync for FrameMut<'a>

§

impl<'a> Unpin for FrameMut<'a>

§

impl<'a> UnsafeUnpin for FrameMut<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.