Deprecated: use gitlab.freedesktop.org/emersion/go-kdf

package pixman

import "git.sr.ht/~emersion/go-kdf/pixman"

Index

Variables

var (
	// 128bpp formats
	Format_rgba_float = newFormatByte(128, FormatTypeRGBA_FLOAT, 32, 32, 32, 32)

	// 96bpp formats
	Format_rgb_float = newFormatByte(96, FormatTypeRGBA_FLOAT, 0, 32, 32, 32)

	// 32bpp formats
	Format_a8r8g8b8    = newFormat(32, FormatTypeARGB, 8, 8, 8, 8)
	Format_x8r8g8b8    = newFormat(32, FormatTypeARGB, 0, 8, 8, 8)
	Format_a8b8g8r8    = newFormat(32, FormatTypeABGR, 8, 8, 8, 8)
	Format_x8b8g8r8    = newFormat(32, FormatTypeABGR, 0, 8, 8, 8)
	Format_b8g8r8a8    = newFormat(32, FormatTypeBGRA, 8, 8, 8, 8)
	Format_b8g8r8x8    = newFormat(32, FormatTypeBGRA, 0, 8, 8, 8)
	Format_r8g8b8a8    = newFormat(32, FormatTypeRGBA, 8, 8, 8, 8)
	Format_r8g8b8x8    = newFormat(32, FormatTypeRGBA, 0, 8, 8, 8)
	Format_x14r6g6b6   = newFormat(32, FormatTypeARGB, 0, 6, 6, 6)
	Format_x2r10g10b10 = newFormat(32, FormatTypeARGB, 0, 10, 10, 10)
	Format_a2r10g10b10 = newFormat(32, FormatTypeARGB, 2, 10, 10, 10)
	Format_x2b10g10r10 = newFormat(32, FormatTypeABGR, 0, 10, 10, 10)
	Format_a2b10g10r10 = newFormat(32, FormatTypeABGR, 2, 10, 10, 10)

	// sRGB formats
	Format_a8r8g8b8_sRGB = newFormat(32, FormatTypeARGB_SRGB, 8, 8, 8, 8)

	// 24bpp formats
	Format_r8g8b8 = newFormat(24, FormatTypeARGB, 0, 8, 8, 8)
	Format_b8g8r8 = newFormat(24, FormatTypeABGR, 0, 8, 8, 8)

	// 16bpp formats
	Format_r5g6b5 = newFormat(16, FormatTypeARGB, 0, 5, 6, 5)
	Format_b5g6r5 = newFormat(16, FormatTypeABGR, 0, 5, 6, 5)

	Format_a1r5g5b5 = newFormat(16, FormatTypeARGB, 1, 5, 5, 5)
	Format_x1r5g5b5 = newFormat(16, FormatTypeARGB, 0, 5, 5, 5)
	Format_a1b5g5r5 = newFormat(16, FormatTypeABGR, 1, 5, 5, 5)
	Format_x1b5g5r5 = newFormat(16, FormatTypeABGR, 0, 5, 5, 5)
	Format_a4r4g4b4 = newFormat(16, FormatTypeARGB, 4, 4, 4, 4)
	Format_x4r4g4b4 = newFormat(16, FormatTypeARGB, 0, 4, 4, 4)
	Format_a4b4g4r4 = newFormat(16, FormatTypeABGR, 4, 4, 4, 4)
	Format_x4b4g4r4 = newFormat(16, FormatTypeABGR, 0, 4, 4, 4)

	// 8bpp formats
	Format_a8       = newFormat(8, FormatTypeA, 8, 0, 0, 0)
	Format_r3g3b2   = newFormat(8, FormatTypeARGB, 0, 3, 3, 2)
	Format_b2g3r3   = newFormat(8, FormatTypeABGR, 0, 3, 3, 2)
	Format_a2r2g2b2 = newFormat(8, FormatTypeARGB, 2, 2, 2, 2)
	Format_a2b2g2r2 = newFormat(8, FormatTypeABGR, 2, 2, 2, 2)

	Format_c8 = newFormat(8, FormatTypeColor, 0, 0, 0, 0)
	Format_g8 = newFormat(8, FormatTypeGray, 0, 0, 0, 0)

	Format_x4a4 = newFormat(8, FormatTypeA, 4, 0, 0, 0)

	Format_x4c4 = newFormat(8, FormatTypeColor, 0, 0, 0, 0)
	Format_x4g4 = newFormat(8, FormatTypeGray, 0, 0, 0, 0)

	// 4bpp formats
	Format_a4       = newFormat(4, FormatTypeA, 4, 0, 0, 0)
	Format_r1g2b1   = newFormat(4, FormatTypeARGB, 0, 1, 2, 1)
	Format_b1g2r1   = newFormat(4, FormatTypeABGR, 0, 1, 2, 1)
	Format_a1r1g1b1 = newFormat(4, FormatTypeARGB, 1, 1, 1, 1)
	Format_a1b1g1r1 = newFormat(4, FormatTypeABGR, 1, 1, 1, 1)

	Format_c4 = newFormat(4, FormatTypeColor, 0, 0, 0, 0)
	Format_g4 = newFormat(4, FormatTypeGray, 0, 0, 0, 0)

	// 1bpp formats
	Format_a1 = newFormat(1, FormatTypeA, 1, 0, 0, 0)

	Format_g1 = newFormat(1, FormatTypeGray, 0, 0, 0, 0)

	// YUV formats
	Format_yuy2 = newFormat(16, FormatTypeYUY2, 0, 0, 0, 0)
	Format_yv12 = newFormat(12, FormatTypeYV12, 0, 0, 0, 0)
)
var FormatTable map[string]Format = formatTable

Functions

func GetDescriptor

func GetDescriptor(fmt Format, endianness kdf.Endianness) *kdf.Descriptor

Types

type Format

type Format uint32

Format is a Pixman format.

func (Format) String

func (fmt Format) String() string

func (Format) Type

func (fmt Format) Type() FormatType

type FormatType

type FormatType uint8

FormatType is a Pixman format type.

Same as PIXMAN_TYPE_* macros. The maximum value is 0x3F.

const (
	FormatTypeOther      FormatType = 0
	FormatTypeA          FormatType = 1
	FormatTypeARGB       FormatType = 2
	FormatTypeABGR       FormatType = 3
	FormatTypeColor      FormatType = 4
	FormatTypeGray       FormatType = 5
	FormatTypeYUY2       FormatType = 6
	FormatTypeYV12       FormatType = 7
	FormatTypeBGRA       FormatType = 8
	FormatTypeRGBA       FormatType = 9
	FormatTypeARGB_SRGB  FormatType = 10
	FormatTypeRGBA_FLOAT FormatType = 11
)

Source Files

formats.go pixman.go

Version
v0.0.0-20240521102637-b6d8ec684be0 (latest)
Published
May 21, 2024
Platform
linux/amd64
Imports
3 packages
Last checked
3 weeks ago

Tools for package owners.