Package-Level Type Names (total 4, all are exported)
/* sort exporteds by: | */
Decoder is a decoder for the Kitty graphics protocol. It supports decoding
images in the 24-bit [RGB], 32-bit [RGBA], and [PNG] formats. It can also
decompress data using zlib.
The default format is 32-bit [RGBA]. Uses zlib decompression. Can be one of [RGB], [RGBA], or [PNG]. Height of the image in pixels. This can be omitted if the image is [PNG]
formatted. Width of the image in pixels. This can be omitted if the image is [PNG]
formatted. Decode decodes the image data from r in the specified format. decodeRGBA decodes the image data in 32-bit RGBA or 24-bit RGB formats.
Encoder is an encoder for the Kitty graphics protocol. It supports encoding
images in the 24-bit [RGB], 32-bit [RGBA], and [PNG] formats, and
compressing the data using zlib.
The default format is 32-bit [RGBA]. Uses zlib compression. Can be one of [RGBA], [RGB], or [PNG]. Encode encodes the image data in the specified format and writes it to w.
Options represents a Kitty Graphics Protocol options. Action (a=t) is the action to be performed on the image. Can be one of
[Transmit], [TransmitDisplay], [Query], [Put], [Delete], [Frame],
[Animate], [Compose]. Chunk (m=) whether the image is transmitted in chunks. Can be either
zero or one. When true, the image is transmitted in chunks. Each chunk
must be a multiple of 4, and up to [MaxChunkSize] bytes. Each chunk must
have the m=1 option except for the last chunk which must have m=0. ChunkFormatter is the function used to format each chunk when
[Options.Chunk] is true. If nil, the chunks are sent as is. Columns (c=0) is the number of columns to display the image. The image
will be scaled to fit the number of columns. Compression (o=) is the image compression type. Can be [Zlib] or zero. Delete (d=a) is the delete action. Can be one of [DeleteAll],
[DeleteID], [DeleteNumber], [DeleteCursor], [DeleteFrames],
[DeleteCell], [DeleteCellZ], [DeleteRange], [DeleteColumn], [DeleteRow],
[DeleteZ]. DeleteResources indicates whether to delete the resources associated
with the image. DoNotMoveCursor (C=0) whether to move the cursor after displaying the
image. File is the file path to be used when the transmission type is [File].
If [Options.Transmission] is omitted i.e. zero and this is non-empty,
the transmission type is set to [File]. Format (f=32) is the image format. One of [RGBA], [RGB], [PNG]. Height (h=0) is the height of the image to display. ID (i=) is the image ID. The ID is a unique identifier for the image.
Must be a positive integer up to [math.MaxUint32]. ImageHeight (v=0) is the transmitted image height. ImageWidth (s=0) is the transmitted image width. Number (I=0) is the number of images to be transmitted. Offset (O=0) is the offset byte to start reading from the transmission
medium. OffsetX (X=0) is the OffsetX coordinate of the cursor cell to start
displaying the image. OffsetX=0 is the leftmost cell. This must be
smaller than the terminal cell width. OffsetY (Y=0) is the OffsetY coordinate of the cursor cell to start
displaying the image. OffsetY=0 is the topmost cell. This must be
smaller than the terminal cell height. ParentID (P=0) is the parent image ID. The parent ID is the ID of the
image that is the parent of the current image. This is used with Unicode
[Placeholder] to display images relative to the parent image. ParentPlacementID (Q=0) is the parent placement ID. The parent placement
ID is the ID of the placement of the parent image. This is used with
Unicode [Placeholder] to display images relative to the parent image. PlacementID (p=) is the placement ID. The placement ID is a unique
identifier for the placement of the image. Must be a positive integer up
to [math.MaxUint32]. Quiet mode (q=0) is the quiet mode. Can be either zero, one, or two
where zero is the default, 1 suppresses OK responses, and 2 suppresses
both OK and error responses. Quite is the kitty graphics quiet mode.
Deprecated: misspelled field, use [Options.Quiet] instead. Any non-zero
Quite overrides Quiet. Rows (r=0) is the number of rows to display the image. The image will be
scaled to fit the number of rows. Size (S=0) is the size to be read from the transmission medium. Transmission (t=d) is the image transmission type. Can be [Direct], [File],
[TempFile], or[SharedMemory]. VirtualPlacement (U=0) whether to use virtual placement. This is used
with Unicode [Placeholder] to display images. Width (w=0) is the width of the image to display. X (x=0) is the pixel X coordinate of the image to start displaying. Y (y=0) is the pixel Y coordinate of the image to start displaying. Z (z=0) is the Z coordinate of the image to display. MarshalText returns the string representation of the options. Options returns the options as a slice of a key-value pairs. String returns the string representation of the options. UnmarshalText parses the options from the given string.
Options : encoding.TextMarshaler
*Options : encoding.TextUnmarshaler
Options : expvar.Var
Options : fmt.Stringer
Options : context.stringer
Options : os/signal.stringer
Options : runtime.stringer
func EncodeGraphics(w io.Writer, m image.Image, o *Options) error
func buildChunkOptions(o *Options, isFirstChunk, isLastChunk bool) []string
Stringish is a type constraint for types that are either a string or a
byte slice.
Package-Level Functions (total 3, in which 2 are exported)
Diacritic returns the diacritic rune at the specified index. If the index is
out of bounds, the first diacritic rune is returned.
EncodeGraphics writes an image using the Kitty Graphics protocol with the
given options to w. It chunks the written data if o.Chunk is true.
You can omit m and use nil when rendering an image from a file. In this
case, you must provide a file path in o.File and use o.Transmission =
[File]. You can also use o.Transmission = [TempFile] to write
the image to a temporary file. In that case, the file path is ignored, and
the image is written to a temporary file that is automatically deleted by
the terminal.
See https://sw.kovidgoyal.net/kitty/graphics-protocol/
buildChunkOptions creates the options slice for a chunk.
Package-Level Variables (total 4, in which 3 are exported)
ErrMissingFile is returned when the file path is missing.
GraphicsTempDir is the directory where temporary files are stored.
This is used in [WriteKittyGraphics] along with [os.CreateTemp].
GraphicsTempPattern is the pattern used to create temporary files.
This is used in [WriteKittyGraphics] along with [os.CreateTemp].
The Kitty Graphics protocol requires the file path to contain the
substring "tty-graphics-protocol".
From https://sw.kovidgoyal.net/kitty/_downloads/f0a0de9ec8d9ff4456206db8e0814937/rowcolumn-diacritics.txt
See https://sw.kovidgoyal.net/kitty/graphics-protocol/#unicode-placeholders for further explanation.
Package-Level Constants (total 29, all are exported)
Animate controls animation.
Compose composes animation frames.
Delete image.
Delete all placements visible on screen.
Delete all placements that intersect a specific cell, the cell is
specified using the x and y keys.
Delete all placements that intersect a specific cell having a specific
z-index. The cell and z-index is specified using the x, y and z keys.
Delete all placements that intersect the specified column, specified using
the x key.
Delete all placements that intersect with the current cursor position.
Delete animation frames.
Delete all images with the specified id, specified using the i key. If
you specify a p key for the placement id as well, then only the
placement with the specified image id and placement id will be deleted.
Delete newest image with the specified number, specified using the I
key. If you specify a p key for the placement id as well, then only the
placement with the specified number and placement id will be deleted.
Delete all images whose id is greater than or equal to the value of the x
key and less than or equal to the value of the y.
Delete all placements that intersect the specified row, specified using
the y key.
Delete all placements that have the specified z-index, specified using the
z key.
The data transmitted directly in the escape sequence.
The data transmitted in a regular file.
Frame transmits data for animation frames.
MaxChunkSize is the maximum chunk size for the image data.
Placeholder is a special Unicode character that can be used as a placeholder
for an image.
PNG format.
Put (display) previously transmitted image.
Query terminal for image info.
24-bit RGB format.
32-bit RGBA format.
A shared memory object.
For POSIX see https://pubs.opengroup.org/onlinepubs/9699919799/functions/shm_open.html
For Windows see https://docs.microsoft.com/en-us/windows/win32/memory/creating-named-shared-memory
A temporary file is used and deleted after transmission.
Transmit image data.
TransmitAndPut transmit image data and display (put) it.
Compression types.
The pages are generated with Goldsv0.8.7. (GOOS=linux GOARCH=amd64)