Skip to main content

SurfaceFormatKind

Enum SurfaceFormatKind 

Source
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

Source

pub const fn bgra8() -> SurfaceFormatKind

BGRA8: 8-bit blue/green/red/alpha, straight alpha.

Source

pub const fn rgba8() -> SurfaceFormatKind

RGBA8: 8-bit red/green/blue/alpha, straight alpha.

Source

pub const fn nv12() -> SurfaceFormatKind

NV12: 4:2:0 semi-planar, Cb then Cr — the universal decoder default.

Source

pub const fn nv21() -> SurfaceFormatKind

NV21: NV12 with the chroma components the other way round.

Source

pub const fn i420() -> SurfaceFormatKind

I420 (YU12): 4:2:0 planar, Cb and Cr in their own planes after luma.

Source

pub const fn yv12() -> SurfaceFormatKind

YV12: I420 with the two chroma planes the other way round.

Source

pub const fn nv16() -> SurfaceFormatKind

NV16: 4:2:2 semi-planar, Cb then Cr.

Source

pub const fn nv61() -> SurfaceFormatKind

NV61: NV16 with the chroma components the other way round.

Source

pub const fn yu16() -> SurfaceFormatKind

YU16: 4:2:2 planar, Cb then Cr planes.

Source

pub const fn yv16() -> SurfaceFormatKind

YV16: YU16 with the two chroma planes the other way round.

Source

pub const fn nv24() -> SurfaceFormatKind

NV24: 4:4:4 semi-planar, Cb then Cr.

Source

pub const fn yuv444() -> SurfaceFormatKind

YUV444: 4:4:4 planar.

Source

pub const fn mono8() -> SurfaceFormatKind

Mono: a single 8-bit luma plane and no chroma at all.

Source

pub const fn p010() -> SurfaceFormatKind

P010: 4:2:0 semi-planar, 10 bits in the high bits of a 16-bit word.

Source

pub const fn p012() -> SurfaceFormatKind

P012: 4:2:0 semi-planar, 12 bits in a 16-bit word.

Source

pub const fn p016() -> SurfaceFormatKind

P016: 4:2:0 semi-planar, a full 16-bit sample.

Source

pub const fn i010() -> SurfaceFormatKind

I010: 4:2:0 planar, 10 bits in a 16-bit word.

Source

pub const fn i012() -> SurfaceFormatKind

I012: 4:2:0 planar, 12 bits in a 16-bit word.

Source

pub const fn i016() -> SurfaceFormatKind

I016: 4:2:0 planar, a full 16-bit sample.

Source

pub const fn p210() -> SurfaceFormatKind

P210: 4:2:2 semi-planar, 10 bits in a 16-bit word.

Source

pub const fn p212() -> SurfaceFormatKind

P212: 4:2:2 semi-planar, 12 bits in a 16-bit word.

Source

pub const fn p216() -> SurfaceFormatKind

P216: 4:2:2 semi-planar, a full 16-bit sample.

Source

pub const fn p410() -> SurfaceFormatKind

P410: 4:4:4 semi-planar, 10 bits in a 16-bit word.

Source

pub const fn p412() -> SurfaceFormatKind

P412: 4:4:4 semi-planar, 12 bits in a 16-bit word.

Source

pub const fn p416() -> SurfaceFormatKind

P416: 4:4:4 semi-planar, a full 16-bit sample.

Source

pub const fn q410() -> SurfaceFormatKind

Q410: 4:4:4 planar, 10 bits in a 16-bit word.

Source

pub const fn q416() -> SurfaceFormatKind

Q416: 4:4:4 planar, a full 16-bit sample.

Source

pub const fn dimensions(self) -> SurfaceFormat

The pre-constructed shape this kind names.

Source

pub const fn is_yuv(self) -> bool

Whether the colour is YCbCr; see SurfaceFormat::is_yuv.

Source

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

Source§

fn clone(&self) -> SurfaceFormatKind

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for SurfaceFormatKind

Source§

impl Debug for SurfaceFormatKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Display for SurfaceFormatKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

The format’s conventional name, for diagnostics — a dropped surface says which format it was.

Source§

impl Eq for SurfaceFormatKind

Source§

impl PartialEq for SurfaceFormatKind

Source§

fn eq(&self, other: &SurfaceFormatKind) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for SurfaceFormatKind

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> CustomStyleProperty for T
where T: 'static + Send + Sync + PartialEq,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Upcasts to Any so CustomStyles::get can recover the concrete type.
Source§

fn eq_property(&self, other: &(dyn CustomStyleProperty + 'static)) -> bool

Compares two properties that share a concrete type.
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &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> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

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> ToSmolStr for T
where T: Display + ?Sized,

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more