drm-fourcc

Crates.iodrm-fourcc
lib.rsdrm-fourcc
version2.2.0
sourcesrc
created_at2021-03-13 22:27:01.54265
updated_at2021-09-05 17:56:19.427073
descriptionProvides an enum with every valid Direct Rendering Manager (DRM) format fourcc
homepage
repositoryhttps://github.com/danielzfranklin/drm-fourcc-rs
max_upload_size
id368523
size53,636
Victoria Brekenfeld (Drakulix)

documentation

README

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

Commit count: 52

cargo fmt