color

package
v0.0.0-...-fede9f9 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChromaSamplePosition

type ChromaSamplePosition byte
const (
	ChromaSamplePositionUnspecified ChromaSamplePosition = iota
	ChromaSamplePositionLeft
	ChromaSamplePositionCenter
	ChromaSamplePositionTopLeft
	ChromaSamplePositionTop
	ChromaSamplePositionBottomLeft
	ChromaSamplePositionBottom
	ChromaSamplePositionNB
)

type ChromaSampling

type ChromaSampling struct {
	// J horizontal sampling reference (width of the conceptual region). Usually, 4.
	J byte
	// A number of chrominance samples (Cb, Cr) in the first row of J pixels.
	A byte
	// B number of changes of chrominance samples (Cb, Cr) between first and second row of J pixels. Note that B has to be either zero or equal to A
	B byte
}

ChromaSampling The subsampling scheme is commonly expressed as a three-part ratio J : A : B (e.g. 4:2:2), that describe the number of luminance and chrominance samples in a conceptual region that is J pixels wide and 2 pixels high.

func (ChromaSampling) ElementChromaSamples

func (s ChromaSampling) ElementChromaSamples() int

func (ChromaSampling) ElementPixels

func (s ChromaSampling) ElementPixels() int

ElementPixels returns the number of pixels for a full element

func (ChromaSampling) ElementSamples

func (s ChromaSampling) ElementSamples() int

ElementSamples returns the number of actual samples (total Y, Cb, Cr) for an encoded element

func (ChromaSampling) PlaneCbSamples

func (s ChromaSampling) PlaneCbSamples(width, height int) int

func (ChromaSampling) PlaneCrSamples

func (s ChromaSampling) PlaneCrSamples(width, height int) int

func (ChromaSampling) PlaneLumaSamples

func (s ChromaSampling) PlaneLumaSamples(width, height int) int

type MatrixCoefficients

type MatrixCoefficients int
const (
	MatrixBT709 MatrixCoefficients = iota
	MatrixBT601
	MatrixBT2020NCL
	MatrixBT2020CL
	MatrixSMPTE285
)

type Primary

type Primary int
const (
	PrimaryBT709 Primary = iota
	PrimaryBT601
	PrimaryBT2020
	PrimarySMPTE240
	PrimarySMPTE431
	PrimarySMPTE432
)

type Space

type Space struct {
	ChromaSampling       ChromaSampling
	ChromaSamplePosition ChromaSamplePosition
	BitDepth             byte
}
var (
	Space420    Space = newColorFormatFromStringInternal("420")
	Space422    Space = newColorFormatFromStringInternal("422")
	Space444    Space = newColorFormatFromStringInternal("444")
	Space420P10 Space = newColorFormatFromStringInternal("420p10")
	Space422P10 Space = newColorFormatFromStringInternal("422p10")
	Space444P10 Space = newColorFormatFromStringInternal("444p10")
	Space420P12 Space = newColorFormatFromStringInternal("420p12")
	Space422P12 Space = newColorFormatFromStringInternal("422p12")
	Space444P12 Space = newColorFormatFromStringInternal("444p12")
	Space420P16 Space = newColorFormatFromStringInternal("420p16")
	Space422P16 Space = newColorFormatFromStringInternal("422p16")
	Space444P16 Space = newColorFormatFromStringInternal("444p16")
)

func MustColorFormatFromString

func MustColorFormatFromString(colorFormat string) Space

func NewColorFormatFromString

func NewColorFormatFromString(colorFormat string) (Space, error)

func (Space) FrameSize

func (c Space) FrameSize(width, height int) (int, error)

func (Space) FrameSizePacked

func (c Space) FrameSizePacked(width, height int) (int, error)

func (Space) MarshalJSON

func (c Space) MarshalJSON() ([]byte, error)

func (Space) String

func (c Space) String() string

func (*Space) UnmarshalJSON

func (c *Space) UnmarshalJSON(buf []byte) error

func (*Space) UnmarshalYAML

func (c *Space) UnmarshalYAML(node *yaml.Node) error

type Transfer

type Transfer int
const (
	TransferBT709 Transfer = iota
	TransferBT601
	TransferLINEAR
	TransferSRGB
	TransferBT2020_10bit
	TransferBT2020_12bit
	TransferSMPTE240
	TransferSMPTE431
	TransferSMPTE432
)

Jump to

Keyboard shortcuts

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