Skip to content
Browse files

Core/Common.cc: Write block image with no-data wrapper

  • Loading branch information...
1 parent 2363b23 commit 79ca336344aee6495b2383066843254bed69abef @oleg-alexandrov oleg-alexandrov committed Feb 25, 2013
Showing with 16 additions and 5 deletions.
  1. +5 −5 src/asp/Core/Common.cc
  2. +11 −0 src/asp/Core/Common.h
View
10 src/asp/Core/Common.cc
@@ -80,7 +80,7 @@ asp::check_command_line( int argc, char *argv[], BaseOptions& opt,
po::positional_options_description const& positional_desc,
std::string & usage_comment,
bool allow_unregistered ) {
-
+
// Finish filling in the usage_comment.
std::ostringstream ostr;
ostr << "Usage: " << argv[0] << " " << usage_comment << "\n\n";
@@ -91,7 +91,7 @@ asp::check_command_line( int argc, char *argv[], BaseOptions& opt,
// options we must parse, even if we don't need some of them, and
// public_options, which are the options specifically used by the
// current tool, and for which we also print the help message.
-
+
po::variables_map vm;
try {
po::options_description all_options;
@@ -208,7 +208,7 @@ namespace program_options {
std::string joined = boost::algorithm::join(values, " ");
std::vector<std::string> cvalues;
boost::split(cvalues, joined, is_any_of(", "), boost::token_compress_on);
-
+
if ( cvalues.size() != 2 )
boost::throw_exception(invalid_syntax(invalid_syntax::missing_parameter));
@@ -234,7 +234,7 @@ namespace program_options {
std::string joined = boost::algorithm::join(values, " ");
std::vector<std::string> cvalues;
boost::split(cvalues, joined, is_any_of(", "), boost::token_compress_on);
-
+
if ( cvalues.size() != 4 )
boost::throw_exception(invalid_syntax(invalid_syntax::missing_parameter));
@@ -261,7 +261,7 @@ namespace program_options {
std::string joined = boost::algorithm::join(values, " ");
std::vector<std::string> cvalues;
boost::split(cvalues, joined, is_any_of(", "), boost::token_compress_on);
-
+
if ( cvalues.size() != 4 )
boost::throw_exception(invalid_syntax(invalid_syntax::missing_parameter));
View
11 src/asp/Core/Common.h
@@ -95,6 +95,17 @@ namespace asp {
vw::block_write_image( *rsrc, image.impl(), progress_callback );
}
+ template <class ImageT, class NoDataT>
+ void block_write_gdal_image( const std::string &filename,
+ vw::ImageViewBase<ImageT> const& image,
+ NoDataT nodata,
+ BaseOptions const& opt,
+ vw::ProgressCallback const& progress_callback = vw::ProgressCallback::dummy_instance() ) {
+ boost::scoped_ptr<vw::DiskImageResourceGDAL> rsrc( build_gdal_rsrc( filename, image, opt ) );
+ rsrc->set_nodata_write(nodata);
+ vw::block_write_image( *rsrc, image.impl(), progress_callback );
+ }
+
template <class ImageT>
void write_gdal_image( const std::string &filename,
vw::ImageViewBase<ImageT> const& image,

0 comments on commit 79ca336

Please sign in to comment.
Something went wrong with that request. Please try again.