#drm #linux #fourcc

drm-fourcc

Provides an enum with every valid Direct Rendering Manager (DRM) format fourcc

10 stable releases

2.2.0 Sep 5, 2021
2.1.1 May 10, 2021
2.1.0 Apr 8, 2021
2.0.0 Mar 30, 2021
1.3.3 Mar 28, 2021

#24 in Unix APIs

Download history 120/week @ 2021-06-07 776/week @ 2021-06-14 4020/week @ 2021-06-21 4944/week @ 2021-06-28 4932/week @ 2021-07-05 6639/week @ 2021-07-12 7583/week @ 2021-07-19 7676/week @ 2021-07-26 6239/week @ 2021-08-02 7413/week @ 2021-08-09 7315/week @ 2021-08-16 6944/week @ 2021-08-23 6557/week @ 2021-08-30 6423/week @ 2021-09-06 6237/week @ 2021-09-13 5520/week @ 2021-09-20

23,638 downloads per month
Used in 45 crates (5 directly)

MIT license

52KB
959 lines

drm-fourcc

Crates.io MIT Licensed

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.

Features

  • std: Enable functionality that requires the standard library. Enabled by default
  • build_bindings: Build the bindings based on the headers on your machine. Should not be necessary in most cases.

Contributors

Dependencies

~0–280KB