25 "Merges multiple band files into a single RGB image.";
27 static const std::string HISTO_STRETCH_KW =
"histo_stretch";
30 : m_stretchProduct(false)
43 usageString +=
" bandmerge --red <red_band> --green <green_band> --blue <blue_band> [--stretch] <output-rgb-image>";
71 if ( ap.
read(
"--red", sp1))
78 if ( ap.
read(
"--green", sp1))
85 if ( ap.
read(
"--blue", sp1))
95 <<
" Must supply three band filenames."<<endl;
99 if ( ap.
read(
"--stretch"))
121 errMsg<<
"ERROR ossimBandMergeUtil:"<<__LINE__<<
" Expected 3 input layers but found " 122 <<
m_imgLayers.size() <<
". Cannot continue. "<<ends;
127 for (
int band=0; band<3; band++)
130 bandList.push_back(band_image);
146 if (!handler.
valid())
148 errMsg<<
"ERROR ossimBandMergeUtil:"<<__LINE__<<
" Bad handler returned for image chain.";
153 if (!histogram.
valid())
155 errMsg<<
"ERROR ossimBandMergeUtil:"<<__LINE__<<
" Bad histogram returned from image handler.";
163 image->
add(histogramRemapper.
get());
177 kwl.
add(key.
chars(),
"<red-band>",
true);
179 kwl.
add(key.
chars(),
"<green-band>",
true);
181 kwl.
add(key.
chars(),
"<blue-band>",
true);
183 kwl.
add(HISTO_STRETCH_KW.c_str(),
"true|false",
true);
std::string getApplicationName() const
return the application name, as specified by argv[0]
void addCommandLineOption(const ossimString &option, const ossimString &explanation)
static const char * PROJECTION_KW
std::basic_ostringstream< char > ostringstream
Class for char output memory streams.
Represents serializable keyword/value map.
ossimRefPtr< const ossimImageHandler > getImageHandler() const
bool read(const std::string &str)
search for an occurance of a string in the argument list, on sucess remove that occurance from the li...
void addPair(const std::string &key, const std::string &value, bool overwrite=true)
void setCommandLineUsage(const ossimString &explanation)
ossimApplicationUsage * getApplicationUsage()
ossimRefPtr< ossimMultiResLevelHistogram > getImageHistogram() const
Fetches the current entry image's histogram.
Single image chain class.
void setStretchMode(StretchMode mode, bool rebuildTableFlag=false)
Sets remap mode to mode.
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
std::vector< ossimRefPtr< ossimConnectableObject > > ConnectableObjectList
const char * chars() const
For backward compatibility.
virtual bool add(ossimConnectableObject *source)
Will return true or false if an image source was added to the chain.
bool getBoolKeywordValue(bool &rtn_val, const char *keyword, const char *prefix=0) const
[OLK, Aug/2008] Sets the boolean <rtn_val> depending on value associated with keyword for values = (y...
virtual void setEnableFlag(bool flag)
void setDescription(const ossimString &desc)
static const char * IMAGE_FILE_KW
void setHistogram(ossimRefPtr< ossimMultiResLevelHistogram > histogram)
Sets the histogram.
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)