pub enum DmaBufFormat {
Bgra8,
Bgrx8,
Rgba8,
Rgbx8,
}Expand description
Pixel format of a DMA-BUF frame.
Only the single-plane packed 32-bit formats are covered, which is what browser and compositor output uses.
Variants§
Bgra8
Little-endian BGRA with meaningful alpha.
Bgrx8
Little-endian BGRX; consumers must force alpha to one.
Rgba8
Little-endian RGBA with meaningful alpha.
Rgbx8
Little-endian RGBX; consumers must force alpha to one.
Implementations§
Source§impl DmaBufFormat
impl DmaBufFormat
Sourcepub fn from_fourcc(value: u32) -> Self
pub fn from_fourcc(value: u32) -> Self
Maps a DRM fourcc code onto the format it names.
§Panics
Panics for any code outside the four packed 32-bit formats above.
Sourcepub const fn texture_format(self) -> TextureFormat
pub const fn texture_format(self) -> TextureFormat
The wgpu format an imported texture of this format carries.
The X variants have no alpha of their own but still occupy the
channel, so they import as their A counterpart; see
Self::force_opaque.
Sourcepub const fn force_opaque(self) -> bool
pub const fn force_opaque(self) -> bool
Whether a consumer must ignore the imported alpha channel and treat the frame as opaque.
Trait Implementations§
Source§impl Clone for DmaBufFormat
impl Clone for DmaBufFormat
impl Copy for DmaBufFormat
Source§impl Debug for DmaBufFormat
impl Debug for DmaBufFormat
impl Eq for DmaBufFormat
Source§impl PartialEq for DmaBufFormat
impl PartialEq for DmaBufFormat
impl StructuralPartialEq for DmaBufFormat
Auto Trait Implementations§
impl Freeze for DmaBufFormat
impl RefUnwindSafe for DmaBufFormat
impl Send for DmaBufFormat
impl Sync for DmaBufFormat
impl Unpin for DmaBufFormat
impl UnsafeUnpin for DmaBufFormat
impl UnwindSafe for DmaBufFormat
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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.