Method EncodeKitty
EncodeKitty(Color[,], int, int, int?)
Encodes the provided pixel array into a Kitty graphics protocol APC sequence string
that, when written to the terminal, renders the image at the current cursor position
occupying destCols columns and destRows rows.
public string EncodeKitty(Color[,] pixels, int destCols, int destRows, int? imageId = null)
Parameters
pixelsColor[,]The pixel array to encode, indexed as
[x, y]where the first dimension is width and the second is height.destColsintThe number of terminal columns the image should occupy.
destRowsintThe number of terminal rows the image should occupy.
imageIdint?An optional stable image identifier (the Kitty
ikey). When supplied, placements can be deleted and replaced by id via EncodeDeletePlacements(int), which is required to erase a previous placement when the image is resized or moved. Use GetImageId(string) to derive a stable id from a string. When null the terminal assigns its own id and the placement cannot be targeted for deletion.
Returns
- string
The complete Kitty APC escape sequence string.