term

package
v0.0.2-0...-24379f4 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2022 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSize

func GetSize() (int, int, error)

Types

type Option

type Option func(t *Terminal)

Option represents a terminal option.

func Size

func Size(w, h int) Option

Size is an option to configure terminal drawing size.

type Terminal

type Terminal struct {
	// contains filtered or unexported fields
}

Terminal is a drawing canvas on system terminal.

func New

func New(opts ...Option) *Terminal

New returns a terminal instance.

func (*Terminal) Clear

func (t *Terminal) Clear()

Clear clears the existing terminal buffer. This function is not thread safe.

func (*Terminal) Draw

func (t *Terminal) Draw(src *image.RGBA)

Draw draws a given image on the terminal canvas. This draw call will resize and crop the source image to fit the target canvas.

func (*Terminal) Flush

func (t *Terminal) Flush()

Flush flushes the terminal buffer to the given io.Writer.

Jump to

Keyboard shortcuts

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