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 |
|
while ($#ARGV >= 0) { |
33 |
|
$_ = shift; |
164 |
|
EPS : 1e-7; |
165 |
|
neq(a,b) : if(a-b-EPS,1,b-a-EPS); |
166 |
|
btwn(a,x,b) : if(a-x,-1,b-x); |
167 |
< |
clip(x) : if(x-1,1,if(x,x,0)); |
167 |
> |
clip(x) : min(1,max(x,0)); |
168 |
|
frac(x) : x - floor(x); |
169 |
|
boundary(a,b) : neq(floor(ndivs*a),floor(ndivs*b)); |
170 |
< |
round(x):if(x-floor(x)-0.5,ceil(x),floor(x)); |
170 |
> |
round(x) : floor(x+.5); |
171 |
|
|
172 |
|
spec_red(x) = 1.6*x - .6; |
173 |
|
spec_grn(x) = if(x-.375, 1.6-1.6*x, 8/3*x); |
310 |
|
my $theight = floor($legwidth/(8/1.67)); |
311 |
|
my $stheight = $sheight <= $theight ? $sheight : $theight; |
312 |
|
my $vlegheight = $sheight * $ndivs * (1+1.5/$ndivs); |
313 |
– |
my $text = "$label\n"; |
313 |
|
my $tslabpic = "$td/slabT.hdr"; |
314 |
< |
open PSIGN, "| psign -s -.15 -cf 1 1 1 -cb 0 0 0 -h $stheight > $tslabpic"; |
316 |
< |
print PSIGN "$text"; |
317 |
< |
close PSIGN; |
314 |
> |
system "psign -s -.15 -cf 1 1 1 -cb 0 0 0 -h $stheight $label > $tslabpic"; |
315 |
|
my $loop = $ndivs+$haszero; |
316 |
|
my $hlegheight = $sheight * ($loop) + $sheight * .5; |
317 |
< |
my $pcompost = qq[pcompos -b 0 0 0 =-0 $tslabpic 0 $hlegheight ]; |
317 |
> |
my $pcompost = qq[pcompos -h -b 0 0 0 =-0 $tslabpic 0 $hlegheight ]; |
318 |
|
for (my $i=0; $i<$loop; $i++) { |
319 |
|
my $imap = ($ndivs - $i) / $ndivs; |
320 |
|
my $value = $scale; |
325 |
|
} |
326 |
|
# Have no more than 3 decimal places |
327 |
|
$value =~ s/(\.[0-9]{$scaledigits})[0-9]*/$1/; |
331 |
– |
$text = "$value\n"; |
328 |
|
$tslabpic = "$td/slab$i.hdr"; |
329 |
< |
open PSIGN, "| psign -s -.15 -cf 1 1 1 -cb 0 0 0 -h $stheight > $tslabpic"; |
334 |
< |
print PSIGN "$text"; |
335 |
< |
close PSIGN; |
329 |
> |
system "psign -s -.15 -cf 1 1 1 -cb 0 0 0 -h $stheight $value > $tslabpic"; |
330 |
|
$hlegheight = $sheight * ($loop - $i - 1) + $sheight * .5; |
331 |
|
$pcompost .= qq[=-0 $tslabpic 0 $hlegheight ]; |
332 |
|
} |