Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CellSize ¶ added in v0.0.14
CellSize returns the size in pixels of a character cell of the controlling terminal. It asks the terminal for the cell size (XTWINOPS 16) and, if that is not answered, divides the text area size in pixels (XTWINOPS 14) by the size in characters (XTWINOPS 18).
func IsSupported ¶ added in v0.0.13
func IsSupported() bool
IsSupported reports whether the controlling terminal can render sixel graphics. It sends a Primary Device Attributes query (DA1, ESC [ c) to the terminal and checks whether the reply advertises sixel support (attribute 4). It returns false when there is no terminal or the terminal does not reply in time.
Types ¶
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
Decoder decode sixel format into image
type Encoder ¶
type Encoder struct {
// Dither, if true, will dither the image when generating a paletted version
// using the Floyd–Steinberg dithering algorithm.
Dither bool
// Width is the maximum width to draw to.
Width int
// Height is the maximum height to draw to.
Height int
// Colors sets the number of colors for the encoder to quantize if needed.
// If the value is below 2 (e.g. the zero value), then 256 is used.
// A color is always reserved for alpha, so 2 colors give you 1 color.
Colors int
// Transparent, if true, leaves the existing screen content visible
// behind pixels with zero alpha (DECSIXEL P2=1). By default they are
// painted in the terminal's background color (P2=0).
Transparent bool
// Palette, if non-nil, is used for quantization instead of computing an
// adaptive palette for every image. The nearest-color lookup table is
// built once and cached across Encode calls, which makes encoding many
// similar images (e.g. video frames) much faster. It may hold at most
// 255 colors (one register is reserved for transparency) and takes
// precedence over Colors.
Palette color.Palette
// contains filtered or unexported fields
}
Encoder encode image to sixel format
