[go: up one dir, main page]

drm-fourcc 1.3.2

Provides an enum with every valid Direct Rendering Manager (DRM) format fourcc
Documentation
Provides an enum representing every pixel format supported by DRM
(as of kernel version 5.8.0).

A [fourcc][fourcc_wiki] is four bytes of ascii representing some data format. This enum contains
every fourcc representing a pixel format supported by [DRM][drm_wiki], the Linux Direct
Rendering Manager.

To get the bytes of the fourcc representing the format, cast to `u32`.

```rust
assert_eq!(DrmFormat::Xrgb8888 as u32, 875713112);
```

To get the string form of the fourcc, use [`DrmFormat::string_form`].

```rust
assert_eq!(DrmFormat::Xrgb8888.string_form(), "XR24");
```

The enum is autogenerated from the [canonical list][canonical] in the Linux source code.

[fourcc_wiki]: https://en.wikipedia.org/wiki/FourCC
[drm_wiki]: https://en.wikipedia.org/wiki/Direct_Rendering_Managerz
[canonical]: https://github.com/torvalds/linux/blame/master/include/uapi/drm/drm_fourcc.h