From 3e0d95af2bce75bd002c57d08b9c8eddcfc12a3d Mon Sep 17 00:00:00 2001 From: qeesung <1245712564@qq.com> Date: Mon, 29 Oct 2018 00:23:55 +0800 Subject: [PATCH] remove uesless files --- ascii/ascii.go | 28 ++++++++++++++++++++++++++++ ascii/option.go | 29 ----------------------------- 2 files changed, 28 insertions(+), 29 deletions(-) delete mode 100644 ascii/option.go diff --git a/ascii/ascii.go b/ascii/ascii.go index 077b4df..1d900b7 100644 --- a/ascii/ascii.go +++ b/ascii/ascii.go @@ -10,6 +10,34 @@ import ( "reflect" ) +// Options convert pixel to raw char +type Options struct { + Pixels []byte + Reversed bool + Colored bool +} + +// DefaultOptions that contains the default pixels +var DefaultOptions = Options{ + Pixels: []byte(" .,:;i1tfLCG08@"), + Reversed: false, + Colored: true, +} + +// NewOptions create a new convert option +func NewOptions() Options { + newOptions := Options{} + newOptions.mergeOptions(&DefaultOptions) + return newOptions +} + +// mergeOptions merge two options +func (options *Options) mergeOptions(newOptions *Options) { + options.Pixels = append([]byte{}, newOptions.Pixels...) + options.Reversed = newOptions.Reversed + options.Colored = newOptions.Colored +} + func NewPixelConverter() PixelConverter { return PixelASCIIConverter{} } diff --git a/ascii/option.go b/ascii/option.go deleted file mode 100644 index e342fa4..0000000 --- a/ascii/option.go +++ /dev/null @@ -1,29 +0,0 @@ -package ascii - -// Options convert pixel to raw char -type Options struct { - Pixels []byte - Reversed bool - Colored bool -} - -// DefaultOptions that contains the default pixels -var DefaultOptions = Options{ - Pixels: []byte(" .,:;i1tfLCG08@"), - Reversed: false, - Colored: true, -} - -// NewOptions create a new convert option -func NewOptions() Options { - newOptions := Options{} - newOptions.mergeOptions(&DefaultOptions) - return newOptions -} - -// mergeOptions merge two options -func (options *Options) mergeOptions(newOptions *Options) { - options.Pixels = append([]byte{}, newOptions.Pixels...) - options.Reversed = newOptions.Reversed - options.Colored = newOptions.Colored -} -- 2.45.2