Adding pot terminal image backend (#1482)

This commit is contained in:
SeungheonOh 2020-07-07 11:26:23 -05:00 committed by GitHub
parent 0e448167c0
commit 77a34f884d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 4 deletions

View File

@ -732,7 +732,7 @@ disk_display="off"
# #
# Default: 'ascii' # Default: 'ascii'
# Values: 'ascii', 'caca', 'chafa', 'jp2a', 'iterm2', 'off', # Values: 'ascii', 'caca', 'chafa', 'jp2a', 'iterm2', 'off',
# 'termpix', 'pixterm', 'tycat', 'w3m', 'kitty' # 'pot', 'termpix', 'pixterm', 'tycat', 'w3m', 'kitty'
# Flag: --backend # Flag: --backend
image_backend="ascii" image_backend="ascii"
@ -3792,7 +3792,7 @@ image_backend() {
"off") image_backend="off" ;; "off") image_backend="off" ;;
"caca" | "chafa" | "jp2a" | "iterm2" | "termpix" |\ "caca" | "chafa" | "jp2a" | "iterm2" | "termpix" |\
"tycat" | "w3m" | "sixel" | "pixterm" | "kitty") "tycat" | "w3m" | "sixel" | "pixterm" | "kitty" | "pot")
get_image_source get_image_source
[[ ! -f "$image" ]] && { [[ ! -f "$image" ]] && {
@ -3817,7 +3817,7 @@ image_backend() {
*) *)
err "Image: Unknown image backend specified '$image_backend'." err "Image: Unknown image backend specified '$image_backend'."
err "Image: Valid backends are: 'ascii', 'caca', 'chafa', 'jp2a', 'iterm2', 'kitty', err "Image: Valid backends are: 'ascii', 'caca', 'chafa', 'jp2a', 'iterm2', 'kitty',
'off', 'sixel', 'pixterm', 'termpix', 'tycat', 'w3m')" 'off', 'sixel', 'pot', 'pixterm', 'termpix', 'tycat', 'w3m')"
err "Image: Falling back to ascii mode." err "Image: Falling back to ascii mode."
print_ascii print_ascii
;; ;;
@ -4219,6 +4219,13 @@ display_image() {
"$image" "$image"
;; ;;
"pot")
pot \
"$image" \
--size="$((width / font_width))x$((height / font_height))" \
--loader=std
;;
"pixterm") "pixterm")
pixterm \ pixterm \
-tc "$((width / font_width))" \ -tc "$((width / font_width))" \
@ -4845,6 +4852,7 @@ IMAGE BACKEND:
--iterm2 source Shortcut to use 'iterm2' backend. --iterm2 source Shortcut to use 'iterm2' backend.
--jp2a source Shortcut to use 'jp2a' backend. --jp2a source Shortcut to use 'jp2a' backend.
--kitty source Shortcut to use 'kitty' backend. --kitty source Shortcut to use 'kitty' backend.
--pot source Shortcut to use 'pot' backend.
--pixterm source Shortcut to use 'pixterm' backend. --pixterm source Shortcut to use 'pixterm' backend.
--sixel source Shortcut to use 'sixel' backend. --sixel source Shortcut to use 'sixel' backend.
--termpix source Shortcut to use 'termpix' backend. --termpix source Shortcut to use 'termpix' backend.
@ -5062,7 +5070,7 @@ get_args() {
# Image backend # Image backend
"--backend") image_backend="$2" ;; "--backend") image_backend="$2" ;;
"--source") image_source="$2" ;; "--source") image_source="$2" ;;
"--ascii" | "--caca" | "--chafa" | "--jp2a" | "--iterm2" | "--off" | "--pixterm" |\ "--ascii" | "--caca" | "--chafa" | "--jp2a" | "--iterm2" | "--off" | "--pot" | "--pixterm" |\
"--sixel" | "--termpix" | "--tycat" | "--w3m" | "--kitty") "--sixel" | "--termpix" | "--tycat" | "--w3m" | "--kitty")
image_backend="${1/--}" image_backend="${1/--}"
case $2 in case $2 in