pub struct SurfaceFormat { /* private fields */ }Expand description
Every dimension of a surface format: the full shape a GPU importer needs to sample a buffer.
Built only here — its fields are private and its constructors are private — so it is always one of
the shapes a SurfaceFormatKind admits, and a renderer reads it rather than inventing it.
Implementations§
Source§impl SurfaceFormat
impl SurfaceFormat
Sourcepub const fn model(&self) -> ColorModel
pub const fn model(&self) -> ColorModel
How the colour is modelled.
Sourcepub const fn subsampling(&self) -> Subsampling
pub const fn subsampling(&self) -> Subsampling
How much colour detail the chroma carries.
Sourcepub const fn layout(&self) -> PlaneLayout
pub const fn layout(&self) -> PlaneLayout
How the planes are arranged.
Sourcepub const fn rgb_order(&self) -> RgbOrder
pub const fn rgb_order(&self) -> RgbOrder
The order of an RGB surface’s first two components; meaningless for YCbCr.
Sourcepub const fn chroma_order(&self) -> ChromaOrder
pub const fn chroma_order(&self) -> ChromaOrder
The order of the chroma components; meaningless for RGB.
Sourcepub const fn depth(&self) -> SampleDepth
pub const fn depth(&self) -> SampleDepth
The nominal bits of a sample.
Sourcepub const fn container(&self) -> SampleContainer
pub const fn container(&self) -> SampleContainer
The word a sample is stored in.
Sourcepub const fn is_yuv(&self) -> bool
pub const fn is_yuv(&self) -> bool
Whether the colour is YCbCr, and so needs a matrix before it is RGB.
Sourcepub const fn plane_count(&self) -> usize
pub const fn plane_count(&self) -> usize
How many planes a buffer of this shape carries: one for packed and mono, two for semi-planar, three for planar.
Trait Implementations§
Source§impl Clone for SurfaceFormat
impl Clone for SurfaceFormat
impl Copy for SurfaceFormat
Source§impl Debug for SurfaceFormat
impl Debug for SurfaceFormat
impl Eq for SurfaceFormat
Source§impl PartialEq for SurfaceFormat
impl PartialEq for SurfaceFormat
impl StructuralPartialEq for SurfaceFormat
Auto Trait Implementations§
impl Freeze for SurfaceFormat
impl RefUnwindSafe for SurfaceFormat
impl Send for SurfaceFormat
impl Sync for SurfaceFormat
impl Unpin for SurfaceFormat
impl UnsafeUnpin for SurfaceFormat
impl UnwindSafe for SurfaceFormat
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
Mutably borrows from an owned value. Read more
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
Compare self to
key and return true if they are equal.