Documentation ¶
Index ¶
Constants ¶
const ( CharsetLimited Charset = " .:-=+*#%@" CharsetExtended = ".'`^\",:;Il!i><~+_-?][}{1)(|\\/tfjrxnuvczXYUJCLQ0OZmwqpdbkhao*#MW&8%B@$" CharsetBlock = "█" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Charset ¶
type Charset string
Charset is the set of characters which go-ascii uses to convert a pixel into an ascii character.
The leftmost character is used to render the darkest pixel (black) and the rightmost is used for the lightest pixel (white). As the brightness the index of the character used increases to the right
type Memory ¶
type Memory struct {
// contains filtered or unexported fields
}
Memory stores the brightnesses of pixels at specific coordinates.
If passed in to ConvertWithOpts using the Interpolate option for successive calls, go-ascii interpolates the character used to represent the pixel.
This is useful for converting multiple frames in a video where you might want the gradual change between characters to be less pronounced
type Option ¶
type Option func(args *options) error
Option is a function which is supplied to ConvertWithOpts and which mutates the settings which the convertor uses.
Options include:
- CSet -> Character set
- FontPts -> Font size in pts
- Font -> Font
- Interpolate -> Interpolation of characters
func FontPts ¶
FontPts changes the font size the convertor renders the characters in which is specified in points (pts) as opposed to pixels
func Interpolate ¶
Interpolate is able to interpolate the character used if multiple ConvertWithOpts calls are used with this option and if a valid Memory struct is provided.
This makes the change in characters less pronounced between successive images, this is useful if you are converting successive frames of a video.