Enum display_utils::PixelFormat
source · pub enum PixelFormat {
Show 19 variants
Invalid,
R8G8B8A8,
Bgra32,
I420,
M420,
Nv12,
Yuy2,
Mjpeg,
Yv12,
Bgr24,
Rgb565,
Rgb332,
Rgb2220,
L8,
R8,
R8G8,
A2R10G10B10,
A2B10G10R10,
DoNotCare,
}
Expand description
Pixel format definitions that bridge different versions of sysmem / images2 formats Fuchsia uses for display and GPU drivers’ internal image type representation.
NOTE: The color-components are interpreted in memory in little-endian byte-order. E.g., PixelFormat::Bgra32 as [u8; 4] would have components [blue, green, red, alpha].
Variants§
Invalid
Equivalent to fuchsia.sysmem.PixelFormatType.Invalid and fuchsia.images2.PixelFormat.Invalid.
R8G8B8A8
RGB only, 8 bits per each of R/G/B/A sample
Equivalent to fuchsia.sysmem.PixelFormatType.R8G8B8A8 and fuchsia.images2.PixelFormat.R8G8B8A8.
Bgra32
32bpp BGRA, 1 plane. RGB only, 8 bits per each of B/G/R/A sample.
Equivalent to fuchsia.sysmem.PixelFormatType.Bgra32 and fuchsia.images2.PixelFormat.Bgra32.
I420
YUV only, 8 bits per Y sample
Equivalent to fuchsia.sysmem.PixelFormatType.I420 and fuchsia.images2.PixelFormat.I420.
M420
YUV only, 8 bits per Y sample
Equivalent to fuchsia.sysmem.PixelFormatType.M420 and fuchsia.images2.PixelFormat.M420.
Nv12
YUV only, 8 bits per Y sample
Equivalent to fuchsia.sysmem.PixelFormatType.Nv12 and fuchsia.images2.PixelFormat.Nv12.
Yuy2
YUV only, 8 bits per Y sample
Equivalent to fuchsia.sysmem.PixelFormatType.Yuy2 and fuchsia.images2.PixelFormat.Yuy2.
Mjpeg
This value is reserved, and not currently used.
Equivalent to fuchsia.sysmem.PixelFormatType.Mjpeg and fuchsia.images2.PixelFormat.Mjpeg.
Yv12
YUV only, 8 bits per Y sample
Equivalent to fuchsia.sysmem.PixelFormatType.Yv12 and fuchsia.images2.PixelFormat.Yv12.
Bgr24
24bpp BGR, 1 plane. RGB only, 8 bits per each of B/G/R sample
Equivalent to fuchsia.sysmem.PixelFormatType.Bgr24 and fuchsia.images2.PixelFormat.Bgr24.
Rgb565
16bpp RGB, 1 plane. 5 bits (most significant) R, 6 bits G, 5 bits B
Equivalent to fuchsia.sysmem.PixelFormatType.Rgb565 and fuchsia.images2.PixelFormat.Rgb565.
Rgb332
8bpp RGB, 1 plane. 3 bits (most significant) R, 3 bits G, 2 bits B
Equivalent to fuchsia.sysmem.PixelFormatType.Rgb332 and fuchsia.images2.PixelFormat.Rgb332.
Rgb2220
8bpp RGB, 1 plane. 2 bits (most significant) R, 2 bits G, 2 bits B
Equivalent to fuchsia.sysmem.PixelFormatType.Rgb2220 and fuchsia.images2.PixelFormat.Rgb2220.
L8
8bpp, Luminance-only (red, green and blue have identical values.)
Equivalent to fuchsia.sysmem.PixelFormatType.L8 and fuchsia.images2.PixelFormat.L8.
R8
8bpp, Red-only (Green and Blue are to be interpreted as 0).
Equivalent to fuchsia.sysmem.PixelFormatType.R8 and fuchsia.images2.PixelFormat.R8.
R8G8
16bpp RG, 1 plane. 8 bits R, 8 bits G.
Equivalent to fuchsia.sysmem.PixelFormatType.R8G8 and fuchsia.images2.PixelFormat.R8G8.
A2R10G10B10
32bpp RGBA, 1 plane. 2 bits A, 10 bits R/G/B.
Equivalent to fuchsia.sysmem.PixelFormatType.A2R10G10B10 and fuchsia.images2.PixelFormat.A2R10G10B10.
A2B10G10R10
32bpp BGRA, 1 plane. 2 bits A, 10 bits R/G/B.
Equivalent to fuchsia.sysmem.PixelFormatType.A2B10G10R10 and fuchsia.images2.PixelFormat.A2B10G10R10.
DoNotCare
A client is explicitly indicating that the client does not care which pixel format is chosen / used.
Equivalent to fuchsia.sysmem.PixelFormatType.DoNotCare and fuchsia.images2.PixelFormat.DoNotCare.
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 Default for PixelFormat
impl Default for PixelFormat
source§fn default() -> PixelFormat
fn default() -> PixelFormat
source§impl Display for PixelFormat
impl Display for PixelFormat
source§impl From<&PixelFormat> for PixelFormat
impl From<&PixelFormat> for PixelFormat
source§fn from(src: &PixelFormat) -> Self
fn from(src: &PixelFormat) -> Self
source§impl From<&PixelFormat> for PixelFormat
impl From<&PixelFormat> for PixelFormat
source§fn from(src: &PixelFormat) -> Self
fn from(src: &PixelFormat) -> Self
source§impl From<&PixelFormat> for PixelFormatType
impl From<&PixelFormat> for PixelFormatType
source§fn from(src: &PixelFormat) -> Self
fn from(src: &PixelFormat) -> Self
source§impl From<&PixelFormatType> for PixelFormat
impl From<&PixelFormatType> for PixelFormat
source§fn from(src: &PixelFormatType) -> Self
fn from(src: &PixelFormatType) -> Self
source§impl From<PixelFormat> for PixelFormat
impl From<PixelFormat> for PixelFormat
source§fn from(src: PixelFormat) -> Self
fn from(src: PixelFormat) -> Self
source§impl From<PixelFormat> for PixelFormat
impl From<PixelFormat> for PixelFormat
source§fn from(src: PixelFormat) -> Self
fn from(src: PixelFormat) -> Self
source§impl From<PixelFormat> for PixelFormatType
impl From<PixelFormat> for PixelFormatType
source§fn from(src: PixelFormat) -> Self
fn from(src: PixelFormat) -> Self
source§impl From<PixelFormatType> for PixelFormat
impl From<PixelFormatType> for PixelFormat
source§fn from(src: PixelFormatType) -> Self
fn from(src: PixelFormatType) -> Self
source§impl FromStr for PixelFormat
impl FromStr for PixelFormat
source§impl PartialEq for PixelFormat
impl PartialEq for PixelFormat
source§fn eq(&self, other: &PixelFormat) -> bool
fn eq(&self, other: &PixelFormat) -> bool
self
and other
values to be equal, and is used
by ==
.