Documentation
¶
Overview ¶
Package gfx shows pixel images over terminal cells through the graphics protocol a terminal is verified to draw
Index ¶
- func Placeholder(c *uv.Cell) bool
- func Sweep()
- type Packet
- type Protocol
- type Stats
- type Surface
- func (s *Surface) Budget(cols, rows int) (w, h int)
- func (s *Surface) Emit(p *Packet, x, y int, now time.Time) string
- func (s *Surface) Encoded(seq []byte, cols, rows int) *Packet
- func (s *Surface) Pack(rgb []byte, w, h, cols, rows int) *Packet
- func (s *Surface) Paint(buf *uv.Buffer, x, y, cols, rows int, bg color.Color)
- func (s *Surface) Protocol() Protocol
- func (s *Surface) Ready(now time.Time) bool
- func (s *Surface) Release() string
- func (s *Surface) SetRate(fps int)
- func (s *Surface) Stats() Stats
- type Terminal
- func (t *Terminal) Cell() (w, h int)
- func (t *Terminal) Describe() string
- func (t *Terminal) Draws(p Protocol) bool
- func (t *Terminal) Guess() Protocol
- func (t *Terminal) Measure() tea.Cmd
- func (t *Terminal) Measured() bool
- func (t *Terminal) NewSurface(p Protocol) *Surface
- func (t *Terminal) Probe() tea.Cmd
- func (t *Terminal) Program() string
- func (t *Terminal) Protocol() Protocol
- func (t *Terminal) Tmux() bool
- func (t *Terminal) Update(msg tea.Msg) bool
- func (t *Terminal) Wrap(seq string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Placeholder ¶
Reports whether a cell is a kitty placeholder, which keeps its colors as they name the image
Types ¶
type Stats ¶
type Stats struct {
Latency time.Duration
Divisor float64
Frames int
Acked int
Timeouts int
Failed int
}
Numbers for a status line
type Surface ¶
type Surface struct {
// contains filtered or unexported fields
}
Image shown over a box of cells, frame after frame, by one protocol
func (*Surface) Budget ¶
Pixels across and down the next frame should be rendered at for a box of cols by rows cells
func (*Surface) Emit ¶
Escape text that shows a packet with the top left cell of its box at screen cell x, y
func (*Surface) Encoded ¶
Packet of a sixel or iTerm2 sequence encoded elsewhere, drawn from the top left cell of a box of cells
func (*Surface) Pack ¶
Packs a frame of three byte pixels for a box of cells, nil without a protocol or whole pixels
func (*Surface) Release ¶
Escape text that removes every image of the surface from the terminal, and forgets the inflight state
type Terminal ¶
type Terminal struct {
// contains filtered or unexported fields
}
Terminal as named by the environment and as it answered the probe
func (*Terminal) Guess ¶
Best protocol worth trying when the person forces images, the verified one else iTerm2 where it is plausible
func (*Terminal) Measured ¶
Reports whether the cell size came from the terminal rather than the assumption
func (*Terminal) NewSurface ¶
Surface drawing through the given protocol, which must be one the terminal returned from Protocol or Guess