From: <dm...@us...> - 2009-12-27 17:50:52
|
Revision: 1199 http://panotools.svn.sourceforge.net/panotools/?rev=1199&view=rev Author: dmg Date: 2009-12-27 17:50:45 +0000 (Sun, 27 Dec 2009) Log Message: ----------- Added name of projection, which I forgot to do yesterday. Added assertion that verifies I donot forget in the future Modified Paths: -------------- trunk/libpano/ChangeLog trunk/libpano/math.c trunk/libpano/queryfeature.c trunk/libpano/tools/panoinfo_unix.c Modified: trunk/libpano/ChangeLog =================================================================== --- trunk/libpano/ChangeLog 2009-12-27 10:06:13 UTC (rev 1198) +++ trunk/libpano/ChangeLog 2009-12-27 17:50:45 UTC (rev 1199) @@ -1,3 +1,11 @@ +2009-12-27 dmg <dm...@uv...> + + * queryfeature.c: Yesterday I forgot to add the name of the + projection. This patch fixes that. Fixes bug 2921848. Removed + sizes from + + + 2009-12-26 dmg <dm...@uv...> * queryfeature.c, parser.c, panorama.h, filter.h, math.c, Modified: trunk/libpano/math.c =================================================================== --- trunk/libpano/math.c 2009-12-27 10:06:13 UTC (rev 1198) +++ trunk/libpano/math.c 2009-12-27 17:50:45 UTC (rev 1199) @@ -1005,8 +1005,20 @@ x = d * tan (lambda / d); + // now compute y + /* y = (d * tan(phi)) / ( d - 1 + cos(lambda)); + */ + + if (phi != 0) { + y = tan(phi) * x/ sin(lambda); + } else { + y = tan(phi) ; + } + + + // Now rescale *y_src = distance * y; *x_src = distance * x; @@ -1069,11 +1081,21 @@ x = x_dest/distance; lambda = d * atan2(x,d); + + if (x != 0) { + phi = atan2(y * sin(lambda) * x/fabs(x), fabs(x)); + } else { + phi = atan(y); + } + /* phi = atan2(y * (d -1 + cos(lambda)), d); + */ + *lambda_src = lambda * distance; *phi_src = phi * distance; + /* if (fabs (y_dest - 0.5) < 0.01) fprintf(stderr, "Coordinates (%f,%f) (%f,%f) d %f \n", x_dest, y_dest, *lambda_src, *phi_src, d); @@ -1099,7 +1121,7 @@ temp = cos(lambdaHalf); y = tan(phi) / (temp * temp); - + // At this point we have mapped to central cylindrical, now to equirectangular *y_src = distanceparam * y; Modified: trunk/libpano/queryfeature.c =================================================================== --- trunk/libpano/queryfeature.c 2009-12-27 10:06:13 UTC (rev 1198) +++ trunk/libpano/queryfeature.c 2009-12-27 17:50:45 UTC (rev 1199) @@ -322,7 +322,7 @@ ////////////////////////////////////////////////////////////////////// -char *panoFormatNames[PANO_FORMAT_COUNT] = { +char *panoFormatNames[] = { "Rectilinear", "Cylindrical", "Equirectangular", @@ -340,11 +340,12 @@ "Orthographic", "Equisolid", "Equirectangular Panini", - "Biplane", - "Triplane", + "Biplane", + "Triplane", + "Panini General", }; -static int panoFormatID[PANO_FORMAT_COUNT] = { +static int panoFormatID[] = { _rectilinear, _panorama, _equirectangular, @@ -372,6 +373,7 @@ { // REturn the number of Projection formats available in the library assert(sizeof(panoFormatNames) == PANO_FORMAT_COUNT * sizeof(char*)); + assert(sizeof(panoFormatNames) == PANO_FORMAT_COUNT * sizeof(int)); return PANO_FORMAT_COUNT; } Modified: trunk/libpano/tools/panoinfo_unix.c =================================================================== --- trunk/libpano/tools/panoinfo_unix.c 2009-12-27 10:06:13 UTC (rev 1198) +++ trunk/libpano/tools/panoinfo_unix.c 2009-12-27 17:50:45 UTC (rev 1199) @@ -99,8 +99,8 @@ free(value); } printf(str2); - - for (i=0; i< PANO_FORMAT_COUNT; i++) { + printf("Number of projections %d\n", panoProjectionFormatCount()); + for (i=0; i< panoProjectionFormatCount(); i++) { int j; pano_projection_features features; if (!panoProjectionFeaturesQuery(i, &features) ) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |