~dricottone/image2ascii

ref: 5919516377849dab330fee1a01e66bc5d5042f59 image2ascii/ascii/option.go -rw-r--r-- 632 bytes
59195163 — qeesung add lufei ascii image 6 years ago
                                                                                
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
28
29
30
31
32
33
package ascii

// Convert options
type Options struct {
	pixels  []byte
	reverse bool
	colored bool
	bg      bool
	fg      bool
}

// Default options
var DefaultOptions = Options{
	pixels:  []byte(" .,:;i1tfLCG08@"),
	reverse: false,
	colored: true,
	bg:      false,
	fg:      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
	options.bg = newOptions.bg
	options.fg = newOptions.fg
}