[][src]Struct dcv_color_primitives::ImageFormat

#[repr(C)]
pub struct ImageFormat {
    pub pixel_format: PixelFormat,
    pub color_space: ColorSpace,
    pub num_planes: u32,
}

Describes how the image data is laid out in memory and its color space.

Note

Not all combinations of pixel format, color space and number of planes describe a valid image format.

Each pixel format has one or more compatible color spaces:

pixel_formatcolor_space
PixelFormat::ArgbColorSpace::Lrgb
PixelFormat::BgraColorSpace::Lrgb
PixelFormat::BgrColorSpace::Lrgb
PixelFormat::RgbaColorSpace::Lrgb
PixelFormat::RgbColorSpace::Lrgb
PixelFormat::I444ColorSpace::Bt601, ColorSpace::Bt709
PixelFormat::I422ColorSpace::Bt601, ColorSpace::Bt709
PixelFormat::I420ColorSpace::Bt601, ColorSpace::Bt709
PixelFormat::Nv12ColorSpace::Bt601, ColorSpace::Bt709

Some pixel formats might impose additional restrictions on the accepted number of planes and the image size:

pixel_formatsubsamplingwh#planes#1#2#3
PixelFormat::Argb4:4:41argb:4
PixelFormat::Bgra4:4:41bgra:4
PixelFormat::Bgr4:4:41bgr:3
PixelFormat::Rgba4:4:41rgba:4
PixelFormat::Rgb4:4:41rgb:3
PixelFormat::I4444:4:41, 3y:1u:1v:1
PixelFormat::I4224:2:221, 3y:1u:1/2v:1/2
PixelFormat::I4204:2:0221, 3y:1u:1/4v:1/4
PixelFormat::Nv124:2:0221, 2y:1uv:1/2

The values reported in columns w and h, when specified, indicate that the described image should have width and height that are multiples of the specified values

Fields

pixel_format: PixelFormat

Pixel format

color_space: ColorSpace

Color space

num_planes: u32

Number of planes

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.