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

Comparing ray/src/px/falsecolor.pl (file contents):
Revision 2.17 by greg, Wed Oct 14 02:39:10 2020 UTC vs.
Revision 2.19 by greg, Fri Nov 11 16:30:06 2022 UTC

# Line 27 | Line 27 | my $docont = '';               # Contours: -cl and -cb
27   my $doposter = 0;              # Posterization: -cp
28   my $doextrem = 0;              # Don't mark extrema
29   my $needfile = 0;
30 < my $showpal = 0;               # Show availabel colour palettes
30 > my $showpal = 0;               # Show available colour palettes
31  
32 + my @savedARGV = @ARGV;          # Save for final header
33 +
34   while ($#ARGV >= 0) {
35      $_ = shift;
36      # Options with qualifiers
# Line 118 | Line 120 | if ($needfile == 1 && $picture eq '-') {
120      close(FHpic);
121  
122      if ($cpict eq '-') {
123 <        $cpict = "$td/stdin.hdr";
123 >        $cpict = $picture;
124      }
125   }
126  
# Line 164 | Line 166 | or(a,b) : if(a,a,b);
166   EPS : 1e-7;
167   neq(a,b) : if(a-b-EPS,1,b-a-EPS);
168   btwn(a,x,b) : if(a-x,-1,b-x);
169 < clip(x) : if(x-1,1,if(x,x,0));
169 > clip(x) : min(1,max(x,0));
170   frac(x) : x - floor(x);
171   boundary(a,b) : neq(floor(ndivs*a),floor(ndivs*b));
172 < round(x):if(x-floor(x)-0.5,ceil(x),floor(x));
172 > round(x) : floor(x+.5);
173  
174   spec_red(x) = 1.6*x - .6;
175   spec_grn(x) = if(x-.375, 1.6-1.6*x, 8/3*x);
# Line 310 | Line 312 | if ($legwidth > 0) {
312      my $theight = floor($legwidth/(8/1.67));
313      my $stheight = $sheight <= $theight ? $sheight : $theight;
314      my $vlegheight = $sheight * $ndivs * (1+1.5/$ndivs);
313    my $text = "$label\n";
315      my $tslabpic = "$td/slabT.hdr";
316 <    open PSIGN, "| psign -s -.15 -cf 1 1 1 -cb 0 0 0 -h $stheight > $tslabpic";
316 <    print PSIGN "$text";
317 <    close PSIGN;
316 >    system "psign -s -.15 -cf 1 1 1 -cb 0 0 0 -h $stheight $label > $tslabpic";
317      my $loop = $ndivs+$haszero;
318      my $hlegheight = $sheight * ($loop) + $sheight * .5;
319      my $pcompost = qq[pcompos -b 0 0 0 =-0 $tslabpic 0 $hlegheight ];
# Line 328 | Line 327 | if ($legwidth > 0) {
327          }
328          # Have no more than 3 decimal places
329          $value =~ s/(\.[0-9]{$scaledigits})[0-9]*/$1/;
331        $text = "$value\n";
330          $tslabpic = "$td/slab$i.hdr";
331 <        open PSIGN, "| psign -s -.15 -cf 1 1 1 -cb 0 0 0 -h $stheight > $tslabpic";
334 <        print PSIGN "$text";
335 <        close PSIGN;
331 >        system "psign -s -.15 -cf 1 1 1 -cb 0 0 0 -h $stheight $value > $tslabpic";
332          $hlegheight = $sheight * ($loop - $i - 1) + $sheight * .5;
333          $pcompost .= qq[=-0 $tslabpic 0 $hlegheight ];
334      }
# Line 369 | Line 365 | if ($haszero < 1) {
365  
366      $cmd = qq[pcomb $pc0args $pc1args "$picture"];
367      $cmd .= qq[ "$cpict"] if ($cpict);
368 <    $cmd .= qq[ | pcompos -b 0 0 0 $scolpic 0 $sh0 +t .1 $slabinvpic 2 -1 ];
368 >    $cmd .= qq[ | pcompos -h -b 0 0 0 $scolpic 0 $sh0 +t .1 $slabinvpic 2 -1 ];
369      $cmd .= qq[ -t .5 $slabpic 0 0 - $legwidth 0];
370  
371   if ($doextrem == 1) {
# Line 403 | Line 399 | if ($doextrem == 1) {
399      $cmd .= qq[ $minvpic $minpos $maxvpic $lxmax $ymax];
400   }
401  
402 <
403 <
402 > # Clean up and simplify info header with this command
403 > $cmd .= qq[ | getinfo -r "pcompos " "falsecolor @savedARGV"];
404  
405   # Process image and combine with legend
406   system "$cmd";

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines