Struct v4l::format::Format

source ·
pub struct Format {
    pub width: u32,
    pub height: u32,
    pub fourcc: FourCC,
    pub field_order: FieldOrder,
    pub stride: u32,
    pub size: u32,
    pub flags: Flags,
    pub colorspace: Colorspace,
    pub quantization: Quantization,
    pub transfer: TransferFunction,
}
Expand description

Streaming format (single-planar)

Fields§

§width: u32

width in pixels

§height: u32

height in pixels

§fourcc: FourCC

pixelformat code

§field_order: FieldOrder

field order for interlacing

§stride: u32

bytes per line

§size: u32

maximum number of bytes required to store an image

§flags: Flags

flags set by the application or driver

§colorspace: Colorspace

supplements the pixelformat (fourcc) information

§quantization: Quantization

the way colors are mapped

§transfer: TransferFunction

the transfer function for the colorspace

Implementations§

source§

impl Format

source

pub const fn new(width: u32, height: u32, fourcc: FourCC) -> Self

Returns a capture format

§Arguments
  • width - Width in pixels
  • height - Height in pixels
  • fourcc - Four character code (pixelformat)
§Example
use v4l::{Format, FourCC};
let fmt = Format::new(640, 480, FourCC::new(b"YUYV"));

Trait Implementations§

source§

impl Clone for Format

source§

fn clone(&self) -> Format

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 Debug for Format

source§

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

Formats the value using the given formatter. Read more
source§

impl Display for Format

source§

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

Formats the value using the given formatter. Read more
source§

impl From<Format> for v4l2_pix_format

source§

fn from(format: Format) -> Self

Converts to this type from the input type.
source§

impl From<v4l2_pix_format> for Format

source§

fn from(fmt: v4l2_pix_format) -> Self

Converts to this type from the input type.
source§

impl Copy for Format

Auto Trait Implementations§

§

impl Freeze for Format

§

impl RefUnwindSafe for Format

§

impl Send for Format

§

impl Sync for Format

§

impl Unpin for Format

§

impl UnwindSafe for Format

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

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> ToOwned for T
where T: Clone,

source§

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> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

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

source§

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>,

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

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more