Struct basic_frame::BasicFrame

source ·
pub struct BasicFrame<F> {
    pub width: u32,
    pub height: u32,
    pub stride: u32,
    pub image_data: Vec<u8>,
    pub pixel_format: PhantomData<F>,
    pub extra: Box<dyn HostTimeData>,
}
Expand description

Image data with a statically typed, strided pixel format.

Fields§

§width: u32

width in pixels

§height: u32

height in pixels

§stride: u32

number of bytes in an image row

§image_data: Vec<u8>

raw image data

§pixel_format: PhantomData<F>

pixel format

§extra: Box<dyn HostTimeData>

Additional data, including timestamp information.

Implementations§

source§

impl<F> BasicFrame<F>

source

pub fn copy_from(frame: &dyn ImageStrideTime<F>) -> BasicFrame<F>

Trait Implementations§

source§

impl<F: Clone> Clone for BasicFrame<F>

source§

fn clone(&self) -> BasicFrame<F>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<F> ExtraTimeData for BasicFrame<F>

source§

fn extra(&self) -> &dyn HostTimeData

source§

impl<F> From<BasicFrame<F>> for Vec<u8>

source§

fn from(orig: BasicFrame<F>) -> Vec<u8>

Converts to this type from the input type.
source§

impl<F> ImageData<F> for BasicFrame<F>

source§

fn width(&self) -> u32

Number of pixel columns in the image. Note: this is not the stride.
source§

fn height(&self) -> u32

Number of pixel rows in the image.
source§

fn buffer_ref(&self) -> ImageBufferRef<'_, F>

Returns the image buffer specified by pixel format F. Read more
source§

fn buffer(self) -> ImageBuffer<F>

Returns the image buffer specified by pixel format F. Read more
source§

fn image_data(&self) -> &[u8]

Returns the raw image data as specified by pixel format F. Read more
source§

impl<F> ImageMutData<F> for BasicFrame<F>

source§

fn buffer_mut_ref(&mut self) -> ImageBufferMutRef<'_, F>

Returns the image mutable buffer specified by pixel format F. Read more
source§

impl<F> PartialEq for BasicFrame<F>
where F: PixelFormat,

source§

fn eq(&self, other: &BasicFrame<F>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<F> Stride for BasicFrame<F>

source§

fn stride(&self) -> usize

the width (in bytes) of each row of image data Read more

Auto Trait Implementations§

§

impl<F> Freeze for BasicFrame<F>

§

impl<F> !RefUnwindSafe for BasicFrame<F>

§

impl<F> Send for BasicFrame<F>
where F: Send,

§

impl<F> !Sync for BasicFrame<F>

§

impl<F> Unpin for BasicFrame<F>
where F: Unpin,

§

impl<F> !UnwindSafe for BasicFrame<F>

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> AsAny for T
where T: Any,

source§

fn as_any(&self) -> &(dyn Any + 'static)

source§

impl<S, F> AsImageData<F> for S
where S: ImageData<F>,

source§

fn as_image_data(&self) -> &dyn ImageData<F>

source§

impl<S, F> AsImageStride<F> for S
where S: ImageStride<F>,

source§

impl<S, F> AsImageStrideTime<F> for S
where S: ImageStrideTime<F>,

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> DynClone for T
where T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<S, F> ImageStride<F> for S
where S: ImageData<F> + Stride, F: PixelFormat,

source§

impl<S, F> ImageStrideMut<F> for S
where S: ImageMutData<F> + Stride, F: PixelFormat,

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> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.
source§

impl<S, F> FrameTrait<F> for S
where S: AsImageStrideTime<F> + ImageStrideTime<F>, Vec<u8>: From<S>,

source§

impl<S, F> ImageStride<F> for S
where S: ImageData<F> + Stride,

source§

impl<S, F> ImageStrideTime<F> for S
where S: ExtraTimeData + ImageData<F> + Stride,

source§

impl<S, F> OwnedImage<F> for S
where S: AsImageData<F> + ImageData<F>, Vec<u8>: From<S>,

source§

impl<S, F> OwnedImageStride<F> for S
where S: AsImageStride<F> + ImageStride<F>, Vec<u8>: From<S>,