image

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasTransmitted

func HasTransmitted(id string, cols, rows int) bool

HasTransmitted checks if the image with the given ID has already been transmitted to the terminal.

func ResetCache

func ResetCache()

ResetCache clears the image cache, freeing all cached decoded images.

Types

type CellSize

type CellSize struct {
	Width, Height int
}

CellSize represents the size of a single terminal cell in pixels.

type Encoding

type Encoding byte

Encoding represents the encoding format of the image.

const (
	EncodingBlocks Encoding = iota
	EncodingKitty
)

Image encodings.

func (Encoding) Render

func (e Encoding) Render(id string, cols, rows int) string

Render renders the given image within the specified dimensions using the specified encoding.

func (Encoding) Transmit

func (e Encoding) Transmit(id string, img image.Image, cs CellSize, cols, rows int, tmux bool) tea.Cmd

Transmit transmits the image data to the terminal if needed. This is used to cache the image on the terminal for later rendering.

type TransmittedMsg

type TransmittedMsg struct {
	ID string
}

TransmittedMsg is a message indicating that an image has been transmitted to the terminal.

Jump to

Keyboard shortcuts

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