Bug: 328180685

Clone this repo:
  1. e84454b Migrate 13 crates to monorepo by James Farrell · 9 weeks ago main
  2. 4f33141 Merge "Remove nputikhin@google.com from OWNERS" into main am: 9c0ffb607e by Nikita Putikhin · 4 months ago
  3. 9c0ffb6 Merge "Remove nputikhin@google.com from OWNERS" into main by Nikita Putikhin · 4 months ago
  4. bf50e0f Create patch from LICENSE file am: 18e0544189 by James Farrell · 4 months ago
  5. 18e0544 Create patch from LICENSE file by James Farrell · 4 months ago

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