#[repr(u32)]pub enum PixelFormatType {
Show 19 variants
Invalid = 0,
R8G8B8A8 = 1,
Bgra32 = 101,
I420 = 102,
M420 = 103,
Nv12 = 104,
Yuy2 = 105,
Mjpeg = 106,
Yv12 = 107,
Bgr24 = 108,
Rgb565 = 109,
Rgb332 = 110,
Rgb2220 = 111,
L8 = 112,
R8 = 113,
R8G8 = 114,
A2R10G10B10 = 115,
A2B10G10R10 = 116,
DoNotCare = 4_294_967_294,
}
Expand description
The ordering of the channels in the format name reflects how the actual layout of the channel.
Each of these values is opinionated re. the color spaces that can be contained within (in contrast with Vulkan).
This should be kept in sync with fuchsia.sysmem2.PixelFormatType.
This type is deprecated for new code, but is still used by some camera code.
Variants§
Invalid = 0
R8G8B8A8 = 1
RGB only, 8 bits per each of R/G/B/A sample Compatible with VK_FORMAT_R8G8B8A8_UNORM.
Bgra32 = 101
32bpp BGRA, 1 plane. RGB only, 8 bits per each of B/G/R/A sample. Compatible with VK_FORMAT_B8G8R8A8_UNORM.
I420 = 102
YUV only, 8 bits per Y sample Compatible with VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM.
M420 = 103
YUV only, 8 bits per Y sample Not compatible with any vulkan format.
Nv12 = 104
YUV only, 8 bits per Y sample Compatible with VK_FORMAT_G8_B8R8_2PLANE_420_UNORM.
Yuy2 = 105
YUV only, 8 bits per Y sample Compatible with VK_FORMAT_G8B8G8R8_422_UNORM.
Mjpeg = 106
Yv12 = 107
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
.
Bgr24 = 108
24bpp BGR, 1 plane. RGB only, 8 bits per each of B/G/R sample Compatible with VK_FORMAT_B8G8R8_UNORM.
Rgb565 = 109
16bpp RGB, 1 plane. 5 bits R, 6 bits G, 5 bits B Compatible with VK_FORMAT_R5G6B5_UNORM_PACK16.
Rgb332 = 110
8bpp RGB, 1 plane. 3 bits R, 3 bits G, 2 bits B Not compatible with any vulkan format.
Rgb2220 = 111
8bpp RGB, 1 plane. 2 bits R, 2 bits G, 2 bits B Not compatible with any vulkan format.
L8 = 112
8bpp, Luminance-only (red, green and blue have identical values.) Compatible with VK_FORMAT_R8_UNORM.
R8 = 113
8bpp, Red-only (Green and Blue are to be interpreted as 0). Compatible with VK_FORMAT_R8_UNORM.
R8G8 = 114
16bpp RG, 1 plane. 8 bits R, 8 bits G. Compatible with VK_FORMAT_R8G8_UNORM.
A2R10G10B10 = 115
32bpp RGBA, 1 plane. 2 bits A, 10 bits R/G/B. Compatible with VK_FORMAT_A2R10G10B10_UNORM_PACK32.
A2B10G10R10 = 116
32bpp BGRA, 1 plane. 2 bits A, 10 bits R/G/B. Compatible with VK_FORMAT_A2B10G10R10_UNORM_PACK32.
DoNotCare = 4_294_967_294
The sysmem client is explicitly indicating that the sysmem client does not care which pixel format is chosen / used. When setting this value, the sysmem client must not set format_modifier_value.
Implementations§
Source§impl PixelFormatType
impl PixelFormatType
pub fn from_primitive(prim: u32) -> Option<Self>
pub const fn into_primitive(self) -> u32
pub fn is_unknown(&self) -> bool
is_unknown
Trait Implementations§
Source§impl Clone for PixelFormatType
impl Clone for PixelFormatType
Source§fn clone(&self) -> PixelFormatType
fn clone(&self) -> PixelFormatType
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for PixelFormatType
impl Debug for PixelFormatType
Source§impl<D: ResourceDialect> Decode<PixelFormatType, D> for PixelFormatType
impl<D: ResourceDialect> Decode<PixelFormatType, D> for PixelFormatType
Source§impl<D: ResourceDialect> Encode<PixelFormatType, D> for PixelFormatType
impl<D: ResourceDialect> Encode<PixelFormatType, D> for PixelFormatType
Source§impl Hash for PixelFormatType
impl Hash for PixelFormatType
Source§impl Ord for PixelFormatType
impl Ord for PixelFormatType
Source§fn cmp(&self, other: &PixelFormatType) -> Ordering
fn cmp(&self, other: &PixelFormatType) -> 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 PixelFormatType
impl PartialEq for PixelFormatType
Source§impl PartialOrd for PixelFormatType
impl PartialOrd for PixelFormatType
Source§impl TypeMarker for PixelFormatType
impl TypeMarker for PixelFormatType
Source§type Owned = PixelFormatType
type Owned = PixelFormatType
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 PixelFormatType
impl ValueTypeMarker for PixelFormatType
Source§type Borrowed<'a> = PixelFormatType
type Borrowed<'a> = PixelFormatType
Encode<Self>
type cheaply obtainable from &Self::Owned
. There are three cases: Read moreimpl Copy for PixelFormatType
impl Eq for PixelFormatType
impl StructuralPartialEq for PixelFormatType
Auto Trait Implementations§
impl Freeze for PixelFormatType
impl RefUnwindSafe for PixelFormatType
impl Send for PixelFormatType
impl Sync for PixelFormatType
impl Unpin for PixelFormatType
impl UnwindSafe for PixelFormatType
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
)