From: <dm...@us...> - 2008-12-29 23:05:35
|
Revision: 914 http://panotools.svn.sourceforge.net/panotools/?rev=914&view=rev Author: dmg Date: 2008-12-29 23:05:31 +0000 (Mon, 29 Dec 2008) Log Message: ----------- 2008-12-29 dmg <dmg@phosphorus> * panorama.h, math.c, adjust.c, queryfeature.c, filter.h: Finally added the architectural. Modified Paths: -------------- trunk/libpano/ChangeLog trunk/libpano/adjust.c trunk/libpano/filter.h trunk/libpano/math.c trunk/libpano/panorama.h trunk/libpano/parser.c trunk/libpano/queryfeature.c Modified: trunk/libpano/ChangeLog =================================================================== --- trunk/libpano/ChangeLog 2008-12-29 21:37:58 UTC (rev 913) +++ trunk/libpano/ChangeLog 2008-12-29 23:05:31 UTC (rev 914) @@ -1,5 +1,8 @@ 2008-12-29 dmg <dmg@phosphorus> + * panorama.h, math.c, adjust.c, queryfeature.c, filter.h: Finally + added the architectural. + * queryfeature.c (panoProjectionFeaturesQuery): Added querying features for panini; this will allow Hugin to use it. Modified: trunk/libpano/adjust.c =================================================================== --- trunk/libpano/adjust.c 2008-12-29 21:37:58 UTC (rev 913) +++ trunk/libpano/adjust.c 2008-12-29 23:05:31 UTC (rev 914) @@ -693,6 +693,11 @@ panini_erect(b/2.0, 0.0, &tx, &ty, & tpara); mp->distance = pn->width/(2.0*tx); break; + case _architectural: + tpara = 1; + arch_erect(b/2.0, 0.0, &tx, &ty, & tpara); + mp->distance = pn->width/(2.0*tx); + break; case _lambertazimuthal: tpara = 1; lambertazimuthal_erect(b/2.0, 0.0, &tx, &ty, & tpara); @@ -805,6 +810,10 @@ { SetDesc(stack[i], erect_panini, &(mp->distance) ); i++; // Convert panini to sphere } + else if(pn->format == _architectural) + { + SetDesc(stack[i], erect_arch, &(mp->distance) ); i++; // Convert arch to sphere + } else if(pn->format == _lambert) { SetDesc(stack[i], erect_lambert, &(mp->distance) ); i++; // Convert lambert to sphere @@ -982,6 +991,11 @@ panini_erect(b/2.0, 0.0, &tx, &ty, & tpara); mp->distance = pn->width/(2.0*tx); break; + case _architectural: + tpara = 1; + arch_erect(b/2.0, 0.0, &tx, &ty, & tpara); + mp->distance = pn->width/(2.0*tx); + break; case _stereographic: tpara = 1; stereographic_erect(b/2.0, 0.0, &tx, &ty, & tpara); @@ -1157,6 +1171,10 @@ { SetDesc(stack[i], panini_erect, &(mp->distance) ); i++; // Convert panini to sphere } + else if(pn->format == _architectural) + { + SetDesc(stack[i], arch_erect, &(mp->distance) ); i++; // Convert arch to sphere + } else if(pn->format == _lambert) { SetDesc(stack[i], lambert_erect, &(mp->distance) ); i++; // Convert sphere to lambert Modified: trunk/libpano/filter.h =================================================================== --- trunk/libpano/filter.h 2008-12-29 21:37:58 UTC (rev 913) +++ trunk/libpano/filter.h 2008-12-29 23:05:31 UTC (rev 914) @@ -852,7 +852,10 @@ int panini_erect ( double x_dest,double y_dest, double* x_src, double* y_src, void* params ); int erect_panini ( double x_dest,double y_dest, double* x_src, double* y_src, void* params ); +int arch_erect ( double x_dest,double y_dest, double* x_src, double* y_src, void* params ); +int erect_arch ( double x_dest,double y_dest, double* x_src, double* y_src, void* params ); + int mirror_sphere_cp ( double x_dest,double y_dest, double* x_src, double* y_src, void* params ); int mirror_pano ( double x_dest,double y_dest, double* x_src, double* y_src, void* params ); int sphere_cp_mirror ( double x_dest,double y_dest, double* x_src, double* y_src, void* params ); Modified: trunk/libpano/math.c =================================================================== --- trunk/libpano/math.c 2008-12-29 21:37:58 UTC (rev 913) +++ trunk/libpano/math.c 2008-12-29 23:05:31 UTC (rev 914) @@ -695,7 +695,40 @@ return 1; } +/** convert from erect to miller */ +int arch_erect( double x_dest,double y_dest, double* x_src, double* y_src, void* params) +{ + // params: distanceparam + double phi; + phi = y_dest/distanceparam; + if (phi < 0) { + millercylindrical_erect(x_dest, y_dest, x_src, y_src, params); + } else { + lambert_erect(x_dest, y_dest, x_src, y_src, params); + } + + return 1; +} + +/** convert from erect to miller */ +int erect_arch( double x_dest,double y_dest, double* x_src, double* y_src, void* params) +{ + // params: distanceparam + double y; + + y = y_dest/distanceparam; + if (y < 0) { + erect_millercylindrical(x_dest, y_dest, x_src, y_src, params); + } else { + erect_lambert(x_dest, y_dest, x_src, y_src, params); + } + + return 1; +} + + + /** convert from mercator to erect */ int erect_millercylindrical( double x_dest,double y_dest, double* x_src, double* y_src, void* params) { Modified: trunk/libpano/panorama.h =================================================================== --- trunk/libpano/panorama.h 2008-12-29 21:37:58 UTC (rev 913) +++ trunk/libpano/panorama.h 2008-12-29 23:05:31 UTC (rev 914) @@ -258,6 +258,7 @@ _albersequalareaconic = 17, _millercylindrical = 18, _panini = 19, + _architectural = 20, }; enum @@ -275,9 +276,10 @@ PANO_FORMAT_ALBERS_EQUAL_AREA_CONIC = 10, PANO_FORMAT_MILLER_CYLINDRICAL = 11, PANO_FORMAT_PANINI = 12, + PANO_FORMAT_ARCHITECTURAL = 13, }; -#define PANO_FORMAT_COUNT 13 +#define PANO_FORMAT_COUNT 14 // A large rectangle Modified: trunk/libpano/parser.c =================================================================== --- trunk/libpano/parser.c 2008-12-29 21:37:58 UTC (rev 913) +++ trunk/libpano/parser.c 2008-12-29 23:05:31 UTC (rev 914) @@ -495,6 +495,9 @@ case PANO_FORMAT_PANINI: gl->pano.format = _panini; break; + case PANO_FORMAT_ARCHITECTURAL: + gl->pano.format = _architectural; + break; default: PrintError( "Unknown panorama projection: %d", gl->pano.format ); return -1; @@ -993,6 +996,9 @@ case 12: p->pano.format = _panini; break; + case 13: + p->pano.format = _architectural; + break; default: PrintError( "Unknown panorama projection: %d", p->pano.format ); return -1; Modified: trunk/libpano/queryfeature.c =================================================================== --- trunk/libpano/queryfeature.c 2008-12-29 21:37:58 UTC (rev 913) +++ trunk/libpano/queryfeature.c 2008-12-29 23:05:31 UTC (rev 914) @@ -70,6 +70,7 @@ {"PanoType10","Albers Conical Equal Area"}, {"PanoType11","Miller Cylindrical"}, {"PanoType12","Panini"}, + {"PanoType13","Architectural"}, // Filter Types // fix: Fixed Windowsize // aa: Antialiasing filter with adaptive filter size @@ -308,6 +309,7 @@ "Albers Equal Area Conic", "Miller Cylindrical", "Panini", + "Architectural", }; static int panoFormatID[PANO_FORMAT_COUNT] = { @@ -323,7 +325,8 @@ _lambertazimuthal, _albersequalareaconic, _millercylindrical, - _panini + _panini, + _architectural, }; int panoProjectionFormatCount(void) @@ -366,6 +369,7 @@ break; case PANO_FORMAT_EQUIRECTANGULAR: case PANO_FORMAT_MILLER_CYLINDRICAL: + case PANO_FORMAT_ARCHITECTURAL: break; case PANO_FORMAT_PANINI: features->maxVFOV = 179; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |