Skip to main content

PixelFormat

Enum 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

Source§

fn clone(&self) -> PixelFormat

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for PixelFormat

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

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
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
Source§

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

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T, D> Encode<Ambiguous1, D> for T
where D: ResourceDialect,

Source§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _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, D> Encode<Ambiguous2, D> for T
where D: ResourceDialect,

Source§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _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> InstanceFromServiceTransport<T> for T

§

fn from_service_transport(handle: T) -> T

Converts the given service transport handle of type T to [Self]
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.
Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

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
§

impl<E> RunsTransport<Mpsc> for E

§

impl<E> RunsTransport<Mpsc> for E
where E: RunsTransport<Mpsc>,

Source§

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

Source§

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§

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>,

Source§

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>,

Source§

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