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§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere 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> ToString for Twhere 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 Twhere 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 Twhere 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.