1 |
afe |
1.1 |
#!/usr/bin/perl |
2 |
|
|
|
3 |
|
|
$bar=10; |
4 |
|
|
@horiz=( 150, 150, 500, 500 ); |
5 |
|
|
@vert=( 180, 320, 180, 320); |
6 |
|
|
|
7 |
afe |
1.2 |
$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 |
afe |
1.1 |
|
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 |
afe |
1.2 |
$cmdconv .= "$outfile "; |
27 |
afe |
1.1 |
system $cmdconv; |
28 |
|
|
|
29 |
afe |
1.2 |
$cmddisp = "display $outfile &"; |
30 |
afe |
1.1 |
system $cmddisp; |
31 |
afe |
1.2 |
|
32 |
|
|
|
33 |
|
|
|