File: img2sixel

package info (click to toggle)
libsixel 1.10.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 11,496 kB
  • sloc: ansic: 23,873; cpp: 1,227; python: 497; sh: 303; xml: 271; makefile: 50; ruby: 31; perl: 26
file content (172 lines) | stat: -rw-r--r-- 5,749 bytes parent folder | download | duplicates (4)
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
# bash completion for img2sixel

have img2sixel &&
_img2sixel()
{
    local cur prev

    COMPREPLY=()
    cur=`_get_cword`
    prev=${COMP_WORDS[COMP_CWORD-1]}

    _expand || return 0

    case "$prev" in
    -p|--colors)
        COMPREPLY=( $( compgen -W '2 \
                                   4 \
                                   8 \
                                   16 \
                                   32 \
                                   64 \
                                   128 \
                                   256' -- "$cur" ) )
        return 0
        ;;
    -m|--mapfile)
        _filedir
        return 0
        ;;
    -C|--complexion-score)
        COMPREPLY=( $( compgen -W '1 \
                                   2 \
                                   3 \
                                   4 \
                                   5 \
                                   6' -- "$cur" ) )
        return 0
        ;;
    -d|--diffusion)
        COMPREPLY=( $( compgen -W 'auto \
                                   none \
                                   fs \
                                   atkinson \
                                   jajuni \
                                   stucki \
                                   burkes \
                                   a_dither \
                                   x_dither' -- "$cur" ) )
        return 0
        ;;
    -f|--find-largest)
        COMPREPLY=( $( compgen -W 'auto \
                                   norm \
                                   lum' -- "$cur" ) )
        return 0
        ;;
    -s|--select-color)
        COMPREPLY=( $( compgen -W 'auto \
                                   center \
                                   average \
                                   histogram' -- "$cur" ) )
        return 0
        ;;
    -r|--resampling)
        COMPREPLY=( $( compgen -W 'auto \
                                   nearest \
                                   gaussian \
                                   hanning \
                                   hamming \
                                   bilinear \
                                   welsh \
                                   bicubic \
                                   lanczos2 \
                                   lanczos3 \
                                   lanczos4' -- "$cur" ) )
        return 0
        ;;
    -q|--quality)
        COMPREPLY=( $( compgen -W 'auto \
                                   high \
                                   low' -- "$cur" ) )
        return 0
        ;;
    -l|--loop-control)
        COMPREPLY=( $( compgen -W 'auto \
                                   force \
                                   disable' -- "$cur" ) )
        return 0
        ;;
    -t|--palette-type)
        COMPREPLY=( $( compgen -W 'auto \
                                   hls \
                                   rgb' -- "$cur" ) )
        return 0
        ;;
    -b|--builtin-palette)
        COMPREPLY=( $( compgen -W 'xterm16 \
                                   xterm256 \
                                   vt340mono \
                                   vt340color \
                                   gray1 \
                                   gray2 \
                                   gray4 \
                                   gray8 ' -- "$cur" ) )
        return 0
        ;;
    -E|--encode-policy)
        COMPREPLY=( $( compgen -W 'auto \
                                   fast \
                                   size' -- "$cur" ) )
        return 0
        ;;
    -o|--outfile)
        _filedir
        return 0
        ;;
    esac

    case "$cur" in
    -*)
        COMPREPLY=( $( compgen -W '
                                   -o --outfile \
                                   -7 --7bit-mode \
                                   -8 --8bit-mode \
                                   -R --gri-limit \
                                   -p --colors \
                                   -m --mapfile \
                                   -e --monochrome \
                                   -k --insecure \
                                   -i --invert \
                                   -I --high-color \
                                   -u --use-macro \
                                   -n --macro-number \
                                   -C --complexion-score \
                                   -g --ignore-delay \
                                   -S --static \
                                   -d --diffusion \
                                   -f --find-largest \
                                   -s --select-color \
                                   -c --crop \
                                   -w --width \
                                   -h --height \
                                   -r --resampling \
                                   -q --quality \
                                   -l --loop-control \
                                   -t --palette-type \
                                   -b --builtin-palette \
                                   -E --encode-policy \
                                   -B --bgcolor \
                                   -P --penetrate \
                                   -D --pipe-mode \
                                   -v --verbose \
                                   -V --version \
                                   -H --help \
                                  ' -- "$cur" ))
        ;;
    *)
        _filedir
        ;;
    esac

    return 0
} &&
complete -F _img2sixel $nospace $filenames img2sixel

# Local variables:
# mode: shell-script
# sh-basic-offset: 4
# sh-indent-comment: t
# indent-tabs-mode: nil
# End:
# ex: ts=4 sw=4 et filetype=sh