pub enum PixelFormat {
Show 23 variants
Invalid,
R8G8B8A8,
R8G8B8X8,
B8G8R8A8,
B8G8R8X8,
I420,
M420,
Nv12,
Yuy2,
Mjpeg,
Yv12,
B8G8R8,
R5G6B5,
R3G3B2,
R2G2B2X2,
L8,
R8,
R8G8,
A2R10G10B10,
A2B10G10R10,
P010,
R8G8B8,
DoNotCare,
// some variants omitted
}
Expand description
Expresses the manner in which video pixels are encoded.
The ordering of the channels in the format name reflects the actual layout of the channel.
Each of these values is opinionated re. the color spaces that should be contained within (in contrast with Vulkan).
Variants§
Invalid
R8G8B8A8
RGB only, 8 bits per each of R/G/B/A sample
If A is actually X (not set to meaningful values), that can be specified by settting [‘fuchsia.sysemm2.ImageFormatConstraints.is_alpha_present’] to false.
If A is known to be set to meaningful values, that can be specified by setting [‘fuchsia.sysemm2.ImageFormatConstraints.is_alpha_present’] to true.
Compatible with VK_FORMAT_R8G8B8A8_UNORM.
R8G8B8X8
RGB only, 8 bits per each of R/G/B/X sample
Compatible with VK_FORMAT_R8G8B8A8_UNORM, when treated as opaque.
Deprecated. Use R8G8B8A8
with
[‘fuchsia.sysemm2.ImageFormatConstraints.is_alpha_present’] set to false
instead.
B8G8R8A8
32bpp BGRA, 1 plane. RGB only, 8 bits per each of B/G/R/A sample.
Compatible with VK_FORMAT_B8G8R8A8_UNORM.
If A is actually X (not set to meaningful values), that can be specified by settting [‘fuchsia.sysemm2.ImageFormatConstraints.is_alpha_present’] to false.
If A is known to be set to meaningful values, that can be specified by setting [‘fuchsia.sysemm2.ImageFormatConstraints.is_alpha_present’] to true.
In sysmem(1), this is BGRA32.
B8G8R8X8
32bpp BGRA, 1 plane. RGB only, 8 bits per each of B/G/R/X sample.
Compatible with VK_FORMAT_B8G8R8A8_UNORM, when treated as opaque.
Deprecated. Use B8G8R8A8
with
[fuchsia.sysemm2/ImageFormatConstraints.is_alpha_present
] set to false
instead.
I420
YUV only, 8 bits per Y sample
Compatible with VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM.
M420
YUV only, 8 bits per Y sample
Not compatible with any vulkan format.
Nv12
YUV only, 8 bits per Y sample
Compatible with VK_FORMAT_G8_B8R8_2PLANE_420_UNORM.
Yuy2
YUV only, 8 bits per Y sample
Compatible with VK_FORMAT_G8B8G8R8_422_UNORM.
Mjpeg
This value is reserved, and not currently used.
Yv12
YUV only, 8 bits per Y sample
Compatible with VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM. The U plane may be located in either
the B or R plane for the image (and likewise for the V plane); the ordering may be
determined by looking at the members of
VkBufferCollectionPropertiesFUCHSIA.samplerYcbcrConversionComponents
.
B8G8R8
24bpp BGR, 1 plane. RGB only, 8 bits per each of B/G/R sample
Compatible with VK_FORMAT_B8G8R8_UNORM.
In sysmem(1), this is BGR24.
R5G6B5
16bpp RGB, 1 plane. 5 bits R, 6 bits G, 5 bits B
Compatible with VK_FORMAT_R5G6B5_UNORM_PACK16.
In sysmem(1), this is RGB565.
R3G3B2
8bpp RGB, 1 plane. 3 bits R, 3 bits G, 2 bits B
Not compatible with any vulkan format.
In sysmem(1), this is RGB332.
R2G2B2X2
8bpp RGB, 1 plane. 2 bits R, 2 bits G, 2 bits B
Not compatible with any vulkan format.
If X is actually X (not set to meaningful values), that can be specified by settting [‘fuchsia.sysemm2.ImageFormatConstraints.is_alpha_present’] to false.
If X is known to be set to meaningful values, that can be specified by setting [‘fuchsia.sysemm2.ImageFormatConstraints.is_alpha_present’] to true.
In sysmem(1), this is RGB2220.
L8
8bpp, Luminance-only (red, green and blue have identical values.)
Compatible with VK_FORMAT_R8_UNORM.
Most clients will prefer to use R8 instead.
R8
8bpp, Red-only (Green and Blue are to be interpreted as 0).
Compatible with VK_FORMAT_R8_UNORM.
R8G8
16bpp RG, 1 plane. 8 bits R, 8 bits G.
Compatible with VK_FORMAT_R8G8_UNORM.
A2R10G10B10
32bpp RGBA, 1 plane. 2 bits A, 10 bits R/G/B.
If A is actually X (not set to meaningful values), that can be specified by settting [‘fuchsia.sysemm2.ImageFormatConstraints.is_alpha_present’] to false.
If A is known to be set to meaningful values, that can be specified by setting [‘fuchsia.sysemm2.ImageFormatConstraints.is_alpha_present’] to true.
Compatible with VK_FORMAT_A2R10G10B10_UNORM_PACK32.
A2B10G10R10
32bpp BGRA, 1 plane. 2 bits A, 10 bits R/G/B.
If A is actually X (not set to meaningful values), that can be specified by settting [‘fuchsia.sysemm2.ImageFormatConstraints.is_alpha_present’] to false.
If A is known to be set to meaningful values, that can be specified by setting [‘fuchsia.sysemm2.ImageFormatConstraints.is_alpha_present’] to true.
Compatible with VK_FORMAT_A2B10G10R10_UNORM_PACK32.
P010
YUV only, 16 bits per Y sample
This is like NV12 but with 16 bit samples that have the bottom 6 bits of each sample set to zero and/or ignored. The endianess of each 16 bit sample is host endian-ness (LE on LE system, BE on BE system). The CbCr plane has 16 bit Cb first, then 16 bit Cr, interleaved Cb Cr Cb Cr etc.
Compatible with VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16.
R8G8B8
24bpp RGB, 1 plane. RGB only, 8 bits per each of R/G/B sample
Compatible with VK_FORMAT_R8G8B8_UNORM.
DoNotCare
A client is explicitly indicating that the client does not care which
pixel format is chosen / used. When setting this value, the client must
not set pixel_format_modifier
.
Implementations§
Source§impl PixelFormat
impl PixelFormat
pub fn from_primitive(prim: u32) -> Option<Self>
pub fn from_primitive_allow_unknown(prim: u32) -> Self
pub fn unknown() -> Self
pub const fn into_primitive(self) -> u32
pub fn is_unknown(&self) -> bool
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 moreSource§impl Debug for PixelFormat
impl Debug for PixelFormat
Source§impl<D: ResourceDialect> Decode<PixelFormat, D> for PixelFormat
impl<D: ResourceDialect> Decode<PixelFormat, D> for PixelFormat
Source§impl<D: ResourceDialect> Encode<PixelFormat, D> for PixelFormat
impl<D: ResourceDialect> Encode<PixelFormat, D> for PixelFormat
Source§impl Hash for PixelFormat
impl Hash for PixelFormat
Source§impl Ord for PixelFormat
impl Ord for PixelFormat
Source§fn cmp(&self, other: &PixelFormat) -> Ordering
fn cmp(&self, other: &PixelFormat) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for PixelFormat
impl PartialEq for PixelFormat
Source§impl PartialOrd for PixelFormat
impl PartialOrd for PixelFormat
Source§impl TypeMarker for PixelFormat
impl TypeMarker for PixelFormat
Source§type Owned = PixelFormat
type Owned = PixelFormat
Source§fn inline_align(_context: Context) -> usize
fn inline_align(_context: Context) -> usize
Source§fn inline_size(_context: Context) -> usize
fn inline_size(_context: Context) -> usize
inline_align
.Source§fn encode_is_copy() -> bool
fn encode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and encoding requires no validation. When true, we can optimize
encoding arrays and vectors of Self::Owned
to a single memcpy. Read moreSource§fn decode_is_copy() -> bool
fn decode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and decoding requires no validation. When true, we can optimize
decoding arrays and vectors of Self::Owned
to a single memcpy.Source§impl ValueTypeMarker for PixelFormat
impl ValueTypeMarker for PixelFormat
Source§type Borrowed<'a> = PixelFormat
type Borrowed<'a> = PixelFormat
Encode<Self>
type cheaply obtainable from &Self::Owned
. There are three cases: Read moreimpl Copy for PixelFormat
impl Eq for PixelFormat
impl StructuralPartialEq for PixelFormat
Auto Trait Implementations§
impl Freeze for PixelFormat
impl RefUnwindSafe for PixelFormat
impl Send for PixelFormat
impl Sync for PixelFormat
impl Unpin for PixelFormat
impl UnwindSafe for PixelFormat
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)