26 static ossimTrace traceDebug(
"ossimBandSelector:debug");
35 m_withinRangeFlag(ossimBandSelectorWithinRangeFlagState_NOT_SET),
36 m_passThroughFlag(false),
37 m_delayLoadRgbFlag(false),
38 m_inputIsSelectable(false)
121 bool disablePassThru)
123 if ( outputBandList.size() )
127 if ( !disablePassThru )
129 bool setBands =
false;
142 if ( setBands ==
false )
370 const char* prefix)
const 416 if ( (bs ==
"rgb" ) || (bs ==
"default"))
433 long numberOfBands = (long)keys.size();
435 std::vector<int>::size_type idx = 0;
436 std::vector<int> numberList(numberOfBands);
437 for(idx = 0; idx < keys.size();++idx)
441 numberList[idx] = numberStr.
toInt();
443 std::sort(numberList.begin(), numberList.end());
444 for(idx=0;idx < numberList.size();++idx)
446 const char* bandValue =
469 std::vector<ossim_uint32> inputList;
476 std::vector<ossim_uint32>::size_type i = 0;
496 "Method called prior to initialization!\n";
518 <<
"ossimBandSelector::outputBandsWithinInputRange() ERROR:" 519 <<
"Output band greater than highest input band. " 533 <<
"ossimBandSelector::outputBandsWithinInputRange() ERROR:" 534 <<
"Method called prior to initialization!" << std::endl;
558 return ossimString(
"Band Selector, maps an input band to the output band.");
568 if( property.
valid() )
570 if(property->
getName() ==
"bands")
572 std::vector<ossim_uint32> selection;
579 else if(property->
getName() ==
"bandSelection")
582 std::vector<ossimString> str_vec;
583 std::vector<ossim_uint32> int_vec;
585 str.
split( str_vec,
" " );
589 if(!str_vec[i].empty())
591 int_vec.push_back( str_vec[i].toUInt32() );
605 if( name ==
"bands" )
618 else if( name ==
"bandSelection" )
620 std::vector<ossim_uint32> bands;
624 std::vector<ossimString> bandNames;
633 str.
join( bandNames,
" " );
650 propertyNames.push_back(
"bands");
674 if(bandSelectorVisitor.
getObjects().size() < 1)
virtual void valueToString(ossimString &valueResult) const =0
virtual bool isSourceEnabled() const
void checkPassThrough()
Will check all combinations of the band list to see if its.
ossimRefPtr< ossimImageData > m_tile
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=NULL)
Method to the load (recreate) the state of an object from a keyword list.
virtual void setProperty(ossimRefPtr< ossimProperty > property)
virtual ossim_uint32 getNumberOfInputBands() const
virtual ossim_uint32 getNumberOfBands() const
virtual double getNullPixelValue(ossim_uint32 band=0) const
Each band has a null pixel associated with it.
virtual void setImageRectangle(const ossimIrect &rect)
const ossimString & join(const std::vector< ossimString > &stringList, const ossimString &separator)
Represents serializable keyword/value map.
virtual ossim_uint32 getNumberOfOutputBands() const
Returns the number of bands in a tile returned from this TileSource.
const char * find(const char *key) const
static ossimString toString(bool aValue)
Numeric to string methods.
virtual bool isSourceEnabled() const
void toSimpleStringList(ossimString &result, const std::vector< T > &valuesList)
This will output a vector of values inst a string.
void split(std::vector< ossimString > &result, const ossimString &separatorList, bool skipBlankFields=false) const
Splits this string into a vector of strings (fields) using the delimiter list specified.
virtual ossimDataObjectStatus getDataObjectStatus() const
void allocate()
Called on first getTile, will initialize all data needed.
virtual void setReadOnlyFlag(bool flag)
virtual double getMinPixelValue(ossim_uint32 band=0) const
Returns the min pixel of the band.
virtual void initialize()
Initialize the data buffer.
ossimRefPtr< ossimImageHandler > getBandSelectableImageHandler() const
Finds and returns band selectable image handler.
virtual void initialize()
bool toSimpleVector(std::vector< T > &result, const ossimString &stringOfPoints)
virtual double getMinPixelValue(ossim_uint32 band=0) const
Returns the min pixel of the band.
virtual void assignBand(const ossimImageData *data, ossim_uint32 source_band, ossim_uint32 output_band)
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
virtual ~ossimBandSelector()
virtual ossimString getShortName() const
virtual void getOutputBandList(std::vector< ossim_uint32 > &bandList) const
Initializes bandList.
static ossimImageDataFactory * instance()
virtual ossimString getLongName() const
virtual ossim_uint32 getNumberOfInputBands() const
Returns the number of input bands.
virtual ossimDataObjectStatus validate() const
virtual ossimRefPtr< ossimProperty > getProperty(const ossimString &name) const
virtual void getPropertyNames(std::vector< ossimString > &propertyNames) const
virtual double getMaxPixelValue(ossim_uint32 band=0) const
Returns the max pixel of the band.
ossimImageSource * theInputConnection
unsigned int ossim_uint32
static const char * NUMBER_OUTPUT_BANDS_KW
virtual bool getRgbBandList(std::vector< ossim_uint32 > &bandList) const
Convenience method to get the zero based rgb output band list.
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=NULL) const
Method to save the state of an object to a keyword list.
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
static ossimString downcase(const ossimString &aString)
virtual ossimRefPtr< ossimImageData > create(ossimSource *owner, ossimScalarType scalar, ossim_uint32 bands=1) const
static const char * BANDS_KW
virtual bool isBandSelector() const
Indicates whether or not the image handler can control output band selection via the setOutputBandLis...
virtual void initialize()
ossimBandSelectorWithinRangeFlagState m_withinRangeFlag
std::vector< ossimString > getSubstringKeyList(const ossimString ®ularExpression) const
virtual ossimRefPtr< ossimImageData > getTile(const ossimIrect &tileRect, ossim_uint32 resLevel=0)
virtual ossimScalarType getScalarType() const
virtual void makeBlank()
Initializes data to null pixel values.
T * getObjectAs(ossim_uint32 idx=0)
virtual ossimScalarType getOutputScalarType() const
This will be used to query the output pixel type of the tile source.
This class defines an abstract Handler which all image handlers(loaders) should derive from...
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.
virtual double getMaxPixelValue(ossim_uint32 band=0) const
Returns the max pixel of the band.
virtual void setThreeBandRgb()
Will set to three bands (rgb) out.
virtual void setOutputBandList(const vector< ossim_uint32 > &outputBandList, bool disablePassThru=false)
Sets the output band list.
bool getRgbBandList(std::vector< ossim_uint32 > &bandList) const
Attempts to derive rgb bands from image handler to the left of the band selector. ...
virtual ossimRefPtr< ossimProperty > getProperty(const ossimString &name) const
std::vector< ossim_uint32 > m_outputBandList
virtual void getPropertyNames(std::vector< ossimString > &propertyNames) const
virtual void accept(ossimVisitor &visitor)
We will add a visitor interface for all connectable objects.
#define RTTI_DEF1(cls, name, b1)
virtual void getOutputBandList(std::vector< ossim_uint32 > &bandList) const
Initializes bandList to the zero based order of output bands.
bool outputBandsWithinInputRange() const
virtual ossim_uint32 getNumberOfInputBands() const =0
virtual bool setOutputBandList(const std::vector< ossim_uint32 > &band_list)
If the image handler "isBandSeletor()" then the band selection of the output chip can be controlled...
virtual ossim_uint32 getNumberOfOutputBands() const
Returns the number of bands in a tile returned from this TileSource.
virtual double getNullPixelValue(ossim_uint32 band=0) const
Each band has a null pixel associated with it.
virtual void setProperty(ossimRefPtr< ossimProperty > property)
Override base class so that a disableSource event does not reinitialize the object and enable itself...
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
void setCacheRefreshBit()
const ossimString & getName() const
virtual ossimRefPtr< ossimImageData > getTile(const ossimIpt &origin, ossim_uint32 resLevel=0)