[−][src]Struct dcv_color_primitives::ImageFormat
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_format | color_space |
---|---|
PixelFormat::Argb | ColorSpace::Lrgb |
PixelFormat::Bgra | ColorSpace::Lrgb |
PixelFormat::Bgr | ColorSpace::Lrgb |
PixelFormat::Rgba | ColorSpace::Lrgb |
PixelFormat::Rgb | ColorSpace::Lrgb |
PixelFormat::I444 | ColorSpace::Bt601, ColorSpace::Bt709 |
PixelFormat::I422 | ColorSpace::Bt601, ColorSpace::Bt709 |
PixelFormat::I420 | ColorSpace::Bt601, ColorSpace::Bt709 |
PixelFormat::Nv12 | ColorSpace::Bt601, ColorSpace::Bt709 |
Some pixel formats might impose additional restrictions on the accepted number of planes and the image size:
pixel_format | subsampling | w | h | #planes | #1 | #2 | #3 |
---|---|---|---|---|---|---|---|
PixelFormat::Argb | 4:4:4 | 1 | argb:4 | ||||
PixelFormat::Bgra | 4:4:4 | 1 | bgra:4 | ||||
PixelFormat::Bgr | 4:4:4 | 1 | bgr:3 | ||||
PixelFormat::Rgba | 4:4:4 | 1 | rgba:4 | ||||
PixelFormat::Rgb | 4:4:4 | 1 | rgb:3 | ||||
PixelFormat::I444 | 4:4:4 | 1, 3 | y:1 | u:1 | v:1 | ||
PixelFormat::I422 | 4:2:2 | 2 | 1, 3 | y:1 | u:1/2 | v:1/2 | |
PixelFormat::I420 | 4:2:0 | 2 | 2 | 1, 3 | y:1 | u:1/4 | v:1/4 |
PixelFormat::Nv12 | 4:2:0 | 2 | 2 | 1, 2 | y:1 | uv: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
impl RefUnwindSafe for ImageFormat
impl Send for ImageFormat
impl Sync for ImageFormat
impl Unpin for ImageFormat
impl UnwindSafe for ImageFormat
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,