Unverified Commit 93a48ba8 authored by Wieland Morgenstern's avatar Wieland Morgenstern Committed by GitHub

Merge pull request #98 from stitchEm/w-m/pto-parsing

PTGui file parsing with float e+ notation
parents 20b4202b 2fee5d2a
...@@ -894,7 +894,7 @@ add_subdirectory(samples/depth) ...@@ -894,7 +894,7 @@ add_subdirectory(samples/depth)
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
# libvideostitch unit tests # libvideostitch unit tests
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
if(LIB_TESTS) if(BUILD_LIB_TESTS)
add_subdirectory(src/test) add_subdirectory(src/test)
endif() endif()
......
...@@ -538,8 +538,8 @@ Potential<ReaderInputDefinition> ReaderInputDefinition::parseFromPtoLine( ...@@ -538,8 +538,8 @@ Potential<ReaderInputDefinition> ReaderInputDefinition::parseFromPtoLine(
} }
break; break;
default: default:
//[0-9.eE] //[0-9.eE+-]
if (!(('0' <= *lp && *lp <= '9') || *lp == 'e' || *lp == 'E' || *lp == '.' || *lp == '-')) { if (!(('0' <= *lp && *lp <= '9') || *lp == 'e' || *lp == 'E' || *lp == '.' || *lp == '-' || *lp == '+')) {
char c = *lp; char c = *lp;
*lp = 0; *lp = 0;
switch (state) { switch (state) {
...@@ -758,8 +758,8 @@ Potential<InputDefinition> InputDefinition::parseFromPtoLine(char* line, ...@@ -758,8 +758,8 @@ Potential<InputDefinition> InputDefinition::parseFromPtoLine(char* line,
} }
break; break;
default: default:
//[0-9.eE] //[0-9.eE+-]
if (!(('0' <= *lp && *lp <= '9') || *lp == 'e' || *lp == 'E' || *lp == '.' || *lp == '-')) { if (!(('0' <= *lp && *lp <= '9') || *lp == 'e' || *lp == 'E' || *lp == '.' || *lp == '-' || *lp == '+')) {
char c = *lp; char c = *lp;
*lp = 0; *lp = 0;
switch (state) { switch (state) {
...@@ -1062,8 +1062,8 @@ Status PanoDefinition::readParams(char* line) { ...@@ -1062,8 +1062,8 @@ Status PanoDefinition::readParams(char* line) {
} }
break; break;
default: default:
//[0-9.eE] //[0-9.eE+-]
if (!(('0' <= *lp && *lp <= '9') || *lp == 'e' || *lp == 'E' || *lp == '.' || *lp == '-')) { if (!(('0' <= *lp && *lp <= '9') || *lp == 'e' || *lp == 'E' || *lp == '.' || *lp == '-' || *lp == '+')) {
char c = *lp; char c = *lp;
*lp = 0; *lp = 0;
switch (state) { switch (state) {
......
...@@ -122,7 +122,7 @@ void ptsToPanoDefinitionTest() { ...@@ -122,7 +122,7 @@ void ptsToPanoDefinitionTest() {
"# input images:\n" "# input images:\n"
"#-dummyimage\n" "#-dummyimage\n"
"# The following line contains a 'dummy image' containing some global parameters for the project\n" "# The following line contains a 'dummy image' containing some global parameters for the project\n"
"o w1 h1 y0 r0 p0 v124.785166312651 a-0.1712794685889779 b0.6799971985994054 c-0.7660565920132166 f3 " "o w1 h1 y0 r0 p0 v1.24785166312651e+02 a-0.1712794685889779 b0.6799971985994054 c-0.7660565920132166 f3 "
"d0.0009362105412644209 e-0.0007190110954970641 g0 t0\n" "d0.0009362105412644209 e-0.0007190110954970641 g0 t0\n"
"#-imgfile 1920 1440 \"input-00.jpg\"\n" "#-imgfile 1920 1440 \"input-00.jpg\"\n"
"#-metadata -1 -1 -1 0000-00-00T00:00:00 3*8 0 -1 -1 -1 * * * curve -1 * T *\n" "#-metadata -1 -1 -1 0000-00-00T00:00:00 3*8 0 -1 -1 -1 * * * curve -1 * T *\n"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment