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

Comparing ray/src/px/falsecolor.csh (file contents):
Revision 1.1 by greg, Thu May 23 13:45:18 1991 UTC vs.
Revision 1.4 by greg, Fri May 24 17:23:01 1991 UTC

# Line 8 | Line 8 | onintr quit
8   set mult=470
9   set label=Nits
10   set scale=1000
11 + set decades=0
12   set redv='2*v-1'
13   set grnv='if(v-.5,2-2*v,2*v)'
14   set bluv='1-2*v'
# Line 28 | Line 29 | while ($#argv > 0)
29                  shift argv
30                  set label="$argv[1]"
31                  breaksw
32 +        case -log:
33 +                shift argv
34 +                set decades=$argv[1]
35 +                breaksw
36          case -r:
37                  shift argv
38                  set redv="$argv[1]"
# Line 50 | Line 55 | while ($#argv > 0)
55                  breaksw
56          case -ip:
57          case -pi:
58 <                shiftargv
58 >                shift argv
59                  set picture="$argv[1]"
60                  set cpict="$argv[1]"
61                  breaksw
# Line 61 | Line 66 | while ($#argv > 0)
66                  set docont=b
67                  breaksw
68          case -n:
69 <                shiftargv
69 >                shift argv
70                  set ndivs="$argv[1]"
71 <                breadsw
71 >                breaksw
72          default:
73 <                echo bad option "'$argv[1]'"
73 >                echo bad option "'$argv[1]'" >/dev/tty
74                  exit 1
75          endsw
76          shift argv
# Line 76 | Line 81 | scale : $scale ;
81   mult : $mult ;
82   ndivs : $ndivs ;
83  
84 + norm : if(nfiles-.5, mult/scale/le(1), 0);
85 +
86   or(a,b) : if(a,a,b);
87   EPS : 1e-7;
88   neq(a,b) : if(a-b-EPS,1,b-a-EPS);
# Line 83 | Line 90 | btwn(a,b) : if(a-x,-1,b-x);
90   frac(x) : x - floor(x);
91   boundary(a,b) : neq(floor(ndivs*a),floor(ndivs*b));
92  
93 < red=$redv;
94 < grn=$grnv;
95 < blu=$bluv;
93 > map(x) = x;
94 > red = $redv;
95 > grn = $grnv;
96 > blu = $bluv;
97  
98 < v = li(1)*(mult/scale);
99 < vleft = li(1,-1,0)*(mult/scale);
100 < vright = li(1,1,0)*(mult/scale);
101 < vabove = li(1,0,1)*(mult/scale);
102 < vbelow = li(1,0,-1)*(mult/scale);
98 > v = map(li(1)*norm);
99 > vleft = map(li(1,-1,0)*norm);
100 > vright = map(li(1,1,0)*norm);
101 > vabove = map(li(1,0,1)*norm);
102 > vbelow = map(li(1,0,-1)*norm);
103   isconta = or(boundary(vleft,vright),boundary(vabove,vbelow));
104   iscontb = if(btwn(0,v,1),btwn(.4,frac(ndivs*v),.6),0);
105  
# Line 105 | Line 113 | ba = bi(nfiles);
113  
114   in = 1;
115   _EOF_
116 < set pcargs=(-o -f $tempdir/pc.cal)
116 > set pcargs=(-f $tempdir/pc.cal)
117   if ($?docont) then
118          set pcargs=($pcargs -e "in=iscont$docont")
119   endif
# Line 114 | Line 122 | if ("$cpict" == "") then
122   else if ("$cpict" == "$picture") then
123          set cpict=
124   endif
125 + if ($decades > 0) then
126 +        set pcargs=($pcargs -e "map(x)=log10(x)/$decades+1")
127 +        set imap="imap(y)=10^((y-1)*$decades)"
128 + else
129 +        set imap="imap(y)=y"
130 + endif
131   pcomb $pcargs -e 'v=(y+.5)/200;vleft=v;vright=v' \
132                  -e 'vbelow=(y-.5)/200;vabove=(y+1.5)/200' \
133                  -e 'ra=0;ga=0;ba=0' -x 100 -y 200 \
134                  > $tempdir/scol.pic
135 < (echo $label; cnt $ndivs |rcalc -e '$1='"($scale)/$ndivs*($ndivs"'-.5-$1)') \
136 <        | psign -cf 1 1 1 -cb 0 0 0 -h `ev "floor(200/$ndivs+.5)"` \
137 <                > $tempdir/slab.pic
135 > ( echo $label; cnt $ndivs \
136 >                | rcalc -e '$1='"($scale)*imap(($ndivs-.5-"'$1'")/$ndivs)" \
137 >                -e "$imap" ) \
138 >        | psign -cf 1 1 1 -cb 0 0 0 -h `ev "floor(2*200/$ndivs+.5)"` \
139 >        | pfilt -1 -x /2 -y /2 > $tempdir/slab.pic
140   pcomb $pcargs $picture $cpict \
141 <        | pcompos $tempdir/scol.pic 0 0 -t .5 $tempdir/slab.pic 25 0 - 100 0
141 >        | pcompos $tempdir/scol.pic 0 0 -t .2 $tempdir/slab.pic 25 0 - 100 0
142   quit:
143   rm -rf $tempdir

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines