Documentation
¶
Index ¶
- Constants
- Variables
- func ConvertToAsciiChars(imgSet [][]AsciiPixel, negative, colored, grayscale, complex, colorBg bool, ...) ([][]AsciiChar, error)
- func ConvertToAsciiPixels(img image.Image, dimensions []int, width, height int, ...) ([][]AsciiPixel, error)
- func ConvertToBrailleChars(imgSet [][]AsciiPixel, negative, colored, grayscale, colorBg bool, ...) ([][]AsciiChar, error)
- type AsciiChar
- type AsciiPixel
Constants ¶
const MAX_VAL float64 = 255
For each individual element of imgSet in ConvertToASCIISlice()
Variables ¶
var ( // Structure for braille dots BrailleStruct = [4][2]int{ {0x1, 0x8}, {0x2, 0x10}, {0x4, 0x20}, {0x40, 0x80}, } BrailleThreshold uint32 )
Functions ¶
func ConvertToAsciiChars ¶ added in v1.6.0
func ConvertToAsciiChars(imgSet [][]AsciiPixel, negative, colored, grayscale, complex, colorBg bool, customMap string, fontColor [3]int) ([][]AsciiChar, error)
Converts the 2D image_conversions.AsciiPixel slice of image data (each instance representing each compressed pixel of original image) to a 2D image_conversions.AsciiChar slice
If complex parameter is true, values are compared to 70 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, width, height int, flipX, flipY, full, isBraille, dither bool) ([][]AsciiPixel, error)
This function shrinks the passed image according to specified or default dimensions. 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
func ConvertToBrailleChars ¶ added in v1.7.0
func ConvertToBrailleChars(imgSet [][]AsciiPixel, negative, colored, grayscale, colorBg bool, fontColor [3]int, threshold int) ([][]AsciiChar, error)
Converts the 2D image_conversions.AsciiPixel slice of image data (each instance representing each compressed pixel of original image) to a 2D image_conversions.AsciiChar slice
Unlike ConvertToAsciiChars(), this function calculates braille characters instead of ascii
Types ¶
type AsciiPixel ¶ added in v1.2.0
type AsciiPixel struct {
// contains filtered or unexported fields
}