~dricottone/image2ascii

ref: 342171f64d6e3a8a6242f7e039c77cea59234257 image2ascii/ascii/option.go -rw-r--r-- 515 bytes
342171f6 — The Codacy Badger Add Codacy badge 6 years ago
                                                                                
5f88c33e qeesung
c5de7795 qeesung
5f88c33e qeesung
c5de7795 qeesung
5f88c33e qeesung
c5de7795 qeesung
5f88c33e qeesung
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package ascii

// Convert options
type Options struct {
	Pixels  []byte
	Reverse bool
	Colored bool
}

// Default options
var DefaultOptions = Options{
	Pixels:  []byte(" .,:;i1tfLCG08@"),
	Reverse: false,
	Colored: true,
}

// Create a new options
func NewOptions() Options {
	return DefaultOptions
}

// Merge options
func (options *Options) mergeOptions(newOptions *Options) {
	options.Pixels = append([]byte{}, newOptions.Pixels...)
	options.Reverse = newOptions.Reverse
	options.Colored = newOptions.Colored
}