107 return combine(static_cast<ossim_uint8>(0), tileRect, resLevel);
111 return combineNorm(static_cast<ossim_uint8>(0), tileRect,
119 return combine(static_cast<ossim_sint8>(0), tileRect, resLevel);
123 return combineNorm(static_cast<ossim_sint8>(0), tileRect,
132 return combine(static_cast<float>(0), tileRect, resLevel);
136 return combineNorm(static_cast<float>(0), tileRect, resLevel);
148 return combine(static_cast<ossim_uint16>(0), tileRect, resLevel);
152 return combineNorm(static_cast<ossim_uint16>(0), tileRect,
160 return combine(static_cast<ossim_sint16>(0), tileRect, resLevel);
164 return combineNorm(static_cast<ossim_sint16>(0), tileRect,
172 return combine(static_cast<ossim_sint32>(0), tileRect, resLevel);
176 return combineNorm(static_cast<ossim_sint32>(0), tileRect,
184 return combine(static_cast<ossim_uint32>(0), tileRect, resLevel);
188 return combineNorm(static_cast<ossim_uint32>(0), tileRect,
197 return combine(static_cast<double>(0), tileRect, resLevel);
201 return combineNorm(static_cast<double>(0), tileRect, resLevel);
208 <<
"ossimBlendMosaic::getTile NOTICE:\n" 210 <<
" Not supported by ossimImageMosaic" << endl;
224 double currentWeight = 1.0;
225 double previousWeight = 1.0;
231 currentImageData =
getNextTile(layerIdx, 0, tileRect, resLevel);
233 if(!currentImageData.
get())
250 while(currentImageData.
get())
262 long h = (long)currentImageData->
getHeight();
263 long w = (long)currentImageData->
getWidth();
268 for(band = 0; band < minNumberOfBands; ++band)
270 srcBands[band] =
static_cast<T*
>(currentImageData->
getBuf(band));
274 srcBands[band] = srcBands[minNumberOfBands - 1];
279 for(row = 0; row < h; ++row)
281 for(col = 0; col < w; ++col)
283 if(!currentImageData->
isNull(offset))
287 if(destBands[band][offset] != nullPix[band])
291 destBands[band][offset] =
static_cast<T
>((destBands[band][offset]*previousWeight +
292 srcBands[band][offset]*currentWeight)/(previousWeight+currentWeight));
296 destBands[band][offset] = srcBands[band][offset];
306 for(row = 0; row < h; ++row)
308 for(col = 0; col < w; ++col)
312 if(destBands[band][offset] != nullPix[band])
314 destBands[band][offset] =
static_cast<T
>((destBands[band][offset]*previousWeight+
315 srcBands[band][offset]*currentWeight)/(previousWeight + currentWeight));
319 destBands[band][offset] = srcBands[band][offset];
327 currentImageData =
getNextTile(layerIdx, tileRect, resLevel);
328 previousWeight = (previousWeight+currentWeight)/2.0;
343 double currentWeight = 1.0;
344 double previousWeight = 1.0;
352 if(!currentImageData.
get())
369 while(currentImageData.
get())
380 long h = (long)currentImageData->
getHeight();
381 long w = (long)currentImageData->
getWidth();
386 for(band = 0; band < minNumberOfBands; ++band)
388 srcBands[band] =
static_cast<float*
>(currentImageData->
getBuf(band));
392 srcBands[band] = srcBands[minNumberOfBands - 1];
397 for(row = 0; row < h; ++row)
399 for(col = 0; col < w; ++col)
401 if(!currentImageData->
isNull(offset))
405 if(destBands[band][offset] != nullPix[band])
407 destBands[band][offset] =
static_cast<float>((destBands[band][offset]*previousWeight +
408 srcBands[band][offset]*currentWeight)/(previousWeight+currentWeight));
412 destBands[band][offset] = srcBands[band][offset];
422 for(row = 0; row < h; ++row)
424 for(col = 0; col < w; ++col)
428 if(destBands[band][offset] != nullPix[band])
430 destBands[band][offset] =
static_cast<float>((destBands[band][offset]*previousWeight+
431 srcBands[band][offset]*currentWeight)/(previousWeight + currentWeight));
435 destBands[band][offset] = srcBands[band][offset];
444 previousWeight = (previousWeight+currentWeight)/2.0;
457 const char* prefix)
const 488 while(numberOfMatches < result)
492 const char* lookup = kwl.
find(copyPrefix.
c_str(),
539 double sumWeights=0.0;
541 for(index = 0; index <
theWeights.size(); ++index)
547 for(index = 0; index <
theWeights.size(); ++index)
16 bit unsigned integer (15 bits used)
virtual void initialize()
virtual ossim_uint32 getWidth() const
ossimRefPtr< ossimImageData > theNormResult
double getWeight(ossim_uint32 index) const
virtual bool isSourceEnabled() const
ossimRefPtr< ossimImageData > theTile
virtual ossim_uint32 getNumberOfBands() const
ossim_uint32 getNumberOfSubstringKeys(const ossimString ®ularExpression) const
virtual void setImageRectangle(const ossimIrect &rect)
Represents serializable keyword/value map.
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=NULL)
Method to the load (recreate) the state of an object from a keyword list.
const char * find(const char *key) const
virtual ossimRefPtr< ossimImageData > getNextNormTile(ossim_uint32 &returnedIdx, const ossim_uint32 index, const ossimIrect &tileRect, ossim_uint32 resLevel=0)
ossimRefPtr< ossimImageData > combineNorm(T, const ossimIrect &tileRect, ossim_uint32)
static ossimString toString(bool aValue)
Numeric to string methods.
virtual ossimDataObjectStatus getDataObjectStatus() const
virtual ossim_uint32 getHeight() const
16 bit unsigned integer (14 bits used)
16 bit unsigned integer (13 bits used)
virtual ossimRefPtr< ossimImageData > getTile(const ossimIrect &origin, ossim_uint32 resLevel=0)
void findMinMax(double &minValue, double &maxValue) const
An image mosaic is a simple combiner that will just do a simple mosaic.
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=NULL) const
Method to save the state of an object to a keyword list.
virtual void initialize()
Initialize the data buffer.
void setAllWeightsTo(double value)
bool isNull(ossim_uint32 offset) const
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
void allocate()
Called on first getTile, will initialize all data needed.
virtual ossimRefPtr< ossimImageData > getNextTile(ossim_uint32 &returnedIdx, const ossim_uint32 startIdx, const ossimIrect &tileRect, ossim_uint32 resLevel=0)
virtual void initialize()
std::vector< ossimRefPtr< ossimConnectableObject > > ConnectableObjectList
ossim_uint32 theLargestNumberOfInputBands
virtual ossimDataObjectStatus validate() const
vector< double > theWeights
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
unsigned int ossim_uint32
virtual const ossim_float64 * getNullPix() const
32 bit normalized floating point
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.
virtual ossimRefPtr< ossimImageData > getTile(const ossimIrect &origin, ossim_uint32 resLevel=0)
virtual void copyNormalizedBufferToTile(ossim_float64 *buf)
Copies buf passed in to tile.
virtual bool hasDifferentInputs() const
void setWeight(ossim_uint32 index, double weight)
virtual ossimScalarType getScalarType() const
virtual void makeBlank()
Initializes data to null pixel values.
64 bit normalized floating point
16 bit unsigned integer (11 bits used)
ConnectableObjectList theInputObjectList
Holds a list of input objects.
void normalizeWeights()
Will find the min and max values and then normalize all weights to be from 0 to 1.
virtual const void * getBuf() const
ossimRefPtr< ossimImageData > combine(T, const ossimIrect &tileRect, ossim_uint32)
If our inputs have output of different scalar types then we must normalize so we can blend different ...
virtual ossim_uint32 getNumberOfInputs() const
Returns the number of input objects.
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string's contents...
void setNumberOfWeights(ossim_uint32 numberOfWeights)
#define RTTI_DEF1(cls, name, b1)
ossimDataObjectStatus
Definitions for data object status.
void setWeights(const std::vector< double > &weights)
virtual ~ossimBlendMosaic()
const std::vector< double > & getWeights() const
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
16 bit unsigned integer (12 bits used)