render

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const CellAspectRatio = 2.0

CellAspectRatio compensates for the fact that terminal glyphs are taller than they are wide.

Variables

This section is empty.

Functions

func FitImageToBounds

func FitImageToBounds(img image.Image, maxCols, maxRows int, cellAspect float64) (int, int)

func RenderFrame

func RenderFrame(img image.Image, width, height int, mode string) (*codec.Frame, error)

Types

type GraphicsProtocol

type GraphicsProtocol int
const (
	GraphicsProtocolNone GraphicsProtocol = iota
	GraphicsProtocolInline
)

func DetectGraphicsProtocol

func DetectGraphicsProtocol(force string) GraphicsProtocol

type InlineImageRenderer

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

func NewInlineImageRenderer

func NewInlineImageRenderer(proto GraphicsProtocol) *InlineImageRenderer

func (*InlineImageRenderer) Close

func (r *InlineImageRenderer) Close()

func (*InlineImageRenderer) Draw

func (r *InlineImageRenderer) Draw(img image.Image, cols, rows int) (int, error)

func (*InlineImageRenderer) Init

func (r *InlineImageRenderer) Init() error

type TCellRenderer

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

TCellRenderer draws frames using a simple dirty-rect strategy to avoid full clears every frame. This significantly reduces terminal I/O and helps eliminate periodic stutters.

func NewTCellRenderer

func NewTCellRenderer(screen ui.Screen, perfStats *perf.Stats) *TCellRenderer

func (*TCellRenderer) Draw

func (r *TCellRenderer) Draw(frame *codec.Frame, termCols, termRows int, border int) int

func (*TCellRenderer) Reset

func (r *TCellRenderer) Reset()

Jump to

Keyboard shortcuts

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