pub struct PixelFormat(/* private fields */);
Expand description
A FourCC code identifying a pixel format.
Implementations§
Source§impl PixelFormat
impl PixelFormat
Sourcepub const NV12: Self
pub const NV12: Self
Planar YUV 4:2:0 standard pixel format.
All samples are 8 bits in size. The plane containing Y samples comes first, followed by a plane storing packed U and V samples (with U samples in the first byte and V samples in the second byte).
This format is widely supported by hardware codecs (and often the only supported format), so it should be supported by all software, and may be used as the default format.
Sourcepub const YUY2: Self
pub const YUY2: Self
Interleaved YUV 4:2:2, stored in memory as yyyyyyyy uuuuuuuu YYYYYYYY vvvvvvvv
.
uuuuuuuu
and vvvvvvvv
are shared by 2 horizontally neighboring pixels.
Also known as YUYV
.
Sourcepub const UYVY: Self
pub const UYVY: Self
Interleaved YUV 4:2:2, stored in memory as uuuuuuuu yyyyyyyy vvvvvvvv YYYYYYYY
.
uuuuuuuu
and vvvvvvvv
are shared by 2 neighboring pixels.
Sourcepub const RGBA: Self
pub const RGBA: Self
RGBA
: Packed 8-bit RGBA, stored in memory as aaaaaaaa bbbbbbbb gggggggg rrrrrrrr
.
Sourcepub const ARGB: Self
pub const ARGB: Self
ARGB
: Packed 8-bit RGBA, stored in memory as bbbbbbbb gggggggg rrrrrrrr aaaaaaaa
.
pub const fn from_bytes(fourcc: [u8; 4]) -> Self
pub const fn from_u32_le(fourcc: u32) -> Self
pub const fn to_bytes(self) -> [u8; 4]
pub const fn to_u32_le(self) -> u32
Sourcepub fn to_rtformat(self) -> Option<RTFormat>
pub fn to_rtformat(self) -> Option<RTFormat>
Returns a surface RTFormat
compatible with this PixelFormat
.
Returns None
when self
is an unknown or unhandled PixelFormat
.
Trait Implementations§
Source§impl Clone for PixelFormat
impl Clone for PixelFormat
Source§fn clone(&self) -> PixelFormat
fn clone(&self) -> PixelFormat
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more