Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | - | - | ||||
patches/ | 25-Apr-2025 | - | 30 | 29 | ||
src/ | 25-Apr-2025 | - | 959 | 755 | ||
.cargo-checksum.json | D | 25-Apr-2025 | 572 | 1 | 1 | |
Android.bp | D | 25-Apr-2025 | 1.2 KiB | 54 | 49 | |
Cargo.toml | D | 25-Apr-2025 | 1.1 KiB | 39 | 35 | |
LICENSE | D | 25-Apr-2025 | 1,023 | 24 | 21 | |
METADATA | D | 25-Apr-2025 | 426 | 18 | 17 | |
MODULE_LICENSE_MIT | D | 25-Apr-2025 | 0 | |||
README.md | D | 25-Apr-2025 | 1.5 KiB | 49 | 33 | |
TEST_MAPPING | D | 25-Apr-2025 | 78 | 8 | 7 | |
build.rs | D | 25-Apr-2025 | 8.8 KiB | 264 | 207 | |
cargo_embargo.json | D | 25-Apr-2025 | 42 | 5 | 4 |
README.md
1# drm-fourcc 2 3[](https://crates.io/crates/drm-fourcc) 4 5 6Provides an enums representing every pixel format and format modifier supported 7by DRM (as of kernel version 5.10.0). 8 9A [fourcc][fourcc_wiki] is four bytes of ascii representing some data format. This enum contains 10every fourcc representing a pixel format supported by [DRM][drm_wiki], the Linux Direct 11Rendering Manager. 12 13To get the bytes of the fourcc representing the format, cast to `u32`. 14 15```rust 16assert_eq!(DrmFourcc::Xrgb8888 as u32, 875713112); 17``` 18 19To get the string form of the fourcc, use [`DrmFourcc::string_form`]. 20 21```rust 22assert_eq!(DrmFourcc::Xrgb8888.string_form(), "XR24"); 23``` 24 25We also provide a type for representing a fourcc/modifier pair 26 27```rust 28let format = DrmFormat { 29 code: DrmFourcc::Xrgb8888, 30 modifier: DrmModifier::Linear, 31}; 32``` 33 34The enums are autogenerated from the [canonical list][canonical] in the Linux source code. 35 36## Features 37 38- `std`: Enable functionality that requires the standard library. Enabled by default 39- `build_bindings`: Build the bindings based on the headers on your machine. Should not be necessary in most cases. 40 41## Contributors 42 43- [Daniel Franklin](https://github.com/danielzfranklin) 44- [Victor Brekenfeld](https://github.com/Drakulix) 45 46[fourcc_wiki]: https://en.wikipedia.org/wiki/FourCC 47[drm_wiki]: https://en.wikipedia.org/wiki/Direct_Rendering_Managerz 48[canonical]: https://github.com/torvalds/linux/blame/master/include/uapi/drm/drm_fourcc.h 49