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.3 by greg, Fri Sep 2 14:43:43 2005 UTC vs.
Revision 2.7 by greg, Mon Nov 10 19:08:19 2008 UTC

# Line 10 | Line 10
10   #
11   # Written by Greg Ward for Iebele Abel in August 2005
12   #
13 < set spare_name=spare_fieldcomb_frame.pic
13 > set spare_name=spare_fieldcomb_frame.hdr
14   set odd_first=0
15   while ($#argv > 1)
16          switch ($argv[1])
# Line 23 | Line 23 | while ($#argv > 1)
23          case -e*:
24                  set odd_first=0
25                  breaksw
26 +        case -f*:
27 +                shift argv
28 +                set outfile="$argv[1]"
29 +                breaksw
30          default:
31                  if ("$argv[1]" !~ -*) break
32                  echo "Unknown option: $argv[1]"
# Line 31 | Line 35 | while ($#argv > 1)
35          shift argv
36   end
37   if ($#argv < 2) then
38 <        echo "Usage: $0 [-e|-o][-r] field1.pic field2.pic .."
38 >        echo "Usage: $0 [-e|-o][-r] [-f combined.hdr] field1.hdr field2.hdr .."
39          exit 1
40   endif
41 + if ($?outfile && $#argv > 2) then
42 +        echo "Cannot use -f option with more than two input files"
43 +        exit 1
44 + endif
45   set f1=$argv[1]:q
46   set ext=$f1:e
47   set basenm="`echo $f1:q | sed 's/[0-9]*\.'$ext'//'`"
# Line 47 | Line 55 | endif
55   set curfi=1
56   while ($curfi < $#fields)
57          @ nextfi = $curfi + 1
58 +        if ($curfr < 10) then
59 +                set fid=000$curfr
60 +        else if ($curfr < 100) then
61 +                set fid=00$curfr
62 +        else if ($curfr < 1000) then
63 +                set fid=0$curfr
64 +        else
65 +                set fid=$curfr
66 +        endif
67 +        set outf="${basenm}C$fid.$ext"
68 +        if ($?outfile) then
69 +                set outf=$outfile:q
70 +        endif
71          pcomb -e 'ro=ri(fld); go=gi(fld); bo=bi(fld)' \
72                  -e 'yd=yres-1-y; odd=.5*yd-floor(.5*yd)-.25' \
73                  -e "fld=if(odd,2-$odd_first,1+$odd_first)" \
74                  $fields[$curfi]:q $fields[$nextfi]:q \
75 <                > "${basenm}C$curfr.$ext"
75 >                > $outf:q
76          if ($?remove_orig) rm $fields[$curfi]:q $fields[$nextfi]:q
77          @ curfr++
78          @ curfi = $nextfi + 1

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines