Documentation
¶
Index ¶
- func ITermImageSupported() bool
- func KittySupported() bool
- func SixelSupported() bool
- type CellGrid
- func (grid *CellGrid) Fprint(w io.Writer, code int)
- func (grid *CellGrid) FprintHalfBlock(w io.Writer, topR, topG, topB, botR, botG, botB uint32)
- func (grid *CellGrid) FprintTrueColor(w io.Writer, r, g, b uint32)
- func (grid *CellGrid) Render(w io.Writer, img image.Image) error
- func (grid *CellGrid) SetScale(scale float64) error
- type ITerm
- type Kitty
- type Renderer
- type Sixel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func KittySupported ¶ added in v1.1.0
func KittySupported() bool
KittySupported checks if the terminal supports Kitty Graphics Protocol. Supported terminals: Kitty, WezTerm, Ghostty
Types ¶
type CellGrid ¶
type CellGrid struct {
// Border is a border printer.
Border border.Border
// Colorpicker is an algorithm to pickup colors.
Colorpicker color.Picker
// Row of cell grid, the terminal height by default if the image is portrait.
Row uint16
// Col of cell grid, the terminal width by default if the image is landscape.
Col uint16
// Placeholder is a text printed in the cell, " " by default,
// ignored in debug mode because color number will be printed instead.
Placeholder string
// Debug given, print available color tables
// and print calculated color number inside the cell.
// Debug is exclusive property, any other properties might be ignored.
Debug bool
// HalfBlock enables half-block character mode for 2x vertical resolution.
// Uses "▀" character with foreground (top) and background (bottom) colors.
HalfBlock bool
// TrueColor enables 24-bit RGB colors instead of 256-color palette.
TrueColor bool
}
CellGrid ...
func (*CellGrid) FprintHalfBlock ¶ added in v1.1.0
FprintHalfBlock prints a half-block character with top (foreground) and bottom (background) colors. This effectively renders 2 vertical pixels per terminal cell.
func (*CellGrid) FprintTrueColor ¶ added in v1.1.0
FprintTrueColor prints a cell with 24-bit RGB background.
type ITerm ¶
type ITerm struct {
// Scale size
Scale float64
}
ITerm renderer to support image printing on iTerm. See https://www.iterm2.com/documentation-images.html
type Kitty ¶ added in v1.1.0
type Kitty struct {
// Scale size
Scale float64
}
Kitty renderer to support image printing using Kitty Graphics Protocol. See https://sw.kovidgoyal.net/kitty/graphics-protocol/
type Renderer ¶
Renderer interface.
func GetDefaultRenderer ¶
func GetDefaultRenderer() Renderer
GetDefaultRenderer provides an applicable renderer for current platform.