ansi

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ColorPalette

type ColorPalette int

ColorPalette is the color palette used for the output

const (
	// Palette256 is 256 colors ANSI palette
	Palette256 ColorPalette = iota
	// PaletteTrueColor is True Color ANSI palette
	PaletteTrueColor
)

type Image

type Image struct {
	// contains filtered or unexported fields
}

Image converts images to colored ANSI terminal text representations

func NewImage

func NewImage(p ColorPalette, ph PixelHeight) *Image

NewImage creates new Image converter

func (*Image) Encode

func (i *Image) Encode(out io.Writer, img image.Image) error

Encode converts image to text and writes it to out

func (Image) GetFontRatio

func (i Image) GetFontRatio() float64

GetFontRatio returns the font ratio

type PixelHeight

type PixelHeight int

PixelHeight defines the vertical density fot the output

const (
	// SingleHeight uses one row per vertical pixel
	SingleHeight PixelHeight = iota
	// HalfHeight uses half row per vertical pixel
	HalfHeight
)

Jump to

Keyboard shortcuts

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