25 const vector<double>& targetMeanPerBand,
26 const vector<double>& targetSigmaPerBand,
27 const vector<double>& inputMeanPerBand,
28 const vector<double>& inputSigmaPerBand)
30 theTargetMeanPerBand(targetMeanPerBand),
31 theTargetSigmaPerBand(targetSigmaPerBand),
32 theInputMeanPerBand(inputMeanPerBand),
33 theInputSigmaPerBand(inputSigmaPerBand)
76 unsigned char* buf =
static_cast<unsigned char*
>(tile->
getBuf(band));
77 for(
long offset=0; offset < offsetBound;++offset)
99 result = ((result>255)?255:result);
100 result = ((result<0)?0:result);
102 buf[offset] = (
unsigned char)result;
172 const double vDelta = vTarget - vBias;
178 weight = fabs((vIn - vMin) / (vBias - vMin));
182 weight = fabs((vMax - vIn) / (vMax - vBias));
184 return (vIn + (vDelta * weight));
191 ,
double vBiasStretch
193 ,
double vTargetStretch
200 const double x1 = vMin;
201 const double x2 = vBias - vBiasStretch;
202 const double x3 = vBias + vBiasStretch;
203 const double x4 = vMax;
204 const double y1 = 0.0;
205 const double y2 = (vTarget + vTargetStretch) - (vBias + vBiasStretch);
206 const double y3 = (vTarget - vTargetStretch) - (vBias - vBiasStretch);
207 const double y4 = 0.0;
214 vOut = (vIn - x1) * (y2-y1)/(x2-x1) + y1 + vIn;
219 vOut = (vIn - x2) * (y3-y2)/(x3-x2) + y2 + vIn;
223 vOut = (vIn - x3) * (y4-y3)/(x4-x3) + y3 + vIn;
241 while(numberOfMatches < result)
246 const char* lookup = kwl.
find(key.
c_str());
258 while(numberOfMatches < result)
263 const char* lookup = kwl.
find(key.
c_str());
276 while(numberOfMatches < result)
281 const char* lookup = kwl.
find(key.
c_str());
294 while(numberOfMatches < result)
299 const char* lookup = kwl.
find(key.
c_str());
virtual ossim_uint32 getWidth() const
virtual bool isSourceEnabled() const
const vector< double > & getTargetMeanValues() const
double transLean(double vIn, double vBias, double vTarget, double vMin, double vMax)
transLean
virtual ossim_uint32 getNumberOfBands() const
ossim_uint32 getNumberOfSubstringKeys(const ossimString ®ularExpression) const
vector< double > theInputMeanPerBand
vector< double > theTargetMeanPerBand
Represents serializable keyword/value map.
virtual ~ossimHistoMatchRemapper()
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 ossimRefPtr< ossimImageData > getTile(const ossimIrect &tileRect, ossim_uint32 resLevel=0)
static ossimString toString(bool aValue)
Numeric to string methods.
const ossimIpt & ul() const
virtual ossimDataObjectStatus getDataObjectStatus() const
virtual ossim_uint32 getHeight() const
ossimHistoMatchRemapper()
virtual void initialize()
void setInputSigmaValues(const vector< double > &newValues)
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
void setInputMeanValues(const vector< double > &newValues)
const vector< double > & getInputSigmaValues() const
void setTargetSigmaValues(const vector< double > &newValues)
ossimImageSource * theInputConnection
unsigned int ossim_uint32
vector< double > theInputSigmaPerBand
const vector< double > & getTargetSigmaValues() const
vector< double > theTargetSigmaPerBand
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 setOrigin(const ossimIpt &origin)
const vector< double > & getInputMeanValues() const
double transLeanStretch(double vIn, double vBias, double vBiasStretch, double vTarget, double vTargetStretch, double vMin, double vMax)
transLeanStretch
virtual ossimScalarType getScalarType() const
virtual ossimScalarType getOutputScalarType() const
This will be used to query the output pixel type of the tile source.
virtual const void * getBuf() const
ossimRefPtr< ossimImageData > theBlankTile
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=NULL)
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string's contents...
virtual ossimRefPtr< ossimImageData > getTile(const ossimIpt &origin, ossim_uint32 resLevel=0)
void setTargetMeanValues(const vector< double > &newValues)