1 |
|
#!/bin/csh -f |
2 |
+ |
# RCSid $Id$ |
3 |
|
# |
4 |
|
# Combine alternate lines in full frames for field rendering |
5 |
|
# |
8 |
|
# If an odd number of frames is provided, the spare frame at the |
9 |
|
# end is linked to $spare_name for the next run |
10 |
|
# |
11 |
< |
# Written by Greg Ward for Iebele Atelier in August 2005 |
11 |
> |
# Written by Greg Ward for Iebele Abel in August 2005 |
12 |
|
# |
13 |
|
set spare_name=spare_fieldcomb_frame.pic |
14 |
< |
if ($#argv > 1) then |
15 |
< |
if ("$argv[1]" == "-r") then |
14 |
> |
set odd_first=0 |
15 |
> |
while ($#argv > 1) |
16 |
> |
switch ($argv[1]) |
17 |
> |
case -r*: |
18 |
|
set remove_orig |
19 |
< |
shift argv |
20 |
< |
endif |
21 |
< |
endif |
19 |
> |
breaksw |
20 |
> |
case -o*: |
21 |
> |
set odd_first=1 |
22 |
> |
breaksw |
23 |
> |
case -e*: |
24 |
> |
set odd_first=0 |
25 |
> |
breaksw |
26 |
> |
default: |
27 |
> |
if ("$argv[1]" !~ -*) break |
28 |
> |
echo "Unknown option: $argv[1]" |
29 |
> |
exit 1 |
30 |
> |
endsw |
31 |
> |
shift argv |
32 |
> |
end |
33 |
|
if ($#argv < 2) then |
34 |
< |
echo "Usage: $0 [-r] field1.pic field2.pic .." |
34 |
> |
echo "Usage: $0 [-e|-o][-r] field1.pic field2.pic .." |
35 |
|
exit 1 |
36 |
|
endif |
37 |
|
set f1=$argv[1]:q |
47 |
|
set curfi=1 |
48 |
|
while ($curfi < $#fields) |
49 |
|
@ nextfi = $curfi + 1 |
50 |
< |
pcomb -e 'ro=ri(fld);go=gi(fld);bo=bi(fld)' \ |
51 |
< |
-e 'odd=.5*y-floor(.5*y)-.25' -e 'fld=if(odd,1,2)' \ |
50 |
> |
if ($curfr < 10) then |
51 |
> |
set fid=000$curfr |
52 |
> |
else if ($curfr < 100) then |
53 |
> |
set fid=00$curfr |
54 |
> |
else if ($curfr < 1000) then |
55 |
> |
set fid=0$curfr |
56 |
> |
else |
57 |
> |
set fid=$curfr |
58 |
> |
endif |
59 |
> |
pcomb -e 'ro=ri(fld); go=gi(fld); bo=bi(fld)' \ |
60 |
> |
-e 'yd=yres-1-y; odd=.5*yd-floor(.5*yd)-.25' \ |
61 |
> |
-e "fld=if(odd,2-$odd_first,1+$odd_first)" \ |
62 |
|
$fields[$curfi]:q $fields[$nextfi]:q \ |
63 |
< |
> "${basenm}C$curfr.$ext" |
63 |
> |
> "${basenm}C$fid.$ext" |
64 |
|
if ($?remove_orig) rm $fields[$curfi]:q $fields[$nextfi]:q |
65 |
|
@ curfr++ |
66 |
|
@ curfi = $nextfi + 1 |