1 |
greg |
1.1 |
#!/bin/csh -f |
2 |
|
|
# RCSid $Id$ |
3 |
|
|
# |
4 |
|
|
# Apply Gaussian blur without resizing image |
5 |
|
|
# More efficient than straight pfilt for large blurs |
6 |
|
|
# |
7 |
|
|
if ( $#argv != 3 ) then |
8 |
|
|
goto userr |
9 |
|
|
endif |
10 |
|
|
if ( "$1" != "-r" ) then |
11 |
|
|
goto userr |
12 |
|
|
endif |
13 |
|
|
if ( "$2" !~ [1-9]* ) then |
14 |
|
|
goto userr |
15 |
|
|
endif |
16 |
|
|
set rad = $2 |
17 |
|
|
set inp = "$3" |
18 |
|
|
set reduc = `ev "floor($rad/1.8)"` |
19 |
|
|
if ( $reduc <= 1 ) then |
20 |
|
|
exec pfilt -1 -r $rad $inp:q |
21 |
|
|
endif |
22 |
|
|
set filt = `ev "$rad/$reduc"` |
23 |
|
|
set pr=`getinfo -d < $inp:q | sed 's/^-Y \([1-9][0-9]*\) +X \([1-9][0-9]*\)$/\2 \1/'` |
24 |
|
|
pfilt -1 -x /$reduc -y /$reduc $inp:q \ |
25 |
|
|
| pfilt -1 -r $filt -x $pr[1] -y $pr[2] |
26 |
|
|
exit 0 |
27 |
|
|
userr: |
28 |
|
|
echo Usage: "$0 -r radius input.pic" |
29 |
|
|
exit 1 |