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

source§

fn clone(&self) -> PixelFormat

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PixelFormat

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for PixelFormat

source§

fn default() -> PixelFormat

Returns the “default value” for a type. Read more
source§

impl Display for PixelFormat

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<&PixelFormat> for PixelFormat

source§

fn from(src: &PixelFormat) -> Self

Converts to this type from the input type.
source§

impl From<&PixelFormat> for PixelFormat

source§

fn from(src: &PixelFormat) -> Self

Converts to this type from the input type.
source§

impl From<&PixelFormat> for PixelFormatType

source§

fn from(src: &PixelFormat) -> Self

Converts to this type from the input type.
source§

impl From<&PixelFormatType> for PixelFormat

source§

fn from(src: &PixelFormatType) -> Self

Converts to this type from the input type.
source§

impl From<PixelFormat> for PixelFormat

source§

fn from(src: PixelFormat) -> Self

Converts to this type from the input type.
source§

impl From<PixelFormat> for PixelFormat

source§

fn from(src: PixelFormat) -> Self

Converts to this type from the input type.
source§

impl From<PixelFormat> for PixelFormatType

source§

fn from(src: PixelFormat) -> Self

Converts to this type from the input type.
source§

impl From<PixelFormatType> for PixelFormat

source§

fn from(src: PixelFormatType) -> Self

Converts to this type from the input type.
source§

impl FromStr for PixelFormat

§

type Err = ParsePixelFormatError

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl PartialEq for PixelFormat

source§

fn eq(&self, other: &PixelFormat) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for PixelFormat

source§

impl StructuralPartialEq for PixelFormat

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Encode<Ambiguous1> for T

§

unsafe fn encode( self, _encoder: &mut Encoder<'_>, _offset: usize, _depth: Depth ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
§

impl<T> Encode<Ambiguous2> for T

§

unsafe fn encode( self, _encoder: &mut Encoder<'_>, _offset: usize, _depth: Depth ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> IntoAny for T
where T: 'static + Send + Sync,

§

fn into_any(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Cast the given object into a dyn std::any::Any.
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more