Documentation
¶
Overview ¶
Package display reads and changes the target monitor through the operating system: its modes, its gamma table and whether it is lit. display_darwin.go and display_windows.go implement Target and the Monitor methods.
Index ¶
Constants ¶
const ( VCPBrightness byte = 0x10 VCPContrast byte = 0x12 VCPRedGain byte = 0x16 VCPGreenGain byte = 0x18 VCPBlueGain byte = 0x1A VCPInput byte = 0x60 VCPVolume byte = 0x62 VCPSharpness byte = 0x87 )
MCCS VCP codes MonitorBar uses over DDC/CI.
Variables ¶
var ErrGammaLimited = errors.New("display: the system limited the dimming")
ErrGammaLimited means the system refused the requested dimming and a milder one was applied: Windows keeps gamma ramps near the identity.
Functions ¶
func InputNameFor ¶ added in v1.4.0
InputNameFor names an input of a monitor model, with its overrides.
func ParseCapabilities ¶ added in v1.1.0
ParseCapabilities reads the vcp(...) section of an MCCS capability string, e.g. "vcp(10 12 60(0F 11 12))", into each code and its values.
Types ¶
type DDC ¶ added in v1.1.0
type DDC struct {
// contains filtered or unexported fields
}
DDC controls the monitor's own settings over the video cable. Get blocks; Set returns at once and sends only the latest value of each code, so a dragged slider doesn't queue up slow writes.
func (*DDC) Capabilities ¶ added in v1.1.0
Capabilities is the monitor's MCCS capability string, "" if unreadable.
func (*DDC) Close ¶ added in v1.1.0
func (d *DDC) Close()
Close stops the writer and releases the monitor.
type Mode ¶
type Mode struct {
Width, Height int // the size the desktop uses (points on macOS)
PixelWidth, PixelHeight int // the size drawn
RefreshRate int
// contains filtered or unexported fields
}
Mode is a resolution and refresh rate the monitor can show.
func RefreshRates ¶
RefreshRates returns the modes of the resolution of current, fastest first.
func Resolutions ¶
Resolutions returns one mode per resolution, HiDPI or not, preferring the given refresh rate, from the largest.
type Monitor ¶
type Monitor struct {
Name string // e.g. "Mi Monitor"
Connection string // e.g. "HDMI", or "" when unknown
// Native is the panel's own resolution where the system tells it
// (Windows, from the EDID), zero otherwise.
NativeWidth, NativeHeight int
// contains filtered or unexported fields
}
Monitor is the external display the app manages.
func (Monitor) NativeSize ¶
NativeSize is the monitor's own resolution: what the system reports, or the largest mode drawn 1:1, as HiDPI modes draw more pixels than the panel has. A reported size smaller than the current mode is not trusted (virtual displays of remote desktops report one): the current mode wins.