From: <bru...@us...> - 2011-01-08 23:34:48
|
Revision: 1314 http://panotools.svn.sourceforge.net/panotools/?rev=1314&view=rev Author: brunopostle Date: 2011-01-08 23:34:41 +0000 (Sat, 08 Jan 2011) Log Message: ----------- New ptodouble tool, complement to ptohalve Modified Paths: -------------- trunk/Panotools-Script/Changes trunk/Panotools-Script/MANIFEST trunk/Panotools-Script/Makefile.PL trunk/Panotools-Script/bin/ptohalve trunk/Panotools-Script/dos/make_exe.pl Added Paths: ----------- trunk/Panotools-Script/bin/ptodouble Modified: trunk/Panotools-Script/Changes =================================================================== --- trunk/Panotools-Script/Changes 2011-01-07 03:42:08 UTC (rev 1313) +++ trunk/Panotools-Script/Changes 2011-01-08 23:34:41 UTC (rev 1314) @@ -4,7 +4,7 @@ - Panotools::Makefile fixes for irix/solaris - tests: workaround math on Darwin - tests: Use 'copy' instead of 'cp' on windows when running tests - - new tools: ptohalve - resizes pto project files + - new tools: ptohalve and ptodouble - resizes pto project files 0.25 - Image Radius() method and Panotools::Script OptimalWidth() method Modified: trunk/Panotools-Script/MANIFEST =================================================================== --- trunk/Panotools-Script/MANIFEST 2011-01-07 03:42:08 UTC (rev 1313) +++ trunk/Panotools-Script/MANIFEST 2011-01-08 23:34:41 UTC (rev 1314) @@ -26,6 +26,7 @@ bin/ptocentre bin/ptochain bin/ptoclean +bin/ptodouble bin/ptodummy bin/ptofill bin/ptoget Modified: trunk/Panotools-Script/Makefile.PL =================================================================== --- trunk/Panotools-Script/Makefile.PL 2011-01-07 03:42:08 UTC (rev 1313) +++ trunk/Panotools-Script/Makefile.PL 2011-01-08 23:34:41 UTC (rev 1314) @@ -4,7 +4,7 @@ WriteMakefile( 'NAME' => 'Panotools::Script', 'EXE_FILES' => [ 'bin/cubic2erect', 'bin/erect2cubic', 'bin/pafextract', 'bin/pto2mk2', - 'bin/jpeg2qtvr', 'bin/erect2qtvr', 'bin/enblend-mask', 'bin/match-n-shift', 'bin/ptoset', + 'bin/jpeg2qtvr', 'bin/erect2qtvr', 'bin/enblend-mask', 'bin/match-n-shift', 'bin/ptoset', 'bin/ptodouble', 'bin/process-masks', 'bin/erect2planet', 'bin/ptograph', 'bin/ptoget', 'bin/enfuse-mask', 'bin/ptohalve', 'bin/ptochain', 'bin/ptobind', 'bin/ptofill', 'bin/gigastart', 'bin/entile', 'bin/gigatile', 'bin/tif2svg', 'bin/enblend-svg', 'bin/ptoinfo', 'bin/ptopath', 'bin/ptodummy', 'bin/ptoanchor', Added: trunk/Panotools-Script/bin/ptodouble =================================================================== --- trunk/Panotools-Script/bin/ptodouble (rev 0) +++ trunk/Panotools-Script/bin/ptodouble 2011-01-08 23:34:41 UTC (rev 1314) @@ -0,0 +1,104 @@ +#!/usr/bin/perl +use strict; +use warnings; +use Panotools::Script; +use Getopt::Long; +use Pod::Usage; + +my $path_output; +my $help = 0; + +GetOptions ('o|output=s' => \$path_output, + 'h|help' => \$help); + +pod2usage (-verbose => 2) if $help; + +my $path_pto = shift || pod2usage; +die "Can't find $path_pto" unless -e $path_pto; + +my $p = new Panotools::Script; +$p->Read ($path_pto); + +$p->Panorama->{w} *= 2; +$p->Panorama->{h} *= 2; + +for my $i (@{$p->Image}) +{ + $i->{w} *= 2; + $i->{h} *= 2; + $i->{d} *= 2 if $i->{d} =~ /^[-0-9.]+$/; + $i->{e} *= 2 if $i->{e} =~ /^[-0-9.]+$/; + $i->{Vx} *= 2 if $i->{Vx} =~ /^[-0-9.]+$/; + $i->{Vy} *= 2 if $i->{Vy} =~ /^[-0-9.]+$/; + + if (defined $i->{S}) + { + my @S = split (',', $i->{S}); + @S = map {int ($_ * 2)} @S; + $i->{S} = join ',', @S; + } +} + +for my $c (@{$p->Control}) +{ + $c->{x} *= 2; + $c->{y} *= 2; + $c->{X} *= 2; + $c->{Y} *= 2; +} + +for my $k (@{$p->Mask}) +{ + my $string = $k->{p}; + $string =~ s/"//g; + my @p = split (' ', $string); + @p = map {int ($_ * 2)} @p; + $k->{p} = '"'. (join ' ', @p) .'"'; +} + +$p->Write ($path_output); + +exit 0; + +__END__ + +=head1 NAME + +ptodouble - rescale a panorama project + +=head1 SYNOPSIS + +ptodouble [options] --output doubled.pto project.pto + + Options: + -o | --output Filename of scaled project (can be the the same as the input) + -h | --help Outputs help documentation + +=head1 DESCRIPTION + +B<ptodouble> takes a hugin .pto project and doubles all pixel dimensions. +You will need to rescale the photos to match: + + mogrify -geometry 200% *.JPG + +Note, this tool is useful in conjunction with the L<ptohalve> tool which +performs the opposite transform. + +=head1 LICENSE + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +=head1 SEE ALSO + +L<http://hugin.sourceforge.net/> + +L<ptohalve> + +=head1 AUTHOR + +Bruno Postle - January 2011. + +=cut Property changes on: trunk/Panotools-Script/bin/ptodouble ___________________________________________________________________ Added: svn:executable + * Modified: trunk/Panotools-Script/bin/ptohalve =================================================================== --- trunk/Panotools-Script/bin/ptohalve 2011-01-07 03:42:08 UTC (rev 1313) +++ trunk/Panotools-Script/bin/ptohalve 2011-01-08 23:34:41 UTC (rev 1314) @@ -70,10 +70,10 @@ =head1 SYNOPSIS -ptoclean [options] --output halved.pto project.pto +ptohalve [options] --output halved.pto project.pto Options: - -o | --output Filename of pruned project (can be the the same as the input) + -o | --output Filename of scaled project (can be the the same as the input) -h | --help Outputs help documentation =head1 DESCRIPTION @@ -84,6 +84,9 @@ mogrify -geometry 50% *.JPG +Note, this tool is useful in conjunction with the L<ptodouble> tool which +performs the opposite transform. + =head1 LICENSE This program is free software; you can redistribute it and/or @@ -95,6 +98,8 @@ L<http://hugin.sourceforge.net/> +L<ptodouble> + =head1 AUTHOR Bruno Postle - July 2010. Modified: trunk/Panotools-Script/dos/make_exe.pl =================================================================== --- trunk/Panotools-Script/dos/make_exe.pl 2011-01-07 03:42:08 UTC (rev 1313) +++ trunk/Panotools-Script/dos/make_exe.pl 2011-01-08 23:34:41 UTC (rev 1314) @@ -29,6 +29,7 @@ ptocentre ptochain ptoclean +ptodouble ptodummy ptofill ptoget This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |