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 bgra8() -> SurfaceFormatKind
pub const fn bgra8() -> SurfaceFormatKind
BGRA8: 8-bit blue/green/red/alpha, straight alpha.
Sourcepub const fn rgba8() -> SurfaceFormatKind
pub const fn rgba8() -> SurfaceFormatKind
RGBA8: 8-bit red/green/blue/alpha, straight alpha.
Sourcepub const fn nv12() -> SurfaceFormatKind
pub const fn nv12() -> SurfaceFormatKind
NV12: 4:2:0 semi-planar, Cb then Cr — the universal decoder default.
Sourcepub const fn nv21() -> SurfaceFormatKind
pub const fn nv21() -> SurfaceFormatKind
NV21: NV12 with the chroma components the other way round.
Sourcepub const fn i420() -> SurfaceFormatKind
pub const fn i420() -> SurfaceFormatKind
I420 (YU12): 4:2:0 planar, Cb and Cr in their own planes after luma.
Sourcepub const fn yv12() -> SurfaceFormatKind
pub const fn yv12() -> SurfaceFormatKind
YV12: I420 with the two chroma planes the other way round.
Sourcepub const fn nv16() -> SurfaceFormatKind
pub const fn nv16() -> SurfaceFormatKind
NV16: 4:2:2 semi-planar, Cb then Cr.
Sourcepub const fn nv61() -> SurfaceFormatKind
pub const fn nv61() -> SurfaceFormatKind
NV61: NV16 with the chroma components the other way round.
Sourcepub const fn yu16() -> SurfaceFormatKind
pub const fn yu16() -> SurfaceFormatKind
YU16: 4:2:2 planar, Cb then Cr planes.
Sourcepub const fn yv16() -> SurfaceFormatKind
pub const fn yv16() -> SurfaceFormatKind
YV16: YU16 with the two chroma planes the other way round.
Sourcepub const fn nv24() -> SurfaceFormatKind
pub const fn nv24() -> SurfaceFormatKind
NV24: 4:4:4 semi-planar, Cb then Cr.
Sourcepub const fn yuv444() -> SurfaceFormatKind
pub const fn yuv444() -> SurfaceFormatKind
YUV444: 4:4:4 planar.
Sourcepub const fn mono8() -> SurfaceFormatKind
pub const fn mono8() -> SurfaceFormatKind
Mono: a single 8-bit luma plane and no chroma at all.
Sourcepub const fn p010() -> SurfaceFormatKind
pub const fn p010() -> SurfaceFormatKind
P010: 4:2:0 semi-planar, 10 bits in the high bits of a 16-bit word.
Sourcepub const fn p012() -> SurfaceFormatKind
pub const fn p012() -> SurfaceFormatKind
P012: 4:2:0 semi-planar, 12 bits in a 16-bit word.
Sourcepub const fn p016() -> SurfaceFormatKind
pub const fn p016() -> SurfaceFormatKind
P016: 4:2:0 semi-planar, a full 16-bit sample.
Sourcepub const fn i010() -> SurfaceFormatKind
pub const fn i010() -> SurfaceFormatKind
I010: 4:2:0 planar, 10 bits in a 16-bit word.
Sourcepub const fn i012() -> SurfaceFormatKind
pub const fn i012() -> SurfaceFormatKind
I012: 4:2:0 planar, 12 bits in a 16-bit word.
Sourcepub const fn i016() -> SurfaceFormatKind
pub const fn i016() -> SurfaceFormatKind
I016: 4:2:0 planar, a full 16-bit sample.
Sourcepub const fn p210() -> SurfaceFormatKind
pub const fn p210() -> SurfaceFormatKind
P210: 4:2:2 semi-planar, 10 bits in a 16-bit word.
Sourcepub const fn p212() -> SurfaceFormatKind
pub const fn p212() -> SurfaceFormatKind
P212: 4:2:2 semi-planar, 12 bits in a 16-bit word.
Sourcepub const fn p216() -> SurfaceFormatKind
pub const fn p216() -> SurfaceFormatKind
P216: 4:2:2 semi-planar, a full 16-bit sample.
Sourcepub const fn p410() -> SurfaceFormatKind
pub const fn p410() -> SurfaceFormatKind
P410: 4:4:4 semi-planar, 10 bits in a 16-bit word.
Sourcepub const fn p412() -> SurfaceFormatKind
pub const fn p412() -> SurfaceFormatKind
P412: 4:4:4 semi-planar, 12 bits in a 16-bit word.
Sourcepub const fn p416() -> SurfaceFormatKind
pub const fn p416() -> SurfaceFormatKind
P416: 4:4:4 semi-planar, a full 16-bit sample.
Sourcepub const fn q410() -> SurfaceFormatKind
pub const fn q410() -> SurfaceFormatKind
Q410: 4:4:4 planar, 10 bits in a 16-bit word.
Sourcepub const fn q416() -> SurfaceFormatKind
pub const fn q416() -> SurfaceFormatKind
Q416: 4:4:4 planar, a full 16-bit sample.
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
Source§fn clone(&self) -> SurfaceFormatKind
fn clone(&self) -> SurfaceFormatKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl 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<T> CustomStyleProperty for T
impl<T> CustomStyleProperty for T
Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Any so CustomStyles::get can recover the concrete type.Source§fn eq_property(&self, other: &(dyn CustomStyleProperty + 'static)) -> bool
fn eq_property(&self, other: &(dyn CustomStyleProperty + 'static)) -> bool
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more