1 |
#!/usr/bin/perl |
2 |
|
3 |
$bar=10; |
4 |
@horiz=( 150, 150, 500, 500 ); |
5 |
@vert=( 180, 320, 180, 320); |
6 |
|
7 |
$infile=$ARGV[0]; |
8 |
$outfile=$ARGV[1]; |
9 |
|
10 |
if (($infile eq "") || ($outfile eq "")) { |
11 |
die "Usage: addcross.pl infile outfile\n"; |
12 |
} |
13 |
|
14 |
$cmdconv="convert $infile -stroke white -strokewidth 3 "; |
15 |
|
16 |
foreach $x (@horiz) { |
17 |
$y=shift( @vert); |
18 |
|
19 |
$xh=$x+$bar; $xl=$x-$bar; |
20 |
$yh=$y+$bar; $yl=$y-$bar; |
21 |
|
22 |
$cmdconv .= "-draw \"line $xh,$y $xl,$y\" "; |
23 |
$cmdconv .= "-draw \"line $x,$yh $x,$yl\" "; |
24 |
} |
25 |
|
26 |
$cmdconv .= "$outfile "; |
27 |
system $cmdconv; |
28 |
|
29 |
$cmddisp = "display $outfile &"; |
30 |
system $cmddisp; |
31 |
|
32 |
|
33 |
|