use IO::Handle;
@ARGV==5 or die;
-($cropinfo,$forui,$matrixinfo, $height,$psdpi)=@ARGV;
+($plandatac,$forui,$matrixinfo, $height,$psdpi)=@ARGV;
open M, $matrixinfo or die $!;
$!=0; @matrix= <M>;
print STDERR join("\n",@matrix),"\n";
-open C, $cropinfo or die $!;
-while (<C>) {
- next unless m/^pnmcrop: cropping (\d+) \w+ off the (\w+)$/;
- $crop{$2}= $1;
+open C, $plandatac or die $!;
+for (;;) {
+ $!=0; defined($_=<C>) or die $!;
+ next unless m,^/\* region\: (\d+)\.\.\d+ (\d+)\.\.\d+ \*/$,;
+ $crop_x= $1;
+ $crop_y= $2;
+ last;
}
-C->error and die $!;
-close C or die $!;
+close C;
open U, $forui or die $!;
while (<U>) {
$y= $height - $y;
- $x -= $crop{'left'};
- $y -= $crop{'top'};
+ $x -= $crop_x;
+ $y -= $crop_y;
printf "%s %d %d\n", $lhs, $x, $y or die $!;
}
sed -e '1,/^%L matrix here/d' matrix-demonstrate.ps >>$@.ps.new
gs -sDEVICE=nullpage -dBATCH=1 -q $@.ps.new $o
-BASE.crop-info: BASE.testui.ppm
- @:
-
BASE.testui.ppm: BASE.pa.segenco.ppm
pnmcrop -verbose 2>&1 <$< >$@.1.new | tee BASE.crop-info
pnmflip <$@.1.new -ccw >$@.2.new
pnmpad <$@.2.new -white -l5 -r5 -t5 -b5 $o
BASE.overlay-info: genoverlayinfo \
- BASE.crop-info STEM.redacted.for-ui BASE.matrix-info
+ BASE.plandata.c STEM.redacted.for-ui BASE.matrix-info
./$^ $(PLANUI_HEIGHT) $(PLANUI_PSDPI) $o
END
}
print "#include \"plan-data-format.h\"\n" or die $!;
+print "/* region: $overall{X}{Min}..$overall{X}{Max}".
+ " $overall{Y}{Min}..$overall{Y}{Max} */\n";
cmapdata_output_all();
xpmdata_output_all();
plandata_output_all();