From: <dm...@us...> - 2011-01-05 12:20:34
|
Revision: 1306 http://panotools.svn.sourceforge.net/panotools/?rev=1306&view=rev Author: dmg Date: 2011-01-05 12:20:27 +0000 (Wed, 05 Jan 2011) Log Message: ----------- added thoby projection for Nikkor 10.5 Modified Paths: -------------- trunk/libpano/CMakeLists.txt trunk/libpano/ChangeLog trunk/libpano/PTcommon.c trunk/libpano/adjust.c trunk/libpano/doc/stitch.txt trunk/libpano/filter.h trunk/libpano/math.c trunk/libpano/panorama.h trunk/libpano/parser.c Added Paths: ----------- trunk/libpano/debian/ trunk/libpano/debian/README.source trunk/libpano/debian/TODO trunk/libpano/debian/changelog trunk/libpano/debian/compat trunk/libpano/debian/control trunk/libpano/debian/copyright trunk/libpano/debian/libpano13-2.install trunk/libpano/debian/libpano13-bin.docs trunk/libpano/debian/libpano13-bin.install trunk/libpano/debian/libpano13-dev.install trunk/libpano/debian/patches/ trunk/libpano/debian/patches/10_workaround_libtool_link_as_needed_bug trunk/libpano/debian/patches/20_bumpsoname.diff trunk/libpano/debian/patches/series trunk/libpano/debian/rules trunk/libpano/debian/watch trunk/libpano/dump.c Modified: trunk/libpano/CMakeLists.txt =================================================================== --- trunk/libpano/CMakeLists.txt 2010-12-07 00:43:00 UTC (rev 1305) +++ trunk/libpano/CMakeLists.txt 2011-01-05 12:20:27 UTC (rev 1306) @@ -177,6 +177,7 @@ bmp.c ColourBrightness.c correct.c + dump.c fftn.c file.c filter.c Modified: trunk/libpano/ChangeLog =================================================================== --- trunk/libpano/ChangeLog 2010-12-07 00:43:00 UTC (rev 1305) +++ trunk/libpano/ChangeLog 2011-01-05 12:20:27 UTC (rev 1306) @@ -1,3 +1,14 @@ +2011-01-05 <dm...@uv...> + + * doc/stitch.txt: updated for new projection. + + * dump.c, dump.f: Functions to dump the contents of internal + variables (for debugging purposes) + + * math.c (thoby_sphere_tp, sphere_tp_thoby), adjust.c, parser.c, + filter.h, panorama.h: implemented Michel Thoby projection for + Nikkor 10.5, which is called Thoby Projection, and number 20. + 2010-04-27 dmg <dm...@uv...> * jpeg.c: Removed dependency from file which was braking build Modified: trunk/libpano/PTcommon.c =================================================================== --- trunk/libpano/PTcommon.c 2010-12-07 00:43:00 UTC (rev 1305) +++ trunk/libpano/PTcommon.c 2011-01-05 12:20:27 UTC (rev 1306) @@ -533,6 +533,7 @@ newX = (int)(Dx2 + 0.5 + sw2); newY = (int)(Dy2 + 0.5 + sh2); + #ifdef XXXXX if (newX != x || newY != y) { printf(" X,Y: %7.1f,%7.1f (%5d,%5d) -> OUT: %9.1f, %9.1f inv -> %9.1f %9.1f (%5d, %5d) -- error %5d,%5d\n", x_d, y_d, @@ -544,6 +545,7 @@ newY - y ); } + #endif // If this assertion fails, there is an error. The question is, how big? See the values above. // it is possible that the error is so small that it does not matter. /* Modified: trunk/libpano/adjust.c =================================================================== --- trunk/libpano/adjust.c 2010-12-07 00:43:00 UTC (rev 1305) +++ trunk/libpano/adjust.c 2011-01-05 12:20:27 UTC (rev 1306) @@ -774,6 +774,9 @@ case _orthographic: mp->distance = (double) pn->width / (2.0 * sin(b/2.0)); break; + case _thoby: + mp->distance = (double) pn->width / (2.0 * THOBY_K1_PARM * sin(b * THOBY_K2_PARM/2.0)); + break; case _biplane: biplane_distance(pn->width,b,mp); break; @@ -812,6 +815,9 @@ case _orthographic: mp->scale[0] = (double) image_selection_width / (2.0 * sin(a/2.0)) / mp->distance; break; + case _thoby: + mp->scale[0] = (double) image_selection_width / (2.0 * THOBY_K1_PARM * sin(a * THOBY_K2_PARM /2.0)) / mp->distance; + break; case _stereographic: mp->scale[0] = (double) image_selection_width / (4.0 * tan(a/4.0)) / mp->distance; break; @@ -912,6 +918,11 @@ SetDesc(stack[i], sphere_tp_orthographic, &(mp->distance) ); i++; // Convert fisheye orthographic to spherical SetDesc(stack[i], erect_sphere_tp, &(mp->distance) ); i++; // Convert spherical to equirect } + else if(pn->format == _thoby) + { + SetDesc(stack[i], sphere_tp_thoby, &(mp->distance) ); i++; // Convert thoby to spherical + SetDesc(stack[i], erect_sphere_tp, &(mp->distance) ); i++; // Convert spherical to equirect + } else if(pn->format == _mercator) { SetDesc(stack[i], erect_mercator, &(mp->distance) ); i++; // Convert mercator to equirect @@ -1017,6 +1028,10 @@ { SetDesc(stack[i], orthographic_sphere_tp, &(mp->distance) ); i++; // Convert spherical to orthographic } + else if (im->format == _thoby) + { + SetDesc(stack[i], thoby_sphere_tp, &(mp->distance) ); i++; // Convert spherical to thoby + } else if (im->format == _equisolid) { SetDesc(stack[i], erect_sphere_tp, &(mp->distance) ); i++; // Convert spherical to equirectangular @@ -1207,6 +1222,9 @@ case _orthographic: mp->distance = (double) pn->width / (2.0 * sin(b/2.0)); break; + case _thoby: + mp->distance = (double) pn->width / (2.0 * THOBY_K1_PARM * sin(b * THOBY_K2_PARM/2.0)); + break; case _biplane: biplane_distance(pn->width,b,mp); break; @@ -1243,6 +1261,9 @@ case _orthographic: mp->scale[0] = (double) im->width / (2.0 * sin(a/2.0)) / mp->distance; break; + case _thoby: + mp->scale[0] = (double) im->width / (2.0 * THOBY_K1_PARM * sin(a * THOBY_K2_PARM/2.0)) / mp->distance; + break; case _stereographic: mp->scale[0] = (double) im->width / (4.0 * tan(a/4.0)) / mp->distance; break; @@ -1364,9 +1385,13 @@ { SetDesc(stack[i], sphere_tp_orthographic, &(mp->distance) ); i++; // Convert orthographic to spherical } - else if (im->format == _stereographic) // Fisheye orthographic image + else if (im->format == _thoby) // thoby projected image { - SetDesc(stack[i], erect_stereographic, &(mp->distance) ); i++; // Convert orthographic to spherical + SetDesc(stack[i], sphere_tp_thoby, &(mp->distance) ); i++; // Convert thoby to spherical + } + else if (im->format == _stereographic) // Fisheye stereographic image + { + SetDesc(stack[i], erect_stereographic, &(mp->distance) ); i++; // Convert stereographic to spherical SetDesc(stack[i], sphere_tp_erect, &(mp->distance) ); i++; // Convert equirectangular to spherical } @@ -1455,6 +1480,11 @@ SetDesc(stack[i], sphere_tp_erect, &(mp->distance) ); i++; // Convert equirectangular to spherical SetDesc(stack[i], orthographic_sphere_tp, &(mp->distance) ); i++; // Convert spherical to orthographic } + else if(pn->format == _thoby ) + { + SetDesc(stack[i], sphere_tp_erect, &(mp->distance) ); i++; // Convert equirectangular to spherical + SetDesc(stack[i], thoby_sphere_tp, &(mp->distance) ); i++; // Convert spherical to thoby + } else if(pn->format == _biplane) { SetDesc(stack[i], biplane_erect, mp ); i++; // Convert equirectangular to biplane @@ -2972,7 +3002,7 @@ g->im[i].format != _fisheye_circ && g->im[i].format != _fisheye_ff && g->im[i].format != _equirectangular && g->im[i].format != _orthographic && g->im[i].format != _mirror && g->im[i].format != _stereographic && - g->im[i].format != _equisolid) + g->im[i].format != _equisolid && g->im[i].format != _thoby) err = 7; } Added: trunk/libpano/debian/README.source =================================================================== --- trunk/libpano/debian/README.source (rev 0) +++ trunk/libpano/debian/README.source 2011-01-05 12:20:27 UTC (rev 1306) @@ -0,0 +1,4 @@ +This debian package is using cdbs with quilt as patch management system. + +debian/rules patch produces a patched source directory, see quilt's +documentation for how to manage/add patches. Added: trunk/libpano/debian/TODO =================================================================== --- trunk/libpano/debian/TODO (rev 0) +++ trunk/libpano/debian/TODO 2011-01-05 12:20:27 UTC (rev 1306) @@ -0,0 +1,13 @@ +TODO for libpano13: +------------------- + + * Check whether relibtoolizing would help getting rid of the rpath + set on some architectures, instead of using chrpath. + * [Upstream#1861166] Needed LIBS="-lm" option for ./configure. + * [BTS#347650] Additional linking even with -Wl,--as-needed because + of libtool's reordering its arguments. Keep an eye on this bug so + as to drop the workaround once the bug is closed (if ever): + - debian/patches/10_workaround_libtool_link_as_needed_bug. + * Eventually move GPLv2+ to GPL-2+. + + -- Cyril Brulebois <cyr...@en...> Tue, 25 Dec 2007 23:02:45 +0100 Added: trunk/libpano/debian/changelog =================================================================== --- trunk/libpano/debian/changelog (rev 0) +++ trunk/libpano/debian/changelog 2011-01-05 12:20:27 UTC (rev 1306) @@ -0,0 +1,170 @@ +libpano13 (2.9.15~beta2-1) experimental; urgency=low + + * New upstream version. + * Drop patches applied upstream: + + 20_libpano13+kbsd.diff + + 30_undo_soname.bump + * 20_bumpsoname.diff: Bump soname, now that the ABI really has changed. + * Change library packagename to match soname. + * Tighten libpano13-2 shlibs file to exactly match upstream version while + still preserving binNMU-ability. Upstream might break the ABI another time + without wanting to change the soname again before 2.9.15 is finally + released. This tight dependency should be removed after the final release. + + -- Andreas Metzler <ame...@de...> Thu, 17 Sep 2009 15:20:46 +0200 + +libpano13 (2.9.15~beta1-1) experimental; urgency=low + + * New upstream pre-release. + + debian/patches/30_undo_soname.bump - Undo unnecessary soname change. + + Bump shlibs. (Newly added function.) + + Ship newly available pkgconfig file. + * Run upstream testsuite. Since it requires tiffcmp add libtiff-tools to + build-depends. The upstream tarball is incomplete, it is missing some + reference files for the testsuite. Pull them from upstream SVN and add + them to the (repackaged) tarball. + + -- Andreas Metzler <ame...@de...> Mon, 14 Sep 2009 10:29:22 +0200 + +libpano13 (2.9.14-2) unstable; urgency=low + + * Stop shipping la file in -dev package. (Squeeze release goal). + * debian/patches/20_libpano13+kbsd.diff - Fix FTBFS on GNU/kFreeBSD. Patch + by Cyril Brulebois. Closes: #543998 + + -- Andreas Metzler <ame...@de...> Sat, 29 Aug 2009 14:36:20 +0200 + +libpano13 (2.9.14-1) unstable; urgency=low + + * Upload to unstable. + * [Lintian] Fix typo in debian control: s/algorithmical/algorithmic/. + * Standards-Version: 3.8.2, no changes required. + * Improve on watchfile to handle rc and beta versions. + + -- Andreas Metzler <ame...@de...> Sun, 09 Aug 2009 14:01:24 +0200 + +libpano13 (2.9.14~rc1-1) experimental; urgency=low + + * New upstream prerelease. + + New soname due to ABI breakage (new member in public struct). Change + package name of library package. + + Does not contain non-free files PixMap.c PixMap.h, no need for .dfsg + version anymore. Also does away with the need for a complex + get-orig-source + target. + + debian/manpages/* now shipped in upstream-tarball. Adapt build-system + accordingly. + * [lintian] Add ${misc:Depends}. + * Standards version 3.8.1. + + [debian/control] Add Homepage field. + + Add rudimentary debian/README.source, basically pointing to quilt + documentation. + + -- Andreas Metzler <ame...@de...> Sun, 03 May 2009 19:56:34 +0200 + +libpano13 (2.9.12.dfsg-2) unstable; urgency=low + + * Drop Java support altogether (Closes: #477884). While checking that + bugreport, it appeared that “HasJava” is only used in a single source + file, which happens to be commented out. + - debian/control: Drop libgcj-dev from Build-Depends. + - debian/rules: Turn “--with-java” into “--without-java”. + - debian/rules: Not bumping shlibs since no symbols changed (as + expected given the above explanation). + * Update my mail address in Uploaders. + + -- Cyril Brulebois <ki...@de...> Sat, 26 Apr 2008 12:29:49 +0200 + +libpano13 (2.9.12.dfsg-1) unstable; urgency=low + + * Initial release (Closes: #433261), based on libpano12/2.8.6-0.1. + * Repack because of the license of PixMap.{c,h}. These files seem to be + needed only on Mac anyway: + - Add a get-orig-source target to debian/rules. + - Add version mangling to debian/watch. + * The following glitches have been forwarded upstream so that these + files will get proper copyright and license statements in further + releases: + - Copyright years are missing for jpegicc.{c,h}. + - Copyright and license are missing for f2c.h. This file is available + in the libf2c2 source package, and its copyright file has been used + to complete this one. + - Copyright and license are missing for rgbe.{c,h}. These files are + available in the enblend source package, and its copyright file has + been used to complete this one. The copyright by Bruce Walter is + the original copyright notice, these files are now public domain. + * Move from libpano12 to libpano13: + - Update debian/copyright. + - Update debian/watch, get rid of “debian uupdate”. + - Update package names in debian/control, and clear the following + fields: Provides, Conflicts, Replaces. + - Add “Conflicts: libpano12-bin” and “Replaces: libpano12-bin” to + libpano13-bin. + - Rename debian/libpano12* into debian/libpano13*. + - Update debian/libpano13-bin.install: + - Rename pano12info into panoinfo. + - Rename PTOptimizer into PToptimizer. + - Update debian/libpano13-bin.manpages accordingly. + - Rename the manpages accordingly. + - Update debian/manpages/panoinfo.1. + - Update debian/manpages/PToptimizer.1. + * debian/rules adjustments: + - Delete unneeded variable declarations (major, version). + - Delete useless comments. + - Delete trailing spaces. + * Move Maintainer to the pkg-phototools team, add Florent Bayle and + myself to Uploaders. + * Bump Standards-Version to 3.7.3 (no change needed). + * Add Vcs-Git and Vcs-Browser. Note that both libpano12 and libpano13 + are maintained within the same libpano.git repository. + * Bump debhelper compatibility from 4 to 5. Changes needed: + - Remove “usr/lib/pkgconfig/*” from debian/libpano13-dev.install + since “--fail-missing” is now the default behaviour of dh_install. + * Use “LDFLAGS="-Wl,--as-needed"” on the ./configure line to avoid extra + linking. + * To achieve that, it is needed to patch config/ltmain.sh (libtool) + because of very long-standing (and will-be-very-long-standing) libtool + bug, see #347650: + - Add quilt as Build-Depends, and to debian/rules. + - Add 10_workaround_libtool_link_as_needed_bug to workaround libtool + bug. + - Add a TODO item about that bug, basically “keep an eye on it in + case it ever gets fixed”. + * Since that might break things sometimes, add “-Wl,-z,defs” before + “-Wl,--as-needed”, so as to catch undefined references as early as + possible in the build process. That done, it appears that “-lm” is + missing, thus: add “LIBS="-lm"” on the ./configure line. + * Remove debian/*.dirs files, since they aren't needed. + * Clear the rpath set on some architectures (e.g. amd64) instead of + relibtoolizing (at least at the moment): + - Add chrpath to Build-Depends. + - Add “chrpath -d” calls on debian/tmp/usr/{bin/*,lib/*.so} after + the “make install” call. + - Add a TODO item about that. + * Switch from plain debhelper to cdbs. The build is conventional enough + to drop lengthy makefiles in favour of shorter ones: + - Add cdbs to Build-Depends. + - Add autotools-dev as well, to get config.{guess,sub} updated during + the build. + - Use only some includes and variables in debian/rules, but keep the + additional get-orig-source target. + - Drop debian/libpano13-0.docs, cdbs is smart enough to install those + files. + - A single trick is needed: dh_install is called for each binary + when using debhelper.mk, which makes the use of “--*-missing” a + bit tricky. That's why a hook between “make install” and “dh_*” + is needed, removing the RPATH's as well running dh_install with + one of the “--*-missing” option. This is cdbs's #461368. + * Ship all binaries, using a wildcard in debian/libpano13-bin.install. + * Update the long description of libpano13-bin accordingly, listing all + binaries along with an oneliner description for each. + * Write manpages for all binaries, in the perlpod format. Generate them + using pod2man at build-time. Ship them through libpano13.manpages, by + using a wildcard. + * Get rid of strange (strictly-versioned) interdependencies, leading to + a dependency loop: + - Remove “Suggests: libpano13-dev” from libpano13-0. + - Downgrade “Recommends: libpano13-bin” to a “Suggests:”, still in + libpano13-0. + + -- Cyril Brulebois <cyr...@en...> Thu, 24 Jan 2008 23:37:28 +0100 Added: trunk/libpano/debian/compat =================================================================== --- trunk/libpano/debian/compat (rev 0) +++ trunk/libpano/debian/compat 2011-01-05 12:20:27 UTC (rev 1306) @@ -0,0 +1 @@ +5 Added: trunk/libpano/debian/control =================================================================== --- trunk/libpano/debian/control (rev 0) +++ trunk/libpano/debian/control 2011-01-05 12:20:27 UTC (rev 1306) @@ -0,0 +1,58 @@ +Source: libpano13 +Section: libs +Priority: optional +Maintainer: Debian PhotoTools Maintainers <pkg...@li...> +Uploaders: Cyril Brulebois <ki...@de...>, Florent Bayle <fb...@bi...>, Andreas Metzler <ame...@de...> +Build-Depends: debhelper (>= 5), quilt, libpng12-dev, libjpeg62-dev, libtiff4-dev, autotools-dev, libtiff-tools +Standards-Version: 3.8.3 +Vcs-Browser: http://git.debian.org/?p=pkg-phototools/libpano.git +Vcs-Git: git://git.debian.org/git/pkg-phototools/libpano.git +Homepage: http://panotools.sourceforge.net/ + +Package: libpano13-dev +Section: libdevel +Architecture: any +Depends: libpano13-2 (= ${binary:Version}), ${misc:Depends} +Description: panorama tools library development files + This package contains the panoramatools library. It provides basic + algorithmic tools to generate, edit and transform many kinds of + panoramic images. + . + This package holds static libraries and headers needed by developers + who wish to use libpano13 in their programs. + +Package: libpano13-2 +Section: libs +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Suggests: libpano13-bin +Description: panorama tools library + This package contains the panoramatools library. It provides basic + algorithmic tools to generate, edit and transform many kinds of + panoramic images. + . + Panorama Tools was originally created by Professor Helmut Dersch of the + University of Applied Sciences Furtwangen. Professor Dersch's site no + longer has links to download the tools, which is why this panotools + sourceforge project exists. + +Package: libpano13-bin +Section: graphics +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Conflicts: libpano12-bin +Replaces: libpano12-bin +Description: panorama tools utilities + This package contains the following tools, all part of the Panorama Tools + library, and supposed to make it easy to work with panoramic images: + * panoinfo - List details about the libpano13 library + * PTblender - Colour and brightness correction of panoramas + * PTcrop - Crop TIFF images + * PTinfo - Display information about a panotools-generated image + * PTmasker - Compute stitching masks + * PTmender - Replacement for PTStitcher + * PToptimizer - Wrapper around control point optimization routines + * PTroller - Merge several images into a single one + * PTtiff2psd - Convert a set of TIFF files into a Photoshop PSD file + * PTtiffdump - Compare two TIFF images + * PTuncrop - Uncrop TIFF images Added: trunk/libpano/debian/copyright =================================================================== --- trunk/libpano/debian/copyright (rev 0) +++ trunk/libpano/debian/copyright 2011-01-05 12:20:27 UTC (rev 1306) @@ -0,0 +1,127 @@ +This package is based on the libpano12 package, debianized by Florent +Bayle <fb...@bi...> on Fri, 29 Apr 2005 19:01:28 +0200. + +It was downloaded from <http://sourceforge.net/projects/panotools/>. + +Upstream Authors and Copyright Holders: + + Daniel M. German <dmg...@uv...>, 2005-2006 + Jim Watters <jim...@ro...>, 2003-2007 + Bruno Postle <br...@po...>, 2006 + Max Lyons <max...@ta...>, 2006 + + +Other Authors: + + Helmut Dersch <de...@fh...>, 1998-2006 + Author of PTStitcher (licensed under the same terms), from + which some parts of code are borrowed. + Tom Lane, Marti Maria + See jpegicc.* below. + Kevin Kratzke + Rik Littlefield + Fulvio Senore + Thomas Rauscher + Pablo d'Angelo + Bret McKee + Robert Platt + + +Copyright: + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUTANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + 02110-1301, USA. + +On Debian systems, the complete text of the GNU General Public License +can be found in /usr/share/common-licenses/GPL file. + + +Some parts of the software are derived from other sources, which are +distributed under different copyrights. These are: + +(1) The public domain Levenberg-Marquardt solver of the Argonne + National Laboratories MINPACK mathematical library, C translation + by Steve Moshier (file lmdif.c). + +(2) Fast fourier transformation (fftn.c, fftn.h), code by: + RC Singleton, Stanford Research Institute, Sept. 1968 + Copyright MJ Olesen, Queen's University at Kingston, 1995-97. + +Licence: + + Permission to use, copy, modify, and distribute this software for + any purpose without fee is hereby granted, provided that this + entire notice is included in all copies of any software which is + or includes a copy or modification of this software and in all + copies of the supporting documentation for such software. + + THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR + IMPLIED WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR QUEEN'S + UNIVERSITY AT KINGSTON MAKES ANY REPRESENTATION OR WARRANTY OF ANY + KIND CONCERNING THE MERCHANTABILITY OF THIS SOFTWARE OR ITS + FITNESS FOR ANY PARTICULAR PURPOSE. + + All of which is to say that you can do what you like with this + source code provided you don't try to sell it as your own and you + include an unaltered copy of this message (including the + copyright). + + It is also implicitly understood that bug fixes and improvements + should make their way back to the general Internet community so + that everyone benefits. + + + +Files: jpegicc.c, jpegicc.h: +Copyright: Tom Lane + Marti Maria +License: GPL-2+ + | This source file was originally part of the LCMS package. I asked + | Marti for permission to change its license from MIT to GPL (Aug 4, + | 2006). -- Daniel German + + + +Files: f2c.h +Copyright: © 1990-1995 AT&T Bell Laboratories and Bellcore +License: + | Permission to use, copy, modify, and distribute this software + | and its documentation for any purpose and without fee is hereby + | granted, provided that the above copyright notice appear in all + | copies and that both that the copyright notice and this + | permission notice and warranty disclaimer appear in supporting + | documentation, and that the names of AT&T Bell Laboratories or + | Bellcore or any of their entities not be used in advertising or + | publicity pertaining to distribution of the software without + | specific, written prior permission. + | + | AT&T and Bellcore disclaim all warranties with regard to this + | software, including all implied warranties of merchantability + | and fitness. In no event shall AT&T or Bellcore be liable for + | any special, indirect or consequential damages or any damages + | whatsoever resulting from loss of use, data or profits, whether + | in an action of contract, negligence or other tortious action, + | arising out of or in connection with the use or performance of + | this software. + + + +Files: rgbe.c, rgbe.h +Copyright: © 1995 Bruce Walter <bj...@gr...> +License: + | The license of these files has been clarified by Bruce Walter during + | a private email conversation. + | + | These files are public domain. Added: trunk/libpano/debian/libpano13-2.install =================================================================== --- trunk/libpano/debian/libpano13-2.install (rev 0) +++ trunk/libpano/debian/libpano13-2.install 2011-01-05 12:20:27 UTC (rev 1306) @@ -0,0 +1 @@ +usr/lib/lib*.so.* Added: trunk/libpano/debian/libpano13-bin.docs =================================================================== --- trunk/libpano/debian/libpano13-bin.docs (rev 0) +++ trunk/libpano/debian/libpano13-bin.docs 2011-01-05 12:20:27 UTC (rev 1306) @@ -0,0 +1 @@ +doc/Optimize.txt Added: trunk/libpano/debian/libpano13-bin.install =================================================================== --- trunk/libpano/debian/libpano13-bin.install (rev 0) +++ trunk/libpano/debian/libpano13-bin.install 2011-01-05 12:20:27 UTC (rev 1306) @@ -0,0 +1,2 @@ +usr/bin/* +usr/share/man/man1/*.1 Added: trunk/libpano/debian/libpano13-dev.install =================================================================== --- trunk/libpano/debian/libpano13-dev.install (rev 0) +++ trunk/libpano/debian/libpano13-dev.install 2011-01-05 12:20:27 UTC (rev 1306) @@ -0,0 +1,4 @@ +usr/include/* +usr/lib/lib*.a +usr/lib/lib*.so +usr/lib/pkgconfig/*.pc Added: trunk/libpano/debian/patches/10_workaround_libtool_link_as_needed_bug =================================================================== --- trunk/libpano/debian/patches/10_workaround_libtool_link_as_needed_bug (rev 0) +++ trunk/libpano/debian/patches/10_workaround_libtool_link_as_needed_bug 2011-01-05 12:20:27 UTC (rev 1306) @@ -0,0 +1,30 @@ +--- a/config/ltmain.sh 2007-12-26 07:21:34.000000000 +0100 ++++ b/config/ltmain.sh 2007-12-26 07:21:40.000000000 +0100 +@@ -1517,6 +1517,11 @@ + arg=`$echo "X$arg" | $Xsed -e "s/^ //"` + ;; + ++ -Wl,--as-needed) ++ deplibs="$deplibs $arg" ++ continue ++ ;; ++ + -Wl,*) + args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` + arg= +@@ -1853,6 +1858,15 @@ + lib= + found=no + case $deplib in ++ -Wl,--as-needed) ++ if test "$linkmode,$pass" = "prog,link"; then ++ compile_deplibs="$deplib $compile_deplibs" ++ finalize_deplibs="$deplib $finalize_deplibs" ++ else ++ deplibs="$deplib $deplibs" ++ fi ++ continue ++ ;; + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" Added: trunk/libpano/debian/patches/20_bumpsoname.diff =================================================================== --- trunk/libpano/debian/patches/20_bumpsoname.diff (rev 0) +++ trunk/libpano/debian/patches/20_bumpsoname.diff 2011-01-05 12:20:27 UTC (rev 1306) @@ -0,0 +1,37 @@ +diff -NurBBp a/Makefile.am b/Makefile.am +--- a/Makefile.am 2009-09-14 21:54:06.000000000 +0200 ++++ b/Makefile.am 2009-09-17 16:33:51.000000000 +0200 +@@ -64,7 +64,7 @@ endif + if HAVE_LINUX + LIN_SRC = sys_ansi.c ppm.c + LIN_DEFS = -D__Ansi__=1 +-LIN_LDFS = -version-info 1:0:0 ++LIN_LDFS = -version-info 2:0:0 + + install-exec-hook: + @true +@@ -74,7 +74,7 @@ endif + if HAVE_DARWIN + DAR_SRC = sys_ansi.c ppm.c + DAR_DEFS = -D__Ansi__=1 +-DAR_LDFS = -version-info 1:0:0 ++DAR_LDFS = -version-info 2:0:0 + + install-exec-hook: + @true +diff -NurBBp a/Makefile.in b/Makefile.in +--- a/Makefile.in 2009-09-16 19:53:37.000000000 +0200 ++++ b/Makefile.in 2009-09-17 16:34:12.000000000 +0200 +@@ -295,10 +295,10 @@ SYS_HDR = sys_X11.h sys_ansi.h sys_mac.h + @HAVE_MAC_TRUE@MAC_HDR = + @HAVE_LINUX_TRUE@LIN_SRC = sys_ansi.c ppm.c + @HAVE_LINUX_TRUE@LIN_DEFS = -D__Ansi__=1 +-@HAVE_LINUX_TRUE@LIN_LDFS = -version-info 1:0:0 ++@HAVE_LINUX_TRUE@LIN_LDFS = -version-info 2:0:0 + @HAVE_DARWIN_TRUE@DAR_SRC = sys_ansi.c ppm.c + @HAVE_DARWIN_TRUE@DAR_DEFS = -D__Ansi__=1 +-@HAVE_DARWIN_TRUE@DAR_LDFS = -version-info 1:0:0 ++@HAVE_DARWIN_TRUE@DAR_LDFS = -version-info 2:0:0 + AM_CPPFLAGS = $(JAVA_FLAGS) $(JPEG_FLAGS) $(PNG_FLAGS) $(TIFF_FLAGS) $(ZLIB_FLAGS) $(WIN_DEFS) $(LIN_DEFS) $(DAR_DEFS) $(ENDIAN_FLAG) + lib_LTLIBRARIES = libpano13.la + libpano13_la_SOURCES = $(STD_SRC) $(JAVA_SRC) $(X11_SRC) $(WIN_SRC) $(MAC_SRC) $(LIN_SRC) $(DAR_SRC) Added: trunk/libpano/debian/patches/series =================================================================== --- trunk/libpano/debian/patches/series (rev 0) +++ trunk/libpano/debian/patches/series 2011-01-05 12:20:27 UTC (rev 1306) @@ -0,0 +1,2 @@ +10_workaround_libtool_link_as_needed_bug +20_bumpsoname.diff Added: trunk/libpano/debian/rules =================================================================== --- trunk/libpano/debian/rules (rev 0) +++ trunk/libpano/debian/rules 2011-01-05 12:20:27 UTC (rev 1306) @@ -0,0 +1,57 @@ +#!/usr/bin/make -f + +# We don't use tarball.mk but there's a .tgz in the way +DEB_TARBALL= + +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/rules/patchsys-quilt.mk +include /usr/share/cdbs/1/class/autotools.mk + + +# For the repack: package name, mangled upstream version, non-free files +PACKAGE=libpano13 +VERSION=$(shell dpkg-parsechangelog | perl -ne 'print "$$1\n" if (/^Version: (.*?)(?:\.dfsg)?\-.*?$$/)') + + +# --{list,fail}-missing don't make sense when dh_install is called for each +# package rather than once for all. See the hook below, only used to check +# the list of installed files. This is cdbs's #461368. +DEB_DH_INSTALL_ARGS=--autodest --sourcedir=debian/tmp + +# What to pass to ./configure +DEB_CONFIGURE_EXTRA_FLAGS= \ + --prefix=/usr \ + --enable-shared \ + --enable-static \ + --with-jpeg \ + --with-png \ + --with-tiff \ + --with-zlib \ + --without-java + +# Could be merged into the former, but cleaner this way +DEB_CONFIGURE_SCRIPT_ENV += \ + LDFLAGS="-Wl,-z,defs -Wl,--as-needed" \ + LIBS="-lm" + +DEB_DH_MAKESHLIBS_ARGS_libpano13-2 := -V 'libpano13-2 (>=2.9.15~beta2-0), libpano13-2 (<<2.9.15~beta3-0)' +DEB_MAKE_CHECK_TARGET = check + + +# Between "make install" and "dh_*" calls +common-install-arch:: + # Clear the rpath set on some architectures (e.g. amd64) + chrpath -d $(CURDIR)/debian/tmp/usr/bin/* + chrpath -d $(CURDIR)/debian/tmp/usr/lib/*.so + + rm -f $(CURDIR)/debian/tmp/usr/lib/*.la + + # Check the list of installed files, see the comment above the + # DEB_DH_INSTALL_ARGS declaration + dh_install --fail-missing $(DEB_DH_INSTALL_ARGS) + +# Build the DFSG-free source tarball +get-orig-source: + # Download + uscan --force-download --rename + Added: trunk/libpano/debian/watch =================================================================== --- trunk/libpano/debian/watch (rev 0) +++ trunk/libpano/debian/watch 2011-01-05 12:20:27 UTC (rev 1306) @@ -0,0 +1,5 @@ +version=3 + +opts=dversionmangle=s/\.dfsg$//,\ +uversionmangle=s/_rc/~rc/;s/_beta/~beta/ \ +http://sf.net/panotools/libpano13-(.*)\.tar\.gz Modified: trunk/libpano/doc/stitch.txt =================================================================== --- trunk/libpano/doc/stitch.txt 2010-12-07 00:43:00 UTC (rev 1305) +++ trunk/libpano/doc/stitch.txt 2011-01-05 12:20:27 UTC (rev 1306) @@ -118,7 +118,9 @@ # 8 - Fisheye Orthographic (This is only allowed in PTStereo and # for the first image. This indicates a map or ground plan) # 10 - Fisheye Stereographic -# 19 - Fisheye Equisolid +# 20 - Thoby Projection (rho = THOBY_K1_PARM * sin( +# theta * THOBY_K2_PARM), defaults to Nikkor 10.5 +# 21 - Fisheye Equisolid # v82 horizontal field of view of image (required) # y0 yaw angle (required) # p43 pitch angle (required) Added: trunk/libpano/dump.c =================================================================== --- trunk/libpano/dump.c (rev 0) +++ trunk/libpano/dump.c 2011-01-05 12:20:27 UTC (rev 1306) @@ -0,0 +1,255 @@ +/* + * dump.c + * + * Routines to dump data structures for debugging purposes + * + * Copyright Daniel M. German + * + * June 2010 + * + * 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. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this software; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * + * Author: Daniel M German dmgerman at uvic doooot ca + * + */ + +#include <stdio.h> +#include <assert.h> +#include "dump.h" + +#define MAX_INDENT 20 + +// Macro to generalize printing the fields. Notice the heavey use of stringification +// var can be preceeded with a cast, such as (int)var and it applies to the field +// i.e. (int)var->field due to the higher precedence of the -> operator +#define PRINT_GENERIC(field, format, var) fprintf(stderr, "%s\t" #field " " format "\n", ind, var->field) + +static void panoDumpSetIndent(char *ind, int size) +{ + assert(size < MAX_INDENT && size >= 0); + memset(ind, '\t', size); + ind[size] = 0; +} + +void panoDumpPTRect(PTRect *rect, char *label, int indent) +{ + char ind[MAX_INDENT+1]; + panoDumpSetIndent(ind, indent); + + if (label != NULL) { + fprintf(stderr, "%s%s\n", ind, label); + } + + fprintf(stderr, "%sRectangle\n", ind); + +#define PRINT_INT(a) PRINT_GENERIC(a, "%d", (int)rect) + PRINT_INT(top); + PRINT_INT(bottom); + PRINT_INT(left); + PRINT_INT(right); +#undef PRINT_INT +} + +void panoDumpCropInfo(CropInfo *crop, char *label, int indent) +{ + char ind[MAX_INDENT+1]; + panoDumpSetIndent(ind, indent); + +#define PRINT_INT(a) PRINT_GENERIC(a, "%d", (int)crop) + + fprintf(stderr, "%sCrop Info\n", ind); + PRINT_INT(full_width); + PRINT_INT(full_height); + PRINT_INT(cropped_width); + PRINT_INT(cropped_height); + PRINT_INT(x_offset); + PRINT_INT(y_offset); + +#undef PRINT_INT +} + + +void panoDumpCorrectPrefs(cPrefs *cP, char *label, int indent) +{ + char ind[MAX_INDENT+1]; + + panoDumpSetIndent(ind, indent); + int i,j; + + + +#define PRINT_INT(a) PRINT_GENERIC(a,"%d", (int)cP) +#define PRINT_F(a) PRINT_GENERIC(a,"%f", cP) + + if (label != NULL) { + fprintf(stderr, "%s%s\n", ind, label); + } + + fprintf(stderr, "%sCorrect Preferences\n", ind); + + if (cP->radial) { + for (i=0;i<3;i++) { + for (j=0;j<5;j++) { + fprintf(stderr, "%s\tradial_params[%d][%d]\t%f\n", ind, i, j, cP->radial_params[i][j]); + } + } + } + if (cP->vertical) { + for (i=0;i<3;i++) { + fprintf(stderr, "%s\tvertical_params[%d]\t%f\n", ind, i, cP->vertical_params[i]); + } + } + if (cP->horizontal) { + for (i=0;i<3;i++) { + fprintf(stderr, "%s\thorizontal_params[%d]\t%f\n", ind, i, cP->horizontal_params[i]); + } + } + + if (cP->shear) { + PRINT_F(shear_x); + PRINT_F(shear_y); + } + + if (cP->tilt) { + PRINT_F(tilt_x); + PRINT_F(tilt_y); + PRINT_F(tilt_z); + PRINT_F(tilt_scale); + } + + if (cP->trans) { + PRINT_F(trans_x); + PRINT_F(trans_y); + PRINT_F(trans_z); + } + + if (cP->test) { + PRINT_F(test_p0); + PRINT_F(test_p1); + PRINT_F(test_p2); + PRINT_F(test_p3); + } + /* I don't think these files are read as parameters... we'll see + int resize; + pt_int32 width; + pt_int32 height; + int luminance; + double lum_params[3]; + int correction_mode; + int cutFrame; + int fwidth; + int fheight; + int frame; + int fourier; + int fourier_mode; + fullPath psf; + int fourier_nf; + fullPath nff; + double filterfactor; + double fourier_frame; + */ +#undef PRINT_INT +#undef PRINT_F + +} + + + +void panoDumpImage(Image *im, char *label, int indent) +{ + char ind[MAX_INDENT+1]; + int i; + + if (im == NULL) return; + // prepare indent + + panoDumpSetIndent(ind, indent); + + if (label != NULL) { + fprintf(stderr, "%s%s\n", ind, label); + } + +#define PRINT_INT(a) PRINT_GENERIC(a,"%d", (int)im) +#define PRINT_F(a) PRINT_GENERIC(a,"%f", im) +#define PRINT_S(a) PRINT_GENERIC(a,"\"%s\"", im) + + fprintf(stderr, "%sImage Data\n", ind); + PRINT_INT(width); + PRINT_INT(height); + PRINT_INT(bytesPerLine); + PRINT_INT(bitsPerPixel); + PRINT_INT(dataSize); + PRINT_INT(dataformat); + PRINT_INT(format); + PRINT_INT(formatParamCount); + + for (i=0;i< im->formatParamCount; i++) { + fprintf(stderr, "%s\t\tformat Param[%d] %f\n", ind, i, im->formatParam[i]); + } + PRINT_F(hfov); + PRINT_F(yaw); + PRINT_F(roll); + PRINT_F(pitch); + + PRINT_S(name); + + panoDumpCorrectPrefs(&im->cP, NULL, indent+1); + panoDumpPTRect(&im->selection, NULL,indent+1); + panoDumpCropInfo(&im->cropInformation, NULL, indent+1); + +#undef PRINT_INT +#undef PRINT_F +#undef PRINT_S + +} + + +void panoDumpAdjustData(aPrefs* aP, char *label, int indent) +{ + + char ind[MAX_INDENT+1]; + + assert (aP != NULL); + + panoDumpSetIndent(ind, indent); + + if (label != NULL) { + fprintf(stderr, "%s%s\n", ind, label); + } + + fprintf(stderr, "%s\tAdjust Data\n", ind); + +#define PRINT_INT(a) PRINT_GENERIC(a,"%d", (int)aP) +#define PRINT_F(a) PRINT_GENERIC(a,"%f", aP) +#define PRINT_S(a) PRINT_GENERIC(a,"\"%s\"", aP) + + + PRINT_INT(mode); + PRINT_S(scriptFile.name); + PRINT_INT(nt); + PRINT_INT(interpolator); + PRINT_F(gamma); + PRINT_INT(fastStep); + +#undef PRINT_INT +#undef PRINT_F +#undef PRINT_S + + + panoDumpImage(&aP->im, "Input Image", indent + 1); + panoDumpImage(&aP->pano, "Panorama", indent + 1); + +} Modified: trunk/libpano/filter.h =================================================================== --- trunk/libpano/filter.h 2010-12-07 00:43:00 UTC (rev 1305) +++ trunk/libpano/filter.h 2011-01-05 12:20:27 UTC (rev 1306) @@ -916,6 +916,15 @@ int sphere_tp_orthographic( double x_dest,double y_dest, double* x_src, double* y_src, void* params); int orthographic_sphere_tp( double x_dest,double y_dest, double* x_src, double* y_src, void* params); +int sphere_tp_thoby( double x_dest,double y_dest, double* x_src, double* y_src, void* params); +int thoby_sphere_tp( double x_dest,double y_dest, double* x_src, double* y_src, void* params); + + + +#define THOBY_K1_PARM 1.47 +#define THOBY_K2_PARM 0.713 + + int rotate_erect ( double x_dest, double y_dest, double* x_src, double* y_src, void* params ); int inv_radial ( double x_dest, double y_dest, double* x_src, double* y_src, void* params ); int inv_radial_brown ( double x_dest, double y_dest, double* x_src, double* y_src, void* params ); Modified: trunk/libpano/math.c =================================================================== --- trunk/libpano/math.c 2010-12-07 00:43:00 UTC (rev 1305) +++ trunk/libpano/math.c 2011-01-05 12:20:27 UTC (rev 1306) @@ -2541,7 +2541,6 @@ return 1; } - int orthographic_sphere_tp( double x_dest,double y_dest, double* x_src, double* y_src, void* params) { // params: double distance @@ -2558,6 +2557,52 @@ return 1; } +// the Thoby projection is an empirically found projection for the Nikkor 10.5 lens +// rho = THOBY_K1_PARM * sin( theta * THOBY_K2_PARM); + +int sphere_tp_thoby( double x_dest,double y_dest, double* x_src, double* y_src, void* params) +{ + // params: double distance + + register double phi, theta, rho; +#define SCALE (((double*)params)[0]) + + rho = sqrt( x_dest*x_dest + y_dest*y_dest )/ SCALE; + + + theta = asin( rho/THOBY_K1_PARM) / THOBY_K2_PARM; + phi = atan2( y_dest , x_dest ); + + *x_src = SCALE * theta * cos( phi ); + *y_src = SCALE * theta * sin( phi ); + +#undef SCALE + + return 1; +} + + +int thoby_sphere_tp( double x_dest,double y_dest, double* x_src, double* y_src, void* params) +{ + // params: double distance + + register double rho, phi, theta; + +#define SCALE (((double*)params)[0]) + + theta = sqrt( x_dest * x_dest + y_dest * y_dest ) / SCALE; + phi = atan2( y_dest , x_dest ); + + rho = THOBY_K1_PARM * sin( theta * THOBY_K2_PARM ); + + *x_src = SCALE * rho * cos( phi ); + *y_src = SCALE * rho * sin( phi ); + +#undef SCALE + return 1; +} + + int shift_scale_rotate( double x_dest,double y_dest, double* x_src, double* y_src, void* params){ // params: double shift_x, shift_y, scale, cos_phi, sin_phi Modified: trunk/libpano/panorama.h =================================================================== --- trunk/libpano/panorama.h 2010-12-07 00:43:00 UTC (rev 1305) +++ trunk/libpano/panorama.h 2011-01-05 12:20:27 UTC (rev 1306) @@ -284,7 +284,9 @@ _equipanini = 22, _biplane = 23, _triplane = 24, - _panini_general = 25 + _panini_general = 25, + _thoby = 26, // generalizes the model found in modern fisheye lenses. It is + // parametrizable but it defaults to the Nikkor 10.5 fisheye lens }; enum @@ -306,12 +308,13 @@ PANO_FORMAT_ORTHOGRAPHIC = 14, PANO_FORMAT_EQUISOLID = 15, PANO_FORMAT_EQUI_PANINI = 16, - PANO_FORMAT_BIPLANE = 17, - PANO_FORMAT_TRIPLANE = 18, - PANO_FORMAT_PANINI_GENERAL = 19, + PANO_FORMAT_BIPLANE = 17, + PANO_FORMAT_TRIPLANE = 18, + PANO_FORMAT_PANINI_GENERAL = 19, + PANO_FORMAT_THOBY = 20, }; -#define PANO_FORMAT_COUNT 20 +#define PANO_FORMAT_COUNT 21 enum { // Enumerates external number of image f<index> @@ -324,8 +327,9 @@ IMAGE_FORMAT_FISHEYE_ORTHOGRAPHIC = 8, IMAGE_FORMAT_FISHEYE_STEREOGRAPHIC = 10, IMAGE_FORMAT_FISHEYE_EQUISOLID = 21, + IMAGE_FORMAT_FISHEYE_THOBY = PANO_FORMAT_THOBY, }; -#define IMAGE_FORMAT_COUNT 9 +#define IMAGE_FORMAT_COUNT 10 // A large rectangle Modified: trunk/libpano/parser.c =================================================================== --- trunk/libpano/parser.c 2010-12-07 00:43:00 UTC (rev 1305) +++ trunk/libpano/parser.c 2011-01-05 12:20:27 UTC (rev 1306) @@ -59,6 +59,7 @@ static int ReadModeDescription ( sPrefs *sP, char *line ); static int ReadCoordinates( CoordInfo *cp, char *line ); +static int panoExternalToInternalInputProjection(pt_int32 input); #define MY_SSCANF( str, format, ptr ) if( sscanf( str, format, ptr ) != 1 ) \ { \ @@ -283,6 +284,7 @@ case IMAGE_FORMAT_FISHEYE_ORTHOGRAPHIC: im->format = _orthographic; break; case IMAGE_FORMAT_FISHEYE_STEREOGRAPHIC: im->format = _stereographic; break; case IMAGE_FORMAT_FISHEYE_EQUISOLID: im->format = _equisolid; break; + case IMAGE_FORMAT_FISHEYE_THOBY: im->format = _thoby; exit(1);break; break; default: PrintError("Syntax error in script. Projection not known: Line %d", lineNum); goto fail; @@ -710,6 +712,9 @@ case PANO_FORMAT_ORTHOGRAPHIC: gl->pano.format = _orthographic; break; + case PANO_FORMAT_THOBY: + gl->pano.format = _thoby; + break; case PANO_FORMAT_EQUISOLID: gl->pano.format = _equisolid; break; @@ -926,6 +931,7 @@ case _biplane: format = PANO_FORMAT_BIPLANE; break; case _triplane: format = PANO_FORMAT_TRIPLANE; break; case _panini_general: format = PANO_FORMAT_PANINI_GENERAL; break; + case _thoby: format = PANO_FORMAT_THOBY; break; default: format = -1; break; } @@ -947,6 +953,7 @@ case _orthographic: format = IMAGE_FORMAT_FISHEYE_ORTHOGRAPHIC; break; case _stereographic: format = IMAGE_FORMAT_FISHEYE_STEREOGRAPHIC; break; case _equisolid: format = IMAGE_FORMAT_FISHEYE_EQUISOLID; break; + case _thoby: format = IMAGE_FORMAT_FISHEYE_THOBY; break; default: format = -1; break; } @@ -1303,6 +1310,9 @@ case PANO_FORMAT_EQUISOLID: p->pano.format = _equisolid; break; + case PANO_FORMAT_THOBY: + p->pano.format = _thoby; + break; case PANO_FORMAT_BIPLANE: p->pano.format = _biplane; break; @@ -1662,7 +1672,8 @@ int cropping = 0; int tempInt; char typeParm; - + pt_int32 tempInt32; + memcpy( &im, imPtr, sizeof(Image) ); memcpy( &sBuf, sPtr, sizeof(stBuf )); @@ -1670,7 +1681,13 @@ // printf("************************************* Before Cut Frame %d \n", im.cP.cutFrame); while( *ch != 0) { switch(*ch) { - case 'f': READ_VAR( FMT_INT32, &im.format ); + case 'f': READ_VAR( FMT_INT32, &tempInt32 ); + tempInt = panoExternalToInternalInputProjection(tempInt32); + if (tempInt < 0) { + PrintError("Syntax error in script. Projection not known: %ud", tempInt32); + return -1; + } + im.format = tempInt; if( im.format == _panorama || im.format == _equirectangular ) im.cP.correction_mode |= correction_mode_vertical; break; @@ -2388,6 +2405,10 @@ free( script ); } } + + //panoDumpAdjustData(aP, "readAdjustLine", 0); + + return aP; } @@ -2433,3 +2454,24 @@ } return NULL; } + + +int panoExternalToInternalInputProjection(pt_int32 input) +{ + // Internal and external projection do not match, unfortunately. + // So this code does the remapping + + switch (input) { + case IMAGE_FORMAT_RECTILINEAR: return(_rectilinear); + case IMAGE_FORMAT_PANORAMA: return(_panorama); + case IMAGE_FORMAT_FISHEYE_EQUIDISTANCECIRC: return(_fisheye_circ); + case IMAGE_FORMAT_FISHEYE_EQUIDISTANCEFF: return(_fisheye_ff); + case IMAGE_FORMAT_EQUIRECTANGULAR: return(_equirectangular); + case IMAGE_FORMAT_MIRROR: return(_mirror); + case IMAGE_FORMAT_FISHEYE_ORTHOGRAPHIC: return(_orthographic); + case IMAGE_FORMAT_FISHEYE_STEREOGRAPHIC: return(_stereographic); + case IMAGE_FORMAT_FISHEYE_EQUISOLID: return(_equisolid); + case IMAGE_FORMAT_FISHEYE_THOBY: return(_thoby); + default: return -1; + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |