pub enum SurfaceFormatKind {
Show 27 variants
Bgra8(SurfaceFormat),
Rgba8(SurfaceFormat),
Nv12(SurfaceFormat),
Nv21(SurfaceFormat),
I420(SurfaceFormat),
Yv12(SurfaceFormat),
Nv16(SurfaceFormat),
Nv61(SurfaceFormat),
Yu16(SurfaceFormat),
Yv16(SurfaceFormat),
Nv24(SurfaceFormat),
Yuv444(SurfaceFormat),
Mono8(SurfaceFormat),
P010(SurfaceFormat),
P012(SurfaceFormat),
P016(SurfaceFormat),
I010(SurfaceFormat),
I012(SurfaceFormat),
I016(SurfaceFormat),
P210(SurfaceFormat),
P212(SurfaceFormat),
P216(SurfaceFormat),
P410(SurfaceFormat),
P412(SurfaceFormat),
P416(SurfaceFormat),
Q410(SurfaceFormat),
Q416(SurfaceFormat),
}Expand description
A format a producer emits: a choice of pre-constructed SurfaceFormats.
See the module documentation. Name one of the constants (NV12 and friends) to get
a value; match a variant to tell formats apart.
Variants§
Bgra8(SurfaceFormat)
BGRA8: 8-bit blue/green/red/alpha, straight alpha — the common desktop format.
Rgba8(SurfaceFormat)
RGBA8: 8-bit red/green/blue/alpha, straight alpha.
Nv12(SurfaceFormat)
NV12: 4:2:0 semi-planar, Cb then Cr — the universal decoder default.
Nv21(SurfaceFormat)
NV21: NV12 with the chroma components the other way round.
I420(SurfaceFormat)
I420 (YU12): 4:2:0 planar, Cb and Cr in their own planes after luma.
Yv12(SurfaceFormat)
YV12: I420 with the two chroma planes the other way round.
Nv16(SurfaceFormat)
NV16: 4:2:2 semi-planar, Cb then Cr.
Nv61(SurfaceFormat)
NV61: NV16 with the chroma components the other way round.
Yu16(SurfaceFormat)
YU16: 4:2:2 planar, Cb then Cr planes.
Yv16(SurfaceFormat)
YV16: YU16 with the two chroma planes the other way round.
Nv24(SurfaceFormat)
NV24: 4:4:4 semi-planar, Cb then Cr.
Yuv444(SurfaceFormat)
YUV444: 4:4:4 planar.
Mono8(SurfaceFormat)
Mono: a single 8-bit luma plane and no chroma at all.
P010(SurfaceFormat)
P010: 4:2:0 semi-planar, 10 bits in the high bits of a 16-bit word — HEVC Main10,
VP9 profile 2 and AV1.
P012(SurfaceFormat)
P012: 4:2:0 semi-planar, 12 bits in a 16-bit word.
P016(SurfaceFormat)
P016: 4:2:0 semi-planar, a full 16-bit sample.
I010(SurfaceFormat)
I010: 4:2:0 planar, 10 bits in a 16-bit word.
I012(SurfaceFormat)
I012: 4:2:0 planar, 12 bits in a 16-bit word.
I016(SurfaceFormat)
I016: 4:2:0 planar, a full 16-bit sample.
P210(SurfaceFormat)
P210: 4:2:2 semi-planar, 10 bits in a 16-bit word.
P212(SurfaceFormat)
P212: 4:2:2 semi-planar, 12 bits in a 16-bit word.
P216(SurfaceFormat)
P216: 4:2:2 semi-planar, a full 16-bit sample.
P410(SurfaceFormat)
P410: 4:4:4 semi-planar, 10 bits in a 16-bit word.
P412(SurfaceFormat)
P412: 4:4:4 semi-planar, 12 bits in a 16-bit word.
P416(SurfaceFormat)
P416: 4:4:4 semi-planar, a full 16-bit sample.
Q410(SurfaceFormat)
Q410: 4:4:4 planar, 10 bits in a 16-bit word.
Q416(SurfaceFormat)
Q416: 4:4:4 planar, a full 16-bit sample.
Implementations§
Source§impl SurfaceFormatKind
impl SurfaceFormatKind
Sourcepub const fn nv12() -> Self
pub const fn nv12() -> Self
NV12: 4:2:0 semi-planar, Cb then Cr — the universal decoder default.
Sourcepub const fn i420() -> Self
pub const fn i420() -> Self
I420 (YU12): 4:2:0 planar, Cb and Cr in their own planes after luma.
Sourcepub const fn p010() -> Self
pub const fn p010() -> Self
P010: 4:2:0 semi-planar, 10 bits in the high bits of a 16-bit word.
Sourcepub const fn dimensions(self) -> SurfaceFormat
pub const fn dimensions(self) -> SurfaceFormat
The pre-constructed shape this kind names.
Sourcepub const fn is_yuv(self) -> bool
pub const fn is_yuv(self) -> bool
Whether the colour is YCbCr; see SurfaceFormat::is_yuv.
Sourcepub const fn plane_count(self) -> usize
pub const fn plane_count(self) -> usize
How many planes a buffer of this kind carries; see SurfaceFormat::plane_count.
Trait Implementations§
Source§impl Clone for SurfaceFormatKind
impl Clone for SurfaceFormatKind
impl Copy for SurfaceFormatKind
Source§impl Debug for SurfaceFormatKind
impl Debug for SurfaceFormatKind
Source§impl Display for SurfaceFormatKind
impl Display for SurfaceFormatKind
impl Eq for SurfaceFormatKind
Source§impl PartialEq for SurfaceFormatKind
impl PartialEq for SurfaceFormatKind
impl StructuralPartialEq for SurfaceFormatKind
Auto Trait Implementations§
impl Freeze for SurfaceFormatKind
impl RefUnwindSafe for SurfaceFormatKind
impl Send for SurfaceFormatKind
impl Sync for SurfaceFormatKind
impl Unpin for SurfaceFormatKind
impl UnsafeUnpin for SurfaceFormatKind
impl UnwindSafe for SurfaceFormatKind
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.