toascii

package module
v0.0.0-...-eb9c448 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

README

to-ascii

Documentation

Index

Constants

View Source
const (
	BOLD              = 1
	FAINT             = 2 // Not widely supported
	ITALIC            = 3 // Not widely supported
	UNDERLINE         = 4
	SLOW_BLINK        = 5
	FAST_BLINK        = 6 // Not widely supported
	REVERSE_VIDEO     = 7 // Switches background and foreground colors
	CONCEAL           = 8 // Not widely supported
	STRIKETHROUGH     = 9 // Not widely supported
	DEFAULT_FONT      = 10
	ALT_FONT1         = 11
	ALT_FONT2         = 12
	ALT_FONT3         = 13
	ALT_FONT4         = 14
	ALT_FONT5         = 15
	ALT_FONT6         = 16
	ALT_FONT7         = 17
	ALT_FONT8         = 18
	ALT_FONT9         = 19
	FRAKTUR           = 20 // Almost never supported
	DOUBLE_UNDERLINE  = 21 // Almost never supported(same as BOLD_OFF)
	BOLD_OFF          = 21 // Not widely supported(same as DOUBLE_UNDERLINE)
	NORMAL_INTENSITY  = 22 // Default intensity(between BOLD and FAINT)
	NO_ITALIC_FRAKTUR = 23
	UNDERLINE_OFF     = 24 // Turns off UNDERLINE and DOUBLE_UNDERLINE
	BLINK_OFF         = 25
	INVERSE_OFF       = 27
	REVEAL            = 28 // CONCEAL off
	STRIKETHROUGH_OFF = 29
	FRAMED            = 51
	ENCIRCLED         = 52
	OVERLINED         = 53
	NO_FRAME_ENCIRCLE = 54 // Turns off FRAMED and ENCIRCLED
	NO_OVERLINED      = 55

	COLOR_BLACK   = 30
	COLOR_RED     = 31
	COLOR_GREEN   = 32
	COLOR_YELLOW  = 33
	COLOR_BLUE    = 34
	COLOR_MAGENTA = 35
	COLOR_CYAN    = 36
	COLOR_WHITE   = 37
	DEFAULT_COLOR = 39
)

Variables

View Source
var RESET = createANSIString([]int{0})

Functions

func Convert

func Convert(imageFile io.Reader, config ConvertConfig) string

func Resize

func Resize(src image.Image, outputWidth int, outputHeight int, scaler draw.Interpolator) image.Image

Types

type ANSIString

type ANSIString string

func CreateColor

func CreateColor(text_color int, background_color int, bright_text bool, bright_background bool) ANSIString

type ConvertConfig

type ConvertConfig struct {
	OutputWidth  int
	OutputHeight int
	Scaler       draw.Interpolator
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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