| author | Axel Jacobs <axel@jaloxa.eu> |
| Sun, 26 Jun 2011 21:32:00 +0100 | |
| changeset 16 | 7174511d4983 |
| parent 0 | 0aa115157c9c |
| permissions | -rw-r--r-- |
|
0
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
1 |
#!/bin/csh -f |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
2 |
# RCSid: $Id: normpat.csh,v 2.7 2008/08/25 04:50:32 greg Exp $ |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
3 |
# |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
4 |
# Normalize a pattern for tiling (-b option blends edges) by removing |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
5 |
# lowest frequencies from image (-f option) and reducing to |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
6 |
# standard size (-r option) |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
7 |
# |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
8 |
set ha=$0 |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
9 |
set ha=$ha:t |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
10 |
set pf="pfilt -e 2" |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
11 |
while ($#argv > 0) |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
12 |
switch ($argv[1]) |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
13 |
case -r: |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
14 |
shift argv |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
15 |
set pf="$pf -x $argv[1] -y $argv[1] -p 1 -r .67" |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
16 |
breaksw |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
17 |
case -f: |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
18 |
set ha="$ha -f" |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
19 |
set dofsub |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
20 |
breaksw |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
21 |
case -b: |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
22 |
set ha="$ha -b" |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
23 |
set blend |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
24 |
breaksw |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
25 |
case -v: |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
26 |
set verb |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
27 |
breaksw |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
28 |
case -*: |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
29 |
echo bad option $argv[1] |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
30 |
exit 1 |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
31 |
default: |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
32 |
goto dofiles |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
33 |
endsw |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
34 |
shift argv |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
35 |
end |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
36 |
dofiles: |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
37 |
onintr quit |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
38 |
set td=`mktemp -d /tmp/np.XXXXXX` |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
39 |
goto skipthis |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
40 |
cat > $td/coef.fmt << '_EOF_' |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
41 |
rm:${ $25 }; gm:${ $26 }; bm:${ $27 };
|
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
42 |
rcx:${ $1 }; gcx:${ $9 }; bcx:${ $17 };
|
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
43 |
rcy:${ $2 }; gcy:${ $10 }; bcy:${ $18 };
|
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
44 |
rsx:${ $3 }; gsx:${ $11 }; bsx:${ $19 };
|
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
45 |
rsy:${ $4 }; gsy:${ $12 }; bsy:${ $20 };
|
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
46 |
rcxcy:${ $5 }; gcxcy:${ $13 }; bcxcy:${ $21 };
|
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
47 |
rcxsy:${ $6 }; gcxsy:${ $14 }; bcxsy:${ $22 };
|
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
48 |
rsxcy:${ $7 }; gsxcy:${ $15 }; bsxcy:${ $23 };
|
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
49 |
rsxsy:${ $8 }; gsxsy:${ $16 }; bsxsy:${ $24 };
|
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
50 |
'_EOF_' |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
51 |
cat > $td/coef.cal << '_EOF_' |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
52 |
$1=$3*2*cx; $2=$3*2*cy; $3=$3*2*sx; $4=$3*2*sy; |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
53 |
$5=$3*4*cx*cy; $6=$3*4*cx*sy; $7=$3*4*sx*cy; $8=$3*4*sx*sy; |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
54 |
$9=$4*2*cx; $10=$4*2*cy; $11=$4*2*sx; $12=$4*2*sy; |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
55 |
$13=$4*4*cx*cy; $14=$4*4*cx*sy; $15=$4*4*sx*cy; $16=$4*4*sx*sy; |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
56 |
$17=$5*2*cx; $18=$5*2*cy; $19=$5*2*sx; $20=$5*2*sy; |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
57 |
$21=$5*4*cx*cy; $22=$5*4*cx*sy; $23=$5*4*sx*cy; $24=$5*4*sx*sy; |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
58 |
$25=$3; $26=$4; $27=$5; |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
59 |
cx=cos(wx); cy=cos(wy); |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
60 |
sx=sin(wx); sy=sin(wy); |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
61 |
wx=2*PI/xres*($1+.5); wy=2*PI/yres*($2+.5); |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
62 |
'_EOF_' |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
63 |
cat > $td/fsub.cal << '_EOF_' |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
64 |
PI:3.14159265358979323846; |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
65 |
ro=ri(1)*rm/(rm+rcx*cx+rcy*cy+rsx*sx+rsy*sy |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
66 |
+rcxcy*cx*cy+rcxsy*cx*sy+rsxcy*sx*cy+rsxsy*sx*sy); |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
67 |
go=gi(1)*gm/(gm+gcx*cx+gcy*cy+gsx*sx+gsy*sy |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
68 |
+gcxcy*cx*cy+gcxsy*cx*sy+gsxcy*sx*cy+gsxsy*sx*sy); |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
69 |
bo=bi(1)*bm/(bm+bcx*cx+bcy*cy+bsx*sx+bsy*sy |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
70 |
+bcxcy*cx*cy+bcxsy*cx*sy+bsxcy*sx*cy+bsxsy*sx*sy); |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
71 |
cx=cos(wx); cy=cos(wy); |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
72 |
sx=sin(wx); sy=sin(wy); |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
73 |
wx=2*PI/xres*(x+.5); wy=2*PI/yres*(y+.5); |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
74 |
'_EOF_' |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
75 |
skipthis: |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
76 |
foreach f ($*) |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
77 |
if ( $?verb ) then |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
78 |
echo $f\: |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
79 |
echo adjusting exposure/size... |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
80 |
endif |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
81 |
$pf $f > $td/pf |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
82 |
getinfo < $td/pf > $f |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
83 |
ed - $f << _EOF_ |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
84 |
i |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
85 |
$ha |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
86 |
. |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
87 |
w |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
88 |
q |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
89 |
_EOF_ |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
90 |
set resolu=`getinfo -d < $td/pf | sed 's/-Y \([1-9][0-9]*\) +X \([1-9][0-9]*\)/\2 \1/'` |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
91 |
if ( ! $?dofsub ) then |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
92 |
mv $td/pf $td/hf |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
93 |
goto donefsub |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
94 |
endif |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
95 |
# if ( $?verb ) then |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
96 |
# echo computing Fourier coefficients... |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
97 |
# endif |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
98 |
# pfilt -1 -x 32 -y 32 $td/pf | pvalue -h \ |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
99 |
# | rcalc -e 'xres:32;yres:32' -f $td/coef.cal \ |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
100 |
# | total -m | rcalc -o $td/coef.fmt \ |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
101 |
# > $td/coef |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
102 |
if ( $?verb ) then |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
103 |
# cat $td/coef |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
104 |
echo removing low frequencies... |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
105 |
endif |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
106 |
pgblur -r `ev "sqrt($resolu[1]*$resolu[2])/8"` $td/pf > $td/lf |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
107 |
pcomb -e 's=1/li(2);ro=s*ri(1);go=s*gi(1);bo=s*bi(1)' \ |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
108 |
$td/pf $td/lf > $td/hf |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
109 |
# pcomb -f $td/coef -f $td/fsub.cal $td/pf > $td/hf |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
110 |
donefsub: |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
111 |
if ( $?blend ) then |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
112 |
if ( $?verb ) then |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
113 |
echo blending edges... |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
114 |
endif |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
115 |
@ mar= $resolu[1] - 3 |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
116 |
@ les= $resolu[1] - 1 |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
117 |
pcompos -x 1 $td/hf 0 0 | pfilt -1 -x 3 > $td/left |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
118 |
pcompos $td/hf -$les 0 | pfilt -1 -x 3 > $td/right |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
119 |
pcomb -e 'ro=f(ri);go=f(gi);bo=f(bi)' \ |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
120 |
-e 'f(p)=(3-x)/7*p(1)+(4+x)/7*p(2)' \ |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
121 |
$td/right $td/left > $td/left.patch |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
122 |
pcomb -e 'ro=f(ri);go=f(gi);bo=f(bi)' \ |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
123 |
-e 'f(p)=(1+x)/7*p(1)+(6-x)/7*p(2)' \ |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
124 |
$td/left $td/right > $td/right.patch |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
125 |
pcompos $td/hf 0 0 $td/left.patch 0 0 $td/right.patch $mar 0 \ |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
126 |
> $td/hflr |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
127 |
@ mar= $resolu[2] - 3 |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
128 |
@ les= $resolu[2] - 1 |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
129 |
pcompos -y 1 $td/hflr 0 0 | pfilt -1 -y 3 > $td/bottom |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
130 |
pcompos $td/hflr 0 -$les | pfilt -1 -y 3 > $td/top |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
131 |
pcomb -e 'ro=f(ri);go=f(gi);bo=f(bi)' \ |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
132 |
-e 'f(p)=(3-y)/7*p(1)+(4+y)/7*p(2)' \ |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
133 |
$td/top $td/bottom > $td/bottom.patch |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
134 |
pcomb -e 'ro=f(ri);go=f(gi);bo=f(bi)' \ |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
135 |
-e 'f(p)=(1+y)/7*p(1)+(6-y)/7*p(2)' \ |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
136 |
$td/bottom $td/top > $td/top.patch |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
137 |
pcompos $td/hflr 0 0 $td/bottom.patch 0 0 $td/top.patch 0 $mar \ |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
138 |
| getinfo - >> $f |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
139 |
else |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
140 |
getinfo - < $td/hf >> $f |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
141 |
endif |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
142 |
if ( $?verb ) then |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
143 |
echo $f done. |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
144 |
endif |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
145 |
end |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
146 |
quit: |
|
0aa115157c9c
Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff
changeset
|
147 |
rm -rf $td |