This commit is contained in:
David Tschumperle 2023-10-02 18:37:20 +02:00
parent 7e03f8e892
commit f0918b9f22
1 changed files with 40 additions and 40 deletions

View File

@ -5856,7 +5856,7 @@ parse_cli_bashcompletion :
if n=['$name'];"n[0]!=_'_' && find(n,'input')!=0 && find(n,'output')!=0 && "\
"find(n,'load')<0 && find(n,'save')<0 && "\
"n!='i' && n!='o' && n!='m' && n!='it' && n!='ot'"
if s=['$name'];s=='help'||s=='h'
if isin(['$name'],'help','h')
+e " \""$name"\" | \"-"$name"\" | \"+"$name"\")"
+e " COMPREPLY=( $(compgen -W \"$coms\" -- \"$cur\") ); return 0;;"
else
@ -8220,7 +8220,7 @@ parse_gui_images :
repeat ${_f${f}_nb_params} { p=$>
type=${_f${f}_p${p}_type}
arg0=${_f${f}_p${p}_a0}
if s=['$type'];s=='file'||s=='filein'||s=='fileout'||s=='folder'||s=='value'
if isin(['$type'],'file','filein','fileout','folder','value')
if !${_f{$f}_p${p}_nb_args} pipeline.=$c\"\"
else
args= ac=
@ -8230,7 +8230,7 @@ parse_gui_images :
pipeline.=$c$s$args$s
fi
c=,
elif s=['$type'];s=='text'
elif ['$type']=='text'
val,off=0
N=${_f${f}_p${p}_nb_args}
l[] { if isint($arg0) val=$arg0 N-=1 off=1 fi onfail }
@ -8240,19 +8240,19 @@ parse_gui_images :
if ['$args']==0 s=\" elif ['$args'][0]==_'\"' s= fi
pipeline.=$c$s$args$s
c=,
elif s=['$type'];s=='float'||s=='int'
elif isin(['$type'],'float','int')
pipeline.=$c$arg0 c=,
elif s=['$type'];s=='button'
elif ['$type']=='button'
pipeline.=${c}0 c=,
elif s=['$type'];s=='bool'
elif ['$type']=='bool'
val=0
if s=['$arg0'];s==1||s=='true' val=1 fi
if isin(['$arg0'],'1','true') val=1 fi
pipeline.=$c$val c=,
elif s=['$type'];s=='choice'
elif ['$type']=='choice'
val=0
l[] { if isint($arg0) val=$arg0 fi onfail }
pipeline.=$c$val c=,
elif s=['$type'];s=='color'
elif ['$type']=='color'
if ${_f${f}_p${p}_nb_args}==1" && "['$arg0'][0]==_'#' # Convert colors specified as '#RRGGBB[AA]'
l[] {
('$arg0') autocrop. {'#'} s x,-2 _f${f}_p${p}_nb_args=$!
@ -8260,7 +8260,7 @@ parse_gui_images :
}
fi
repeat ${_f${f}_p${p}_nb_args} { a=$> pipeline.=$c${_f${f}_p${p}_a${a}} c=, }
elif s=['$type'];s=='point'
elif ['$type']=='point'
pipeline.=$c$arg0,${_f${f}_p${p}_a1} c=,
fi
}
@ -8306,7 +8306,7 @@ parse_gui_thumbnails :
repeat ${_f${f}_nb_params} { p=$>
type=${_f${f}_p${p}_type}
arg0=${_f${f}_p${p}_a0}
if s=['$type'];s=='file'||s=='filein'||s=='fileout'||s=='folder'||s=='value'
if isin(['$type'],'file','filein','fileout','folder','value')
if !${_f{$f}_p${p}_nb_args} pipeline.=$c\"\"
else
args= ac=
@ -8316,7 +8316,7 @@ parse_gui_thumbnails :
pipeline.=$c$s$args$s
fi
c=,
elif s=['$type'];s=='text'
elif ['$type']=='text'
val,off=0
N=${_f${f}_p${p}_nb_args}
l[] { if isint($arg0) val=$arg0 N-=1 off=1 fi onfail }
@ -8326,19 +8326,19 @@ parse_gui_thumbnails :
if ['$args']==0 s=\" elif ['$args'][0]==_'\"' s= fi
pipeline.=$c$s$args$s
c=,
elif s=['$type'];s=='float'||s=='int'
elif isin(['$type'],'float','int')
pipeline.=$c$arg0 c=,
elif s=['$type'];s=='button'
elif ['$type']=='button'
pipeline.=${c}0 c=,
elif s=['$type'];s=='bool'
elif ['$type']=='bool'
val=0
if s=['$arg0'];s==1||s=='true' val=1 fi
if isin(['$arg0'],'1','true') val=1 fi
pipeline.=$c$val c=,
elif s=['$type'];s=='choice'
elif ['$type']=='choice'
val=0
l[] { if isint($arg0) val=$arg0 fi onfail }
pipeline.=$c$val c=,
elif s=['$type'];s=='color'
elif ['$type']=='color'
if ${_f${f}_p${p}_nb_args}==1" && "['$arg0'][0]==_'#' # Convert colors specified as '#RRGGBB[AA]'
l[] {
('$arg0') autocrop. {'#'} s x,-2 _f${f}_p${p}_nb_args=$!
@ -8346,7 +8346,7 @@ parse_gui_thumbnails :
}
fi
repeat ${_f${f}_p${p}_nb_args} { a=$> pipeline.=$c${_f${f}_p${p}_a${a}} c=, }
elif s=['$type'];s=='point'
elif ['$type']=='point'
pipeline.=$c$arg0,${_f${f}_p${p}_a1} c=,
fi
}
@ -8522,7 +8522,7 @@ parse_gui_update :
[_'[',_',',_']']
):[_'(',_',',_')'];
"`}
if s=['${_f${f}_p${p}_type}'];"s=='link' || s=='note' || s=='separator' || s=='value'" name=_
if isin(['${_f${f}_p${p}_type}'],'link','note','separator','value') name=_
else strcapitalize ${_f${f}_p${p}_name} name=${}
fi
('"#@gui"$locale" :"{/$name}=$responsivity${_f${f}_p${p}_type}{``$sep1}{``{/$args}}{``$sep2}$visibility\n')
@ -8662,17 +8662,17 @@ parse_gui_json :
"\""$ppos"\""$visibility" }"$sepp\n')
ppos+=$nbargs
elif s=['$type'];s=='int'
elif ['$type']=='int'
('" { \"type\": \"int\", \"name\": \""$name"\", \"default\": \""$arg0"\", \"min\": \""$arg1"\", "\
"\"max\": \""$arg2"\", \"pos\": \""$ppos"\""$visibility" }"$sepp\n')
ppos+=1
elif s=['$type'];s=='float'
elif ['$type']=='float'
('" { \"type\": \"float\", \"name\": \""$name"\", \"default\": \""$arg0"\", \"min\": \""$arg1"\", "\
"\"max\": \""$arg2"\", \"pos\": \""$ppos"\""$visibility" }"$sepp\n')
ppos+=1
elif s=['$type']:s=='file'" || "s=='filein'" || "s=='fileout'
elif isin(['$type'],'file','filein','fileout')
('" { \"type\": \"file\", \"name\": \""$name"\", \"default\": \""{/$arg0}"\", \"pos\": "\
"\""$ppos"\""$visibility" }"$sepp\n')
ppos+=1
@ -8852,15 +8852,15 @@ parse_gui_gmicol :
$responsivity$visibility"/>\n"')
fi
elif s=['$type'];s=='int'
elif ['$type']=='int'
('" <int name=\""$name"\" value=\""$arg0"\" min=\""$arg1"\" max=\""$arg2"\""\
$responsivity$visibility"/>"\n')
elif s=['$type'];s=='float'
elif ['$type']=='float'
('" <float name=\""$name"\" value=\""$arg0"\" min=\""$arg1"\" max=\""$arg2"\""\
$responsivity$visibility"/>"\n')
elif s=['$type'];s=='file'" || "s=='filein'" || "s=='fileout'
elif isin(['$type'],'file','filein','fileout')
('" <file name=\""$name"\" value=\""$arg0"\""$responsivity$visibility"/>\n"')
elif ['$type']=='folder'
@ -11015,11 +11015,11 @@ update_tutorial_html : check "isbool(${1=0})"
basename $file basename=${} 0 => $basename ext={`lowercase(['{x}'])`} rm.
if ['$basename']!='img'
if isdir(['$file']) files 5,$file/* ({'${}'}:y) s. -,{','} # Folder -> Recursively add files
elif s=['$ext'];s=='png'||s=='jpg'||s=='jpeg'||s=='gif'||s=='mp4'||s=='svg'||s=='webm'
elif isin(['$ext'],'png','jpg','jpeg','gif','mp4','svg','webm')
x "cp -f \""$file"\" images/" # Image/videos: Copy to sub-folder 'images/'
elif s=['$ext'];s=='gmic'||s=='py'
elif isin(['$ext'],'gmic','py')
x "cp -f \""$file"\" scripts/" # Scripts: Copy to sub-folder 'scripts/'
elif s=['$ext'];s=='gmd' # G'MIC Markdown -> Copy to current folder './'
elif ['$ext']=='gmd' # G'MIC Markdown -> Copy to current folder './'
it[] $file
ot. $basename rm.
fi
@ -11200,10 +11200,10 @@ parse_gui_zart :
args= c= repeat $nbargs { a=$> args.=$c${arg$a} c="," }
+e " <color name=\""$name"\" default=\""$args"\" />"
elif s=['$type'];s=='int'" || "s=='float'
elif isin(['$type'],'int','float')
+e " <"$type" name=\""$name"\" default=\""$arg0"\" min=\""$arg1"\" max=\""$arg2"\" />"
elif s=['$type'];s=='file'" || "s=='filein'" || "s=='fileout'
elif isin(['$type'],'file','filein','fileout')
+e " <file name=\""$name"\" default=\""$arg0"\" />"
elif ['$type']=='folder'
@ -11407,7 +11407,7 @@ upload_filters :
basename $file basename=${}
if ['$basename']=='sylvie_alexandre.gmic'
s +,{'"#@gui <b>"'} i[1--2:2] ('"#@gui ________<b>Testing<b>\n#@gui <i>Samj</i>\n"') y a y
elif s=['$basename'];s=='template.gmic'
elif ['$basename']=='template.gmic'
rm 0
fi
} }
@ -12268,8 +12268,8 @@ balance_gamma : check "isnum(${1=128})"
# { uint8 | int8 | uint16 | int16 | uint32 | int32 | uint64 | int64 | float32 | float64 }.
cast :
e[^-1] "Cast datatype of image buffer$? from '$1' to '$2'."
ssize:=s='"$1"';s=='"uint8"'||s=='int8'?1:s=='"uint16"'||s=='int16'?2:s=='"uint32"'||s=='int32'||s=='float32'?4:8
dsize:=s='"$2"';s=='"uint8"'||s=='int8'?1:s=='"uint16"'||s=='int16'?2:s=='"uint32"'||s=='int32'||s=='float32'?4:8
ssize:=s=['"$1"'];s=='uint8'||s=='int8'?1:s=='uint16'||s=='int16'?2:s=='uint32'||s=='int32'||s=='float32'?4:8
dsize:=s=['"$2"'];s=='uint8'||s=='int8'?1:s=='uint16'||s=='int16'?2:s=='uint32'||s=='int32'||s=='float32'?4:8
foreach {
w,h,d,s:=[w,h,d,s]
serialize $1,0,0
@ -16280,12 +16280,12 @@ montage : check "isnum(${2=2}) && $2>=0 && $2<=3" skip "${1=X}",${3=0},"${4=}"
N=$!
l[] {
_scode="$1" _mode=$2
if lowercase('"$1"')=='h' if $N>1 {$N-1},1,1,1,-1 $N,1,1,1,x a x y else return fi # Simple horizontal montage.
elif lowercase('"$1"')=='v' if $N>1 {$N-1},1,1,1,-2 $N,1,1,1,x a x y else return fi # Simple vertical montage.
elif s=lowercase('"$1"');s=='a'||s=='b' # Montage as an array.
if lowercase(['"$1"'])=='h' if $N>1 {$N-1},1,1,1,-1 $N,1,1,1,x a x y else return fi # Simple horizontal montage.
elif lowercase(['"$1"'])=='v' if $N>1 {$N-1},1,1,1,-2 $N,1,1,1,x a x y else return fi # Simple vertical montage.
elif isin(lowercase(['"$1"']),'a','b') # Montage as an array.
if $N<2 return fi
nr:=round(sqrt($N)) nc:=round($N/$nr,1,1) # Horizontal array.
if lowercase('"$1"')=='b' n=$nr nr=$nc nc=$n fi # Vertical array.
if lowercase(['"$1"'])=='b' n=$nr nr=$nc nc=$n fi # Vertical array.
$N,1,1,1,x s x,-{round(w/$nr,1,1)} foreach { if w>1 i[0] {w-1},1,1,1,-1 a x fi } a x
if $nr>1 i[0] {$nr-1},1,1,1,-2 a x fi y
else # Other complex montage.
@ -19879,7 +19879,7 @@ betti :
#@cli : $ 400,400 rand 32,255 100%,100% noise. 0.4,2 eq. 1 mul +delaunay
#@cli : $ image.jpg 100%,100% noise. 2,2 eq. 1 delaunay. +blend shapeaverage0
delaunay : skip "${1=0}"
mode=0 if s=['"$1"'];s=='0'||s=='1' mode=$1 else mode=0 noarg fi
mode=0 if isin(['"$1"'],'0','1') mode=$1 else mode=0 noarg fi
s0,s1=image,coordinates
e[^-1] "Generate discrete 2D Delaunay triangulation of non-zero pixels in image$?, in "${s$mode}" mode."
foreach {
@ -28131,7 +28131,7 @@ nn_nl : if ['${2=.}']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in
_nn_$1_input=$in
_nn_$1_properties="activation=$3"
_nn_forward.="begin(nn_nl_init_forward($1,"$in"));"
if s=['$3'];s=='softmax'
if ['$3']=='softmax'
_nn_forward.="nn_$3_forward($1,"$in");"
_nn_backward..="nn_$3_backward($1,"$in");"
else