Documentation
¶
Index ¶
Constants ¶
const MAX_VAL float32 = 65535
For each individual element of imgSet in ConvertToASCIISlice()
Variables ¶
This section is empty.
Functions ¶
func ConvertToAscii ¶ added in v1.2.0
func ConvertToAscii(imgSet [][]AsciiPixel, negative bool, colored bool, complex bool, customMap string) [][]AsciiChar
Converts the 2D AsciiPixel slice of image data (each instance representing each pixel of original image) to a 2D AsciiChar slice with each colored and simple string having an ASCII character corresponding to the original grayscale and RGB values in AsciiPixel.
If complex parameter is true, values are compared to 69 levels of color density in ASCII characters. Otherwise, values are compared to 10 levels of color density in ASCII characters.
func ConvertToAsciiPixels ¶ added in v1.2.0
func ConvertToAsciiPixels(img image.Image, dimensions []int, flipX, flipY bool) ([][]AsciiPixel, int, int, error)
This function shrinks the passed image according to passed dimensions or terminal size if none are passed. Stores each pixel's grayscale and RGB values in an AsciiPixel instance to simplify getting numeric data for ASCII character comparison.
The returned 2D AsciiPixel slice contains each corresponding pixel's values. Grayscale value ranges from 0 to 65535, while RGB values are separate.
Types ¶
type AsciiPixel ¶ added in v1.2.0
type AsciiPixel struct {
// contains filtered or unexported fields
}