commit | 326de7966ecbf56844dec39733f5b9da6aade499 | [log] [tgz] |
---|---|---|
author | James Farrell <[email protected]> | Wed Aug 07 23:23:58 2024 +0000 |
committer | Automerger Merge Worker <[email protected]> | Wed Aug 07 23:23:58 2024 +0000 |
tree | e421e9052c86833a62600407fa9e849ae2183898 | |
parent | 99cb733b6332720b9e9c5ba26050ecda43bd8fa6 [diff] | |
parent | bf50e0fd975c69373d9e24198052819141a95ff1 [diff] |
Create patch from LICENSE file am: 18e0544189 am: bf50e0fd97 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/drm-fourcc/+/3212035 Change-Id: Ibf6c26afd44e96eea9483930808a3930d2175cd9 Signed-off-by: Automerger Merge Worker <[email protected]>
Provides an enums representing every pixel format and format modifier supported by DRM (as of kernel version 5.10.0).
A fourcc is four bytes of ascii representing some data format. This enum contains every fourcc representing a pixel format supported by DRM, the Linux Direct Rendering Manager.
To get the bytes of the fourcc representing the format, cast to u32
.
assert_eq!(DrmFourcc::Xrgb8888 as u32, 875713112);
To get the string form of the fourcc, use [DrmFourcc::string_form
].
assert_eq!(DrmFourcc::Xrgb8888.string_form(), "XR24");
We also provide a type for representing a fourcc/modifier pair
let format = DrmFormat { code: DrmFourcc::Xrgb8888, modifier: DrmModifier::Linear, };
The enums are autogenerated from the canonical list in the Linux source code.
std
: Enable functionality that requires the standard library. Enabled by defaultbuild_bindings
: Build the bindings based on the headers on your machine. Should not be necessary in most cases.