Documentation
¶
Overview ¶
Package edid reads a display's identity from its EDID: make, model and serial, as outputs are described and matched by.
Index ¶
Constants ¶
const PNPEnv = "LYS_PNP_IDS"
PNPEnv is the environment variable that points PNPPath at a PNP ID database.
Variables ¶
var ErrInvalid = errors.New("edid: invalid")
ErrInvalid is a blob that is not an EDID: too short, without the header, or with a bad base block checksum.
Functions ¶
Types ¶
type Chromaticity ¶
type Chromaticity struct {
X, Y float64
}
Chromaticity is a CIE 1931 xy coordinate.
type HDR ¶
type HDR struct {
Red, Green, Blue, White Chromaticity
ST2084, HLG bool
BT2020 bool
StaticMetadata bool
MaxLuminance float64
MaxAverageLuminance float64
MinLuminance float64
}
HDR is what an EDID says about a display's colour: the primaries of its base block, and the transfer functions, gamut and luminance of its CTA-861 extension's Colorimetry and HDR Static Metadata data blocks. Luminances are in cd/m², and zero where the display leaves them out.
func ParseHDR ¶
ParseHDR reads b's colour characteristics. A display with no CTA-861 extension, or none with the data blocks, has an HDR with only its primaries. It fails with ErrInvalid on a bad base block or a data block that overruns. An extension with a bad checksum fails too, not to promise a signal the display may not take.
type Info ¶
Info is a display's identity: its PNP manufacturer ID, its make (the manufacturer's name, or the PNP ID when unknown), its model and its serial.
func Parse ¶
Parse reads the identity from EDID b's base block. The model and serial come from the name and serial descriptors, falling back to the product code and the numeric serial in hex; a zero numeric serial leaves Serial empty. It fails with ErrInvalid.
func (Info) Description ¶
Description is make, model and serial joined by spaces, empty ones left out.