fourcc

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2026 License: MIT Imports: 2 Imported by: 3 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package fourcc names DRM pixel formats and format modifiers, as shared by the kernel, GBM, EGL and linux-dmabuf.

Index

Constants

View Source
const (
	ARGB8888      Format = 'A' | 'R'<<8 | '2'<<16 | '4'<<24
	XRGB8888      Format = 'X' | 'R'<<8 | '2'<<16 | '4'<<24
	ABGR8888      Format = 'A' | 'B'<<8 | '2'<<16 | '4'<<24
	XBGR8888      Format = 'X' | 'B'<<8 | '2'<<16 | '4'<<24
	ARGB2101010   Format = 'A' | 'R'<<8 | '3'<<16 | '0'<<24
	XRGB2101010   Format = 'X' | 'R'<<8 | '3'<<16 | '0'<<24
	ABGR2101010   Format = 'A' | 'B'<<8 | '3'<<16 | '0'<<24
	XBGR2101010   Format = 'X' | 'B'<<8 | '3'<<16 | '0'<<24
	ABGR16161616F Format = 'A' | 'B'<<8 | '4'<<16 | 'H'<<24
	XBGR16161616F Format = 'X' | 'B'<<8 | '4'<<16 | 'H'<<24
	NV12          Format = 'N' | 'V'<<8 | '1'<<16 | '2'<<24
	NV21          Format = 'N' | 'V'<<8 | '2'<<16 | '1'<<24
	NV16          Format = 'N' | 'V'<<8 | '1'<<16 | '6'<<24
	NV61          Format = 'N' | 'V'<<8 | '6'<<16 | '1'<<24
	NV24          Format = 'N' | 'V'<<8 | '2'<<16 | '4'<<24
	NV42          Format = 'N' | 'V'<<8 | '4'<<16 | '2'<<24
	P010          Format = 'P' | '0'<<8 | '1'<<16 | '0'<<24
	P012          Format = 'P' | '0'<<8 | '1'<<16 | '2'<<24
	P016          Format = 'P' | '0'<<8 | '1'<<16 | '6'<<24
	P210          Format = 'P' | '2'<<8 | '1'<<16 | '0'<<24
	YUV420        Format = 'Y' | 'U'<<8 | '1'<<16 | '2'<<24
	YVU420        Format = 'Y' | 'V'<<8 | '1'<<16 | '2'<<24
	YUV422        Format = 'Y' | 'U'<<8 | '1'<<16 | '6'<<24
	YVU422        Format = 'Y' | 'V'<<8 | '1'<<16 | '6'<<24
	YUV444        Format = 'Y' | 'U'<<8 | '2'<<16 | '4'<<24
	YVU444        Format = 'Y' | 'V'<<8 | '2'<<16 | '4'<<24
	Q410          Format = 'Q' | '4'<<8 | '1'<<16 | '0'<<24
	Q401          Format = 'Q' | '4'<<8 | '0'<<16 | '1'<<24
	YUYV          Format = 'Y' | 'U'<<8 | 'Y'<<16 | 'V'<<24
	YVYU          Format = 'Y' | 'V'<<8 | 'Y'<<16 | 'U'<<24
	UYVY          Format = 'U' | 'Y'<<8 | 'V'<<16 | 'Y'<<24
	VYUY          Format = 'V' | 'Y'<<8 | 'U'<<16 | 'Y'<<24
	Y210          Format = 'Y' | '2'<<8 | '1'<<16 | '0'<<24
	Y212          Format = 'Y' | '2'<<8 | '1'<<16 | '2'<<24
	Y216          Format = 'Y' | '2'<<8 | '1'<<16 | '6'<<24
	AYUV          Format = 'A' | 'Y'<<8 | 'U'<<16 | 'V'<<24
	XYUV8888      Format = 'X' | 'Y'<<8 | 'U'<<16 | 'V'<<24
	AVUY8888      Format = 'A' | 'V'<<8 | 'U'<<16 | 'Y'<<24
	XVUY8888      Format = 'X' | 'V'<<8 | 'U'<<16 | 'Y'<<24
	Y410          Format = 'Y' | '4'<<8 | '1'<<16 | '0'<<24
	XVYU2101010   Format = 'X' | 'V'<<8 | '3'<<16 | '0'<<24
	Y412          Format = 'Y' | '4'<<8 | '1'<<16 | '2'<<24
	XVYU121616    Format = 'X' | 'V'<<8 | '3'<<16 | '6'<<24
	Y416          Format = 'Y' | '4'<<8 | '1'<<16 | '6'<<24
	XVYU16161616  Format = 'X' | 'V'<<8 | '4'<<16 | '8'<<24
	XVUY2101010   Format = 'X' | 'Y'<<8 | '3'<<16 | '0'<<24
	VUY888        Format = 'V' | 'U'<<8 | '2'<<16 | '4'<<24

	Linear  Modifier = 0
	Invalid Modifier = 0x00ffffffffffffff
)

The pixel formats lys handles, DRM_FORMAT_* by their fourcc codes, and the modifiers DRM_FORMAT_MOD_LINEAR and DRM_FORMAT_MOD_INVALID.

Variables

This section is empty.

Functions

This section is empty.

Types

type Format

type Format uint32

Format is a DRM fourcc pixel format, DRM_FORMAT_*.

func (Format) HasAlpha

func (f Format) HasAlpha() bool

HasAlpha reports whether f is one of the RGB formats named here with an alpha channel.

func (Format) Opaque

func (f Format) Opaque() Format

Opaque is f with its alpha channel replaced by padding, such as XRGB8888 for ARGB8888, or f itself when it has no alpha variant here.

func (Format) PlaneRows

func (f Format) PlaneRows(plane, height int) int

PlaneRows is how many rows plane has in a buffer of f height rows tall: height for a plane that is not subsampled, a metadata plane or a format not named here.

func (Format) Planes

func (f Format) Planes() int

Planes is how many color planes a buffer of f has, or 0 when f is not named here. A modifier may add metadata planes beyond them.

func (Format) String

func (f Format) String() string

String is f's four characters, such as "XR24", or its hex value when they are not printable.

func (Format) WithAlpha

func (f Format) WithAlpha() Format

WithAlpha is f with its padding as an alpha channel, such as ARGB8888 for XRGB8888, or f itself when it has no opaque variant here.

func (Format) YUV

func (f Format) YUV() bool

YUV reports whether f is one of the YUV formats named here.

type Modifier

type Modifier uint64

Modifier is a DRM format modifier, DRM_FORMAT_MOD_*: the buffer's tiling and compression layout.

func (Modifier) String

func (m Modifier) String() string

String is "linear", "invalid" or m's hex value.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL