/[maps]/stich.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /stich.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 4 by dpavlin, Mon Oct 15 21:57:50 2007 UTC revision 10 by dpavlin, Tue Oct 16 09:27:16 2007 UTC
# Line 9  use strict; Line 9  use strict;
9  use File::Find;  use File::Find;
10  use Data::Dump qw/dump/;  use Data::Dump qw/dump/;
11  use Imager;  use Imager;
12    use Getopt::Long;
13    
14    # Mireo 1, Google 0
15    my $flip_vertical = 0;
16    
17    GetOptions(
18            'flip-vertical' => \$flip_vertical,
19    );
20    
21  my $path = shift @ARGV || die "usage: $0 path_to_dump_dir\n";  my $path = shift @ARGV || die "usage: $0 path_to_dump_dir\n";
22    
# Line 102  foreach my $tile_file ( @files ) { Line 110  foreach my $tile_file ( @files ) {
110    
111          # this is specific to globe position, I guess ... this is europe          # this is specific to globe position, I guess ... this is europe
112          my $x = ( $file_pos->{$tile_file}->{x} - $range->{min}->{x} ) / $step->{x};          my $x = ( $file_pos->{$tile_file}->{x} - $range->{min}->{x} ) / $step->{x};
113          my $y = ( $range->{max}->{y} - $file_pos->{$tile_file}->{y} ) / $step->{y};          my $y;
114            if ( $flip_vertical ) {
115                    $y = ( $range->{max}->{y} - $file_pos->{$tile_file}->{y} ) / $step->{y};
116            } else {
117                    $y = ( $file_pos->{$tile_file}->{y} - $range->{min}->{y} ) / $step->{y};
118            }
119    
120          printf("%3dx%-3d %s\n", $x, $y, $tile_file);          printf("%3dx%-3d %s\n", $x, $y, $tile_file);
121    

Legend:
Removed from v.4  
changed lines
  Added in v.10

  ViewVC Help
Powered by ViewVC 1.1.26