kitty

package
v0.0.0-...-66ecaaf Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeCommand

func DecodeCommand(c *Command, b []byte) int

func Encode

func Encode(w io.Writer, image image.Image) (int, error)

Encode encodes an image to a Writer using the kitty graphics protocol.

Types

type Command

type Command struct {
	// The overall action this graphics command is performing.
	// t - transmit data
	// T - transmit data and display image
	// q - query terminal
	// p - put (display) previous transmitted image
	// d - delete image
	// f - transmit data for animation frames
	// a - control animation
	// c - compose animation frames
	Action byte

	// Suppress responses from the terminal to this graphics command.
	// 0 - do not suppress responses.
	// 1 - suppress OK responses.
	// 2 - suppress failure responses.
	Quiet byte

	// The format in which the image data is sent.
	// 24 - RGB pixel data
	// 32 - RGBA pixel data
	// 100 - PNG image data
	Format uint

	// The transmission medium used.
	// d - Direct (the data is transmitted within the escape code itself)
	// f - A simple file
	// t - A temporary file, the terminal emulator will delete the file after reading
	//     the pixel data. For security reasons the terminal emulator should only delete
	//     the file if it is in a known temporary directory, such as /tmp, /dev/shm,
	//     TMPDIR env var if present and any platform specific temporary directories.
	// s - A shared memory object, which on POSIX systems is a POSIX shared memory object
	//     and on Windows is a Named shared memory object. The terminal emulator must read
	//     the data from the memory object and then unlink and close it on POSIX and just
	//     close it on Windows.
	Medium byte

	// The width of the image being sent.
	Width uint

	// The height of the image being sent.
	Height uint

	// The size of data to read from a file.
	Size uint

	// The offset from which to read data from a file.
	Offset uint

	// The image id
	ID uint

	// The image number
	Number uint

	// The placement id
	Placement uint

	// The type of data compression.
	// 0 - no compression
	// z - RFC 1950 ZLIB based deflate compression
	Compression byte

	// Whether there is more chunked data available.
	More bool

	// Payload data.
	Payload []byte
}

func DecodeCommands

func DecodeCommands(b []byte) ([]Command, int)

Jump to

Keyboard shortcuts

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