Documentation
¶
Overview ¶
Package splashframe is the boot splash's frame as both sides of the hand-over to the greeter compute it: the grid every splash state sits on, the logo and where it goes, and the record of the splash's last frame that the greeter reproduces as its first.
Index ¶
- Constants
- func FormatColor(c render.Color) string
- func LysLogo(frame image.Point, scale int) image.Rectangle
- func OpticalOrigin(frame, size image.Point) image.Point
- func ParseColor(s string) (render.Color, error)
- func RasterizeLogo(scale int, c render.Color) (*render.Icon, error)
- func SaveLastFrame(path string, f LastFrame) error
- func Space(r tokens.Rem, scale int) int
- type BGRT
- type Grid
- type LastFrame
- type Logo
- type Mark
- type Output
- type Picture
Constants ¶
const ( // LogoPx is the side of the lys logo. LogoPx = 112 // IndicatorPx is the side of the throbber and of the lock over a // prompt. IndicatorPx = 40 // EntryPx is the width of the prompt's field and of the progress bar. EntryPx = 320 )
The fixed sizes of the grid at scale 1, in pixels.
const BGRTDir = "/sys/firmware/acpi/bgrt"
BGRTDir is where Linux exposes the ACPI BGRT table.
const LastFramePath = "/run/lys-splash/last-frame.json"
LastFramePath is where a splash that hands its screen over records its last frame, for as long as it runs.
Variables ¶
This section is empty.
Functions ¶
func LysLogo ¶
LysLogo is where the lys logo goes on a frame at scale: at the optical centre when the status group fits below it there, otherwise centred with the group as one block, so a short frame holds every row.
func OpticalOrigin ¶
OpticalOrigin is the top left corner of a box of size centred across a frame and at the golden ratio of its height, as plymouth places a logo.
func ParseColor ¶
ParseColor reads an opaque #rrggbb color.
func RasterizeLogo ¶
RasterizeLogo draws the lys logo for a frame at scale, its shape in c: milliseconds of work, so a frame loop asks for it ahead of the frame that shows it.
func SaveLastFrame ¶
SaveLastFrame records f at path, replacing what was there whole.
Types ¶
type BGRT ¶
BGRT is the logo the firmware left on screen: its image and where the firmware drew it, in the firmware's own pixels.
func LoadBGRT ¶
LoadBGRT reads the firmware's logo from dir. A machine without a BGRT table, or one whose status says the logo is no longer on screen, has none: nil and no error.
type Grid ¶
type Grid struct {
Scale int
// Logo is the logo's box; Group holds every row below it.
Logo, Group image.Rectangle
// Busy is the indicator's row and Throb the square in its middle that
// the throbber and the lock fill.
Busy, Throb image.Rectangle
// Title, Secondary and Notice are the text rows.
Title, Secondary, Notice image.Rectangle
// Field is the prompt's row and Entry the field in its middle.
Field, Entry image.Rectangle
// Hints is the row under the field.
Hints image.Rectangle
}
Grid is where everything on a splash frame goes, in device pixels: the logo, and below it the status group of fixed rows that every state fills, so moving between states never moves anything.
func Layout ¶
Layout is the grid of a frame at scale with the logo in the box logo: the status group starts below it. LysLogo leaves room for the group; a logo the firmware placed may not, and the group then moves up, never over the logo, and when that is not enough closes the gaps between its rows.
type LastFrame ¶
type LastFrame struct {
Background render.Color
Logo Logo
LogoColor render.Color
ReducedMotion bool
Outputs []Output
}
LastFrame is the splash's last frame as the greeter reproduces it: the background and logo of its Picture on every output, the colour the lys logo is drawn in, and whether the splash's theme asked for cuts instead of fades.
func LoadLastFrame ¶
LoadLastFrame reads the record at path; with no splash handing over there is none, and the error is fs.ErrNotExist.
func ParseLastFrame ¶
ParseLastFrame reads a record Encode wrote: every field present and valid, and at least one output.
type Mark ¶
Mark is a logo raster and the box it fills, in device pixels.