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.3 by greg, Wed Mar 23 19:33:29 2011 UTC vs.
Revision 2.4 by greg, Wed Mar 23 21:57:11 2011 UTC

# Line 18 | Line 18 | my $cpict = '';
18   my $legwidth = 100;   # Legend width and height
19   my $legheight = 200;
20   my $docont = '';    # Contours
21 < my $loff = 0;    # Offset for drop-shadow
21 > my $loff = 0;    # Offset to align with values
22   my $doextrem = 0;    # Don't mark extrema
23   my $needfile = 0;
24  
# Line 76 | Line 76 | while ($#ARGV >= 0) {
76          # Switches
77      } elsif ("$ARGV[0]" eq '-cl') {    # Contour lines
78          $docont = 'a';
79 <        $loff = 12;
79 >        $loff = 0.48;
80      } elsif ("$ARGV[0]" eq '-cb') {    # Contour bands
81          $docont = 'b';
82 <        $loff = 13;
82 >        $loff = 0.52;
83      } elsif ("$ARGV[0]" eq '-e') {
84          $doextrem = 1;
85          $needfile = 1;
# Line 232 | Line 232 | my $slabpic = "$td/slab.hdr";
232   my $cmd;
233  
234   if (($legwidth > 20) && ($legheight > 40)) {
235        # Legend: Create the background colours
236    $cmd = "pcomb $pc0args -e 'v=(y+.5)/yres;vleft=v;vright=v'";
237    $cmd .= " -e 'vbelow=(y-.5)/yres;vabove=(y+1.5)/yres'";
238    $cmd .= " -x $legwidth -y $legheight > $scolpic";
239    system $cmd;
240
235          # Legend: Create the text labels
236      my $sheight = floor($legheight / $ndivs + 0.5);
237 +    $legheight = $sheight * $ndivs;
238 +    $loff = floor($loff * $sheight + 0.5);
239      my $text = "$label";
240      for (my $i=0; $i<$ndivs; $i++) {
241          my $imap = ($ndivs - 0.5 - $i) / $ndivs;
# Line 256 | Line 252 | if (($legwidth > 20) && ($legheight > 40)) {
252      $cmd = "echo '$text' | psign -s -.15 -cf 1 1 1 -cb 0 0 0";
253      $cmd .= " -h $sheight > $slabpic";
254      system $cmd;
255 +
256 +        # Legend: Create the background colours
257 +    $cmd = "pcomb $pc0args -e 'v=(y+.5)/yres;vleft=v;vright=v'";
258 +    $cmd .= " -e 'vbelow=(y-.5)/yres;vabove=(y+1.5)/yres'";
259 +    $cmd .= " -x $legwidth -y $legheight > $scolpic";
260 +    system $cmd;
261   } else {
262          # Legend is too small to be legible. Don't bother doing one.
263      $legwidth = 0;
264      $legheight = 0;
265 +    $loff = 0;
266          # Create dummy colour scale and legend labels so we don't
267          # need to change the final command line.
268      open(FHscolpic, ">$scolpic");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines