[][src]Enum wayland_client::protocol::wl_shm::Format

#[repr(u32)]pub enum Format {
    Argb8888,
    Xrgb8888,
    C8,
    Rgb332,
    Bgr233,
    Xrgb4444,
    Xbgr4444,
    Rgbx4444,
    Bgrx4444,
    Argb4444,
    Abgr4444,
    Rgba4444,
    Bgra4444,
    Xrgb1555,
    Xbgr1555,
    Rgbx5551,
    Bgrx5551,
    Argb1555,
    Abgr1555,
    Rgba5551,
    Bgra5551,
    Rgb565,
    Bgr565,
    Rgb888,
    Bgr888,
    Xbgr8888,
    Rgbx8888,
    Bgrx8888,
    Abgr8888,
    Rgba8888,
    Bgra8888,
    Xrgb2101010,
    Xbgr2101010,
    Rgbx1010102,
    Bgrx1010102,
    Argb2101010,
    Abgr2101010,
    Rgba1010102,
    Bgra1010102,
    Yuyv,
    Yvyu,
    Uyvy,
    Vyuy,
    Ayuv,
    Nv12,
    Nv21,
    Nv16,
    Nv61,
    Yuv410,
    Yvu410,
    Yuv411,
    Yvu411,
    Yuv420,
    Yvu420,
    Yuv422,
    Yvu422,
    Yuv444,
    Yvu444,
    // some variants omitted
}

pixel formats

This describes the memory layout of an individual pixel.

All renderers should support argb8888 and xrgb8888 but any other formats are optional and may not be supported by the particular renderer in use.

The drm format codes match the macros defined in drm_fourcc.h. The formats actually supported by the compositor will be reported by the format event.

Variants

Argb8888

32-bit ARGB format, [31:0] A:R:G:B 8:8:8:8 little endian

Xrgb8888

32-bit RGB format, [31:0] x:R:G:B 8:8:8:8 little endian

C8

8-bit color index format, [7:0] C

Rgb332

8-bit RGB format, [7:0] R:G:B 3:3:2

Bgr233

8-bit BGR format, [7:0] B:G:R 2:3:3

Xrgb4444

16-bit xRGB format, [15:0] x:R:G:B 4:4:4:4 little endian

Xbgr4444

16-bit xBGR format, [15:0] x:B:G:R 4:4:4:4 little endian

Rgbx4444

16-bit RGBx format, [15:0] R:G:B:x 4:4:4:4 little endian

Bgrx4444

16-bit BGRx format, [15:0] B:G:R:x 4:4:4:4 little endian

Argb4444

16-bit ARGB format, [15:0] A:R:G:B 4:4:4:4 little endian

Abgr4444

16-bit ABGR format, [15:0] A:B:G:R 4:4:4:4 little endian

Rgba4444

16-bit RBGA format, [15:0] R:G:B:A 4:4:4:4 little endian

Bgra4444

16-bit BGRA format, [15:0] B:G:R:A 4:4:4:4 little endian

Xrgb1555

16-bit xRGB format, [15:0] x:R:G:B 1:5:5:5 little endian

Xbgr1555

16-bit xBGR 1555 format, [15:0] x:B:G:R 1:5:5:5 little endian

Rgbx5551

16-bit RGBx 5551 format, [15:0] R:G:B:x 5:5:5:1 little endian

Bgrx5551

16-bit BGRx 5551 format, [15:0] B:G:R:x 5:5:5:1 little endian

Argb1555

16-bit ARGB 1555 format, [15:0] A:R:G:B 1:5:5:5 little endian

Abgr1555

16-bit ABGR 1555 format, [15:0] A:B:G:R 1:5:5:5 little endian

Rgba5551

16-bit RGBA 5551 format, [15:0] R:G:B:A 5:5:5:1 little endian

Bgra5551

16-bit BGRA 5551 format, [15:0] B:G:R:A 5:5:5:1 little endian

Rgb565

16-bit RGB 565 format, [15:0] R:G:B 5:6:5 little endian

Bgr565

16-bit BGR 565 format, [15:0] B:G:R 5:6:5 little endian

Rgb888

24-bit RGB format, [23:0] R:G:B little endian

Bgr888

24-bit BGR format, [23:0] B:G:R little endian

Xbgr8888

32-bit xBGR format, [31:0] x:B:G:R 8:8:8:8 little endian

Rgbx8888

32-bit RGBx format, [31:0] R:G:B:x 8:8:8:8 little endian

Bgrx8888

32-bit BGRx format, [31:0] B:G:R:x 8:8:8:8 little endian

Abgr8888

32-bit ABGR format, [31:0] A:B:G:R 8:8:8:8 little endian

Rgba8888

32-bit RGBA format, [31:0] R:G:B:A 8:8:8:8 little endian

Bgra8888

32-bit BGRA format, [31:0] B:G:R:A 8:8:8:8 little endian

Xrgb2101010

32-bit xRGB format, [31:0] x:R:G:B 2:10:10:10 little endian

Xbgr2101010

32-bit xBGR format, [31:0] x:B:G:R 2:10:10:10 little endian

Rgbx1010102

32-bit RGBx format, [31:0] R:G:B:x 10:10:10:2 little endian

Bgrx1010102

32-bit BGRx format, [31:0] B:G:R:x 10:10:10:2 little endian

Argb2101010

32-bit ARGB format, [31:0] A:R:G:B 2:10:10:10 little endian

Abgr2101010

32-bit ABGR format, [31:0] A:B:G:R 2:10:10:10 little endian

Rgba1010102

32-bit RGBA format, [31:0] R:G:B:A 10:10:10:2 little endian

Bgra1010102

32-bit BGRA format, [31:0] B:G:R:A 10:10:10:2 little endian

Yuyv

packed YCbCr format, [31:0] Cr0:Y1:Cb0:Y0 8:8:8:8 little endian

Yvyu

packed YCbCr format, [31:0] Cb0:Y1:Cr0:Y0 8:8:8:8 little endian

Uyvy

packed YCbCr format, [31:0] Y1:Cr0:Y0:Cb0 8:8:8:8 little endian

Vyuy

packed YCbCr format, [31:0] Y1:Cb0:Y0:Cr0 8:8:8:8 little endian

Ayuv

packed AYCbCr format, [31:0] A:Y:Cb:Cr 8:8:8:8 little endian

Nv12

2 plane YCbCr Cr:Cb format, 2x2 subsampled Cr:Cb plane

Nv21

2 plane YCbCr Cb:Cr format, 2x2 subsampled Cb:Cr plane

Nv16

2 plane YCbCr Cr:Cb format, 2x1 subsampled Cr:Cb plane

Nv61

2 plane YCbCr Cb:Cr format, 2x1 subsampled Cb:Cr plane

Yuv410

3 plane YCbCr format, 4x4 subsampled Cb (1) and Cr (2) planes

Yvu410

3 plane YCbCr format, 4x4 subsampled Cr (1) and Cb (2) planes

Yuv411

3 plane YCbCr format, 4x1 subsampled Cb (1) and Cr (2) planes

Yvu411

3 plane YCbCr format, 4x1 subsampled Cr (1) and Cb (2) planes

Yuv420

3 plane YCbCr format, 2x2 subsampled Cb (1) and Cr (2) planes

Yvu420

3 plane YCbCr format, 2x2 subsampled Cr (1) and Cb (2) planes

Yuv422

3 plane YCbCr format, 2x1 subsampled Cb (1) and Cr (2) planes

Yvu422

3 plane YCbCr format, 2x1 subsampled Cr (1) and Cb (2) planes

Yuv444

3 plane YCbCr format, non-subsampled Cb (1) and Cr (2) planes

Yvu444

3 plane YCbCr format, non-subsampled Cr (1) and Cb (2) planes

Implementations

impl Format[src]

pub fn from_raw(n: u32) -> Option<Format>[src]

pub fn to_raw(&self) -> u32[src]

Trait Implementations

impl Clone for Format[src]

impl Copy for Format[src]

impl Debug for Format[src]

impl PartialEq<Format> for Format[src]

impl StructuralPartialEq for Format[src]

Auto Trait Implementations

impl RefUnwindSafe for Format

impl Send for Format

impl Sync for Format

impl Unpin for Format

impl UnwindSafe for Format

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Downcast for T where
    T: Any
[src]

impl<T> DowncastSync for T where
    T: Send + Sync + Any
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.