21 theClipType(ossimBandClipType_NONE),
31 const vector<double>& minPix,
32 const vector<double>& maxPix,
35 theClipType(clipType),
50 theClipType(clipType),
109 for(index = 0; index < upperBound; ++index)
133 const vector<double>& maxPix)
188 if(((tw*th)!=(dw*dh))||
203 <<
"ossimBandClipFilter::getTile\n" 204 <<
"getNumberOfValues() != theTile->getNumberOfBands" 255 for(offset = 0; offset < upperBound; ++offset)
284 for(offset = 0; offset < upperBound; ++offset)
292 else if(*buf > maxPix)
302 for(offset = 0; offset < upperBound; ++offset)
308 else if(*buf > maxPix)
328 float* *bandArray =
new float*[bands];
330 for(band = 0; band < bands; ++band)
332 bandArray[band] =
static_cast<float*
>(
theTile->
getBuf(band));
337 for(
ossim_uint32 offset = 0; offset < upperBound; ++offset)
341 for(band = 0; band < bands; ++band)
344 double t = (bandArray[band][offset] -
theMinPix[band])/delta;
347 bandArray[band][offset] = minPixArray[band];
351 bandArray[band][offset] = maxPixArray[band];
355 bandArray[band][offset] = t;
363 for(
ossim_uint32 offset = 0; offset < upperBound; ++offset)
365 for(band = 0; band < bands; ++band)
368 double t = (bandArray[band][offset] -
theMinPix[band])/delta;
372 bandArray[band][offset] = minPixArray[band];
376 bandArray[band][offset] = maxPixArray[band];
380 bandArray[band][offset] = t;
392 float* *bandArray =
new float*[bands];
395 for(band = 0; band < bands; ++band)
397 bandArray[band] =
static_cast<float*
>(
theTile->
getBuf(band));
403 for(
ossim_uint32 offset = 0; offset < upperBound; ++offset)
407 for(band = 0; band < bands; ++band)
409 double side = (
theMedian[band] - (double)bandArray[band][offset]);
414 double t = ((double)bandArray[band][offset] -
theMinPix[band])/delta;
421 bandArray[band][offset] =
theMedian[band];
425 bandArray[band][offset] =
theMedian[band]*t;
431 double t = ((double)bandArray[band][offset] -
theMedian[band])/delta;
435 bandArray[band][offset] =
theMedian[band];
443 bandArray[band][offset] =
theMedian[band]+delta*t;
452 for(
ossim_uint32 offset = 0; offset < upperBound; ++offset)
454 for(band = 0; band < bands; ++band)
456 double side = (
theMedian[band] - (double)bandArray[band][offset]);
461 double t = ((double)bandArray[band][offset] -
theMinPix[band])/delta;
468 bandArray[band][offset] =
theMedian[band];
472 bandArray[band][offset] =
theMedian[band]*t;
478 double t = ((double)bandArray[band][offset] -
theMedian[band])/delta;
482 bandArray[band][offset] =
theMedian[band];
490 bandArray[band][offset] =
theMedian[band]+delta*t;
542 if(numberOfMins != numberOfMaxs)
556 const char* value=(
const char*)NULL;
558 while(numberOfMatches < numberOfMins)
571 while(numberOfMatches < numberOfMaxs)
582 if(numberOfMedians != numberOfMins)
584 for(index = 0; index <
theMaxPix.size(); ++index)
593 while(numberOfMatches < numberOfMedians)
607 const char* clip_type = kwl.
find(prefix,
"clip_type");
613 if(clipType ==
"NONE")
617 else if(clipType ==
"CLIP")
621 else if(clipType ==
"LINEAR_STRETCH")
625 else if(clipType ==
"MEDIAN_STRETCH")
633 <<
"ossimBandClipFilter::loadState NOTICE:\n" 634 <<
"Clip type not given defaulting to NONE" << endl;
642 const char* prefix)
const 681 clipType =
"LINEAR_STRETCH";
686 clipType =
"MEDIAN_STRETCH";
virtual ossim_uint32 getWidth() const
RTTI_DEF1(ossimBandClipFilter, "ossimBandClipFilter", ossimImageSourceFilter)
virtual const ossim_float64 * getMaxPix() const
static ossimString upcase(const ossimString &aString)
virtual ossim_uint32 getNumberOfBands() const
ossim_uint32 getNumberOfSubstringKeys(const ossimString ®ularExpression) const
void setMinMaxPix(const vector< double > &minPix, const vector< double > &maxPix)
ossimRefPtr< ossimImageData > getTile(const ossimIrect &rect, ossim_uint32 resLevel=0)
ossimRefPtr< ossimImageData > theTile
Represents serializable keyword/value map.
std::vector< double > theMaxPix
virtual ossim_uint32 getNumberOfOutputBands() const
Returns the number of bands in a tile returned from this TileSource.
const char * find(const char *key) const
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=NULL)
Method to the load (recreate) the state of an object from a keyword list.
static ossimString toString(bool aValue)
Numeric to string methods.
void setClipType(ossimBandClipType clipType)
virtual ossimDataObjectStatus getDataObjectStatus() const
virtual ossim_uint32 getHeight() const
std::vector< double > theMedian
double getMaxPix(ossim_uint32 index) const
virtual void initialize()
Initialize the data buffer.
virtual void initialize()
bool isNull(ossim_uint32 offset) const
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
std::vector< double > theMinPix
ossimBandClipType getClipType() const
virtual ossimDataObjectStatus validate() const
virtual ossim_uint32 getNumberOfValues() const
ossimImageSource * theInputConnection
unsigned int ossim_uint32
virtual const ossim_float64 * getNullPix() const
32 bit normalized floating point
ossimString trim(const ossimString &valueToTrim=ossimString(" \\)) const
this will strip lead and trailing character passed in.
virtual void copyTileToNormalizedBuffer(ossim_float64 *buf) const
Copies entire tile to buf passed in.
virtual void initialize()
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
virtual void copyNormalizedBufferToTile(ossim_float64 *buf)
Copies buf passed in to tile.
double getMinPix(ossim_uint32 index) const
virtual const ossim_float64 * getMinPix() const
virtual ~ossimBandClipFilter()
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.
virtual const void * getBuf() const
#define OSSIM_DEFAULT_MIN_PIX_NORM_FLOAT
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string's contents...
virtual void setDataObjectStatus(ossimDataObjectStatus status) const
Full list found in ossimConstants.h.
ossimDataObjectStatus
Definitions for data object status.
ossimBandClipType theClipType
const std::vector< double > & getMinPixList() const
#define OSSIM_DEFAULT_MAX_PIX_NORM_FLOAT
const std::vector< double > getMaxPixList() const
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
void setNumberOfValues(ossim_uint32 size)
virtual ossimRefPtr< ossimImageData > getTile(const ossimIpt &origin, ossim_uint32 resLevel=0)
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=NULL) const
Method to save the state of an object to a keyword list.