ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/fieldcomb.csh
(Generate patch)

Comparing ray/src/util/fieldcomb.csh (file contents):
Revision 2.1 by greg, Fri Sep 2 04:15:42 2005 UTC vs.
Revision 2.5 by greg, Mon Sep 5 16:13:08 2005 UTC

# Line 1 | Line 1
1   #!/bin/csh -f
2 + # RCSid $Id$
3   #
4   # Combine alternate lines in full frames for field rendering
5   #
# Line 7 | Line 8
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 +                breaksw
20 +        case -o*:
21 +                set odd_first=1
22 +                breaksw
23 +        case -e*:
24 +                set odd_first=0
25 +                breaksw
26 +        case -f*:
27                  shift argv
28 <        endif
29 < endif
30 < if ($#argv < 2) then
31 <        echo "Usage: $0 [-r] field1.pic field2.pic .."
28 >                set outfile="$argv[1]"
29 >                breaksw
30 >        default:
31 >                if ("$argv[1]" !~ -*) break
32 >                echo "Unknown option: $argv[1]"
33 >                exit 1
34 >        endsw
35 >        shift argv
36 > end
37 > if ($#argv < 2 || ($?outfile && $#argv > 2)) then
38 >        echo "Usage: $0 [-e|-o][-r] [-f combined.pic] field1.pic field2.pic .."
39          exit 1
40   endif
41   set f1=$argv[1]:q
# Line 33 | Line 51 | endif
51   set curfi=1
52   while ($curfi < $#fields)
53          @ nextfi = $curfi + 1
54 <        pcomb -e 'ro=ri(fld);go=gi(fld);bo=bi(fld)' \
55 <                -e 'odd=.5*y-floor(.5*y)-.25' -e 'fld=if(odd,1,2)' \
54 >        if ($curfr < 10) then
55 >                set fid=000$curfr
56 >        else if ($curfr < 100) then
57 >                set fid=00$curfr
58 >        else if ($curfr < 1000) then
59 >                set fid=0$curfr
60 >        else
61 >                set fid=$curfr
62 >        endif
63 >        set outf="${basenm}C$fid.$ext"
64 >        if ($?outfile) set outf=$outfile:q
65 >        pcomb -e 'ro=ri(fld); go=gi(fld); bo=bi(fld)' \
66 >                -e 'yd=yres-1-y; odd=.5*yd-floor(.5*yd)-.25' \
67 >                -e "fld=if(odd,2-$odd_first,1+$odd_first)" \
68                  $fields[$curfi]:q $fields[$nextfi]:q \
69 <                > "${basenm}C$curfr.$ext"
69 >                > $outf:q
70          if ($?remove_orig) rm $fields[$curfi]:q $fields[$nextfi]:q
71          @ curfr++
72          @ curfi = $nextfi + 1

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines