-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add SICD byte provider #202
Conversation
…s buffer, want this to be a series of pointers that are as contiguous as they can be. Also providing the offset in the file.
There is a bit more functionality I think should be added as part of this PR... you can hold off on reviewing for now - I'll let you know when it's ready. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leave a comment
* \brief Represents a sequence of buffers which appear in contiguous order | ||
* in the NITF (the underlying pointers are not contiguous) | ||
*/ | ||
struct BufferList |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this be renamed to NITFBufferList or something? I don't think this could be truly ambiguous, but I still don't like that it overlaps with the typedef in NITFWriteControl.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that is a good idea - renamed to NITFBuffer
and NITFBufferList
} | ||
} | ||
|
||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
newline at end of file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure on these? Eclipse on both Linux and Windows is showing that newline... does it just look like that on the GitHub site?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, you're right. I think I've been adding an extra newline to the end of everything...
} | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs newline
const std::string mPathname; | ||
}; | ||
|
||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs newline
return false; | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs newline
std::cerr << "Caught unknown exception\n"; | ||
return 1; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs newline
@@ -1,10 +1,10 @@ | |||
/* ========================================================================= |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm getting a compile error at line 154 on Linux. I think it doesn't like getting std::auto_ptr<six::sicd::ComplexData>
instead of std::auto_ptr<six::Data>
.
../six/modules/c++/six.sicd/tests/test_streaming_write.cpp: In instantiation of ‘void {anonymous}::Tester<DataTypeT>::normalWrite() [with DataTypeT = fl oat]’:
../six/modules/c++/six.sicd/tests/test_streaming_write.cpp:87:21: required from ‘{anonymous}::Tester<DataTypeT>::Tester(const std::vector<std::basic_string<char> >&, bool, size_t) [with DataTypeT = float; size_t = long unsigned int]’
../six/modules/c++/six.sicd/tests/test_streaming_write.cpp:304:76: required from ‘bool {anonymous}::doTests(const std::vector<std::basic_string<char> >&, bool, size_t) [with DataTypeT = float; size_t = long unsigned int]’
../six/modules/c++/six.sicd/tests/test_streaming_write.cpp:317:70: required from here
../six/modules/c++/six.sicd/tests/test_streaming_write.cpp:154:5: error: no matching function for call to ‘std::auto_ptr<six::Data>::auto_ptr(std::auto_ptr<six::Data>)’
mContainer->addData(createData<DataTypeT>(mDims));
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh that's lame (Visual Studio figures it out), but thanks for letting me know - releasing the auto_ptr
now so it can just do a simple pointer conversion (container will still take ownership).
FYI, there's still one more piece I need to add in here that I haven't had a chance to get to yet. |
…of bytes, avoiding copies where possible.
OK, this finally has everything I want to throw in here... @JonathanMeans go ahead and review when you have a chance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
c2489fe Merge pull request #208 from mdaus/polyChecks 5b6a037 Add check for Poly1D.fromArray 3e68b18 Add some safety checks when converting Polys to and from numpy arrays 41065e2 Merge pull request #206 from mdaus/remove_curl_env_pollution 2eeca61 Merge pull request #207 from mdaus/fix_include_guard 3a23d69 Fixing include guard 0682acc Need to undefine HAVE_CURL_GLOBAL_INIT or else it ends up in the waf environment 81002ad Merge pull request #205 from mdaus/cliErrorMessage 576f028 More verbose error message for invalid cli key d551442 Merge pull request #204 from mdaus/libcurl-link d54f4de Some systems require explicitly adding curl to link line 30de0ce Merge pull request #202 from mdaus/buildRefactor 499ef22 Merge pull request #203 from mdaus/install-tgt-fix 7954e52 Updated install_tgt after testing with --install-source dadd7a1 Changed input to be self instead of tsk c66b774 install_tgt does not have self as an input parameter f5d98e2 Merge pull request #201 from mdaus/pyInitFix 1a18f65 Extract another function; resolve targets_to_add/targetsToAdd naming inconsistency bdbac8f Explain the fix 5fd1058 More built-in way of guarding against double-installation 4408d50 Include whitespace change 7050277 Merge branch 'master' into pyInitFix 3a8b8b8 Only create one __init__.py per project, to prevent race conditions 2f2c23f Merge pull request #200 from mdaus/revertInit 3485d90 Revert __init__.py change bcd3b41 Merge pull request #198 from mdaus/pyInitFix d1b2a32 Merge pull request #199 from mdaus/buildRefactor 7448249 Pass an argument instead of modifying modArgs d42db38 Properly modify modArgs 7ccc3b4 Extract some repeated code into functions 99d3be0 Remove check that __init__ isn't install 884ad04 Merge pull request #197 from mdaus/pythonTestTarget 688ecf5 Python tests only install when asked, and when everything is installed 9084676 Fix bug in creating __init__.py 8e1b43b Clean up be131fb Prevent installation of python tests if not requested 9d24cdd Merge pull request #196 from mdaus/fixImports f92b113 Fix imports 70b8180 Merge pull request #194 from mdaus/mathUtils 911e578 Review fixes d8444d9 Merge pull request #195 from mdaus/add-curl-handle fcbfb72 Added a newline to the end of file 2746903 Moved includes to be inside the #ifdef check 6f81af1 Added check for CURL 63d6634 Added curl handle ff9dd87 Review fixes 3c67452 Add trailing newline c2b09e8 Add nChooseK function f2d4539 Merge pull request #193 from mdaus/matlabConfigFix e290bdb Continue config if can't find mexext 3f2a7ca Merge pull request #192 from mdaus/fix_gcc62 bd8c12b Finalize fixes 053b7be Add untested attempt at expanding symlinks 86b0742 Not sure why this used to be linux/unistd.h - we should be able to use unistd.h directly. gcc 6.2 and/or Alpine Linux can't find linux/unistd.h so switching this. 98f5f0f gcc 6.2 warns that this should have a cast - according to the man page, this is true git-subtree-dir: externals/coda-oss git-subtree-split: c2489fe74942f5a134f814a7335eec0375af5319
2645b4f Merge pull request #211 from mdaus/logging-improvements 268e38b Added mClosed to init list 3070346 Updated handlers to avoid calling virtual methods in the destructor 6fe1538 Merge pull request #210 from mdaus/vectorString ca69675 Move VectorString to coda_types 55e9b33 Merge pull request #209 from mdaus/nanCheck 01df546 Add copyright 0ce5221 Make some test macros work against NaNs c2489fe Merge pull request #208 from mdaus/polyChecks 5b6a037 Add check for Poly1D.fromArray 3e68b18 Add some safety checks when converting Polys to and from numpy arrays 41065e2 Merge pull request #206 from mdaus/remove_curl_env_pollution 2eeca61 Merge pull request #207 from mdaus/fix_include_guard 3a23d69 Fixing include guard 0682acc Need to undefine HAVE_CURL_GLOBAL_INIT or else it ends up in the waf environment 81002ad Merge pull request #205 from mdaus/cliErrorMessage 576f028 More verbose error message for invalid cli key d551442 Merge pull request #204 from mdaus/libcurl-link d54f4de Some systems require explicitly adding curl to link line 30de0ce Merge pull request #202 from mdaus/buildRefactor 499ef22 Merge pull request #203 from mdaus/install-tgt-fix 7954e52 Updated install_tgt after testing with --install-source dadd7a1 Changed input to be self instead of tsk c66b774 install_tgt does not have self as an input parameter f5d98e2 Merge pull request #201 from mdaus/pyInitFix 1a18f65 Extract another function; resolve targets_to_add/targetsToAdd naming inconsistency bdbac8f Explain the fix 5fd1058 More built-in way of guarding against double-installation 4408d50 Include whitespace change 7050277 Merge branch 'master' into pyInitFix 3a8b8b8 Only create one __init__.py per project, to prevent race conditions 2f2c23f Merge pull request #200 from mdaus/revertInit 3485d90 Revert __init__.py change bcd3b41 Merge pull request #198 from mdaus/pyInitFix d1b2a32 Merge pull request #199 from mdaus/buildRefactor 7448249 Pass an argument instead of modifying modArgs d42db38 Properly modify modArgs 7ccc3b4 Extract some repeated code into functions 99d3be0 Remove check that __init__ isn't install 884ad04 Merge pull request #197 from mdaus/pythonTestTarget 688ecf5 Python tests only install when asked, and when everything is installed 9084676 Fix bug in creating __init__.py 8e1b43b Clean up be131fb Prevent installation of python tests if not requested 9d24cdd Merge pull request #196 from mdaus/fixImports f92b113 Fix imports 70b8180 Merge pull request #194 from mdaus/mathUtils 911e578 Review fixes d8444d9 Merge pull request #195 from mdaus/add-curl-handle fcbfb72 Added a newline to the end of file 2746903 Moved includes to be inside the #ifdef check 6f81af1 Added check for CURL 63d6634 Added curl handle ff9dd87 Review fixes 3c67452 Add trailing newline c2b09e8 Add nChooseK function f2d4539 Merge pull request #193 from mdaus/matlabConfigFix e290bdb Continue config if can't find mexext 3f2a7ca Merge pull request #192 from mdaus/fix_gcc62 bd8c12b Finalize fixes 053b7be Add untested attempt at expanding symlinks 86b0742 Not sure why this used to be linux/unistd.h - we should be able to use unistd.h directly. gcc 6.2 and/or Alpine Linux can't find linux/unistd.h so switching this. 98f5f0f gcc 6.2 warns that this should have a cast - according to the man page, this is true 7c39239 Merge pull request #191 from mdaus/swig-python-extra-native-containers ec4d5f1 defaulting SWIG_PYTHON_EXTRA_NATIVE_CONTAINERS 6dcac97 Merge pull request #190 from mdaus/thread_planner b26de0e Member initialization should be on separate lines d71d3ed Hadn't clicked save before pushing - some more Doxygen comments 860adee Adding a new method to get the number of threads that will actually be used. Adding Doxygen. 85a2433 Merge pull request #189 from mdaus/cleanup b6ec743 Remove unused variables dba6ab3 Merge pull request #187 from mdaus/tempfile 64648fa Prevent memory leak on error; make tempfile uncopyable, unassignable 2e8229f Remove warning; use vector<char> instead of array 8555040 Remove unneeded include 8b17367 Remove option to not destroy tempfile; document getTempFile() side-effect b264832 Move TempFile to io; simply things a0107a0 Add TempFile class git-subtree-dir: externals/coda-oss git-subtree-split: 2645b4f9b008fc219d41f1b1b5c0170bf9aae949
This adds functionality that allows the caller to provide an AOI of SICD pixel data and get back corresponding raw NITF file bytes in a contiguous block of memory such that, if it's called eventually with the entire image, the caller will get the entire raw NITF file (including NITF headers). The idea is to make it simple for callers to write out a SICD NITF piecemeal without needing to understand the underlying complexities of the NITF file structure.