From 525a85ee696be44be66eb995882ac830a4eabc91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=A6=E4=B8=96=E6=88=90?= Date: Sun, 21 Oct 2018 12:48:06 +0800 Subject: [PATCH] Update README.md --- README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/README.md b/README.md index 4e331b6..ad90b01 100644 --- a/README.md +++ b/README.md @@ -83,6 +83,32 @@ func main() { } ``` +convert options + +```golang +type Options struct { + Ratio float64 . // Scale Ratio + ExpectedWidth int // Convert the image with fixed width + ExpectedHeight int // Convert the image with fixed height + FitScreen bool // Scale the image to fit the tereminal screen + Colored bool // if convert the image to colored ascii +} +``` + +supported convert function +```golang +// convert a image object to ascii matrix +func Image2ASCIIMatrix(image image.Image, imageConvertOptions *Options) []string {} + +// convert a image object to ascii matrix and then join the matrix to a string +func Image2ASCIIString(image image.Image, options *Options) string {} + +// convert a image object by input a string to ascii matrix then join the matrix to a string +func ImageFile2ASCIIString(imageFilename string, option *Options) string {} +``` + + + ## Sample outputs | Raw Image | ASCII Image | -- 2.45.2