OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ossimMaxMosaic Class Reference

An image mosaic is a simple combiner that will just do a simple mosaic. More...

#include <ossimMaxMosaic.h>

Inheritance diagram for ossimMaxMosaic:
ossimImageCombiner ossimImageSource ossimConnectableObjectListener ossimSource ossimListener ossimConnectableObject ossimErrorStatusInterface ossimObject ossimListenerManager ossimPropertyInterface ossimReferenced

Public Member Functions

 ossimMaxMosaic ()
 
 ossimMaxMosaic (ossimConnectableObject::ConnectableObjectList &inputSources)
 
virtual ossimRefPtr< ossimImageDatagetTile (const ossimIrect &origin, ossim_uint32 resLevel=0)
 
virtual void initialize ()
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 Method to save the state of an object to a keyword list. More...
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 Method to the load (recreate) the state of an object from a keyword list. More...
 
virtual ossimString getShortName () const
 
virtual ossimString getLongName () const
 
virtual ossimString getDescription () const
 
- Public Member Functions inherited from ossimImageCombiner
 ossimImageCombiner ()
 
 ossimImageCombiner (ossimObject *owner, int numberOfInputs, int numberOfOutputs, bool inputListIsFixedFlag, bool outputListIsFixedFlag)
 
 ossimImageCombiner (ossimConnectableObject::ConnectableObjectList &inputSources)
 
virtual ossimIrect getBoundingRect (ossim_uint32 resLevel=0) const
 This will return the bounding rect of the source. More...
 
virtual void updateRects ()
 This will go through and precompute the bounding rects of each input image. More...
 
virtual ossim_uint32 getNumberOfInputBands () const
 Returns the number of bands available from the input. More...
 
virtual ossimScalarType getOutputScalarType () const
 This will be used to query the output pixel type of the tile source. More...
 
virtual ossim_uint32 getTileWidth () const
 Returns the default processing tile width. More...
 
virtual ossim_uint32 getTileHeight () const
 Returns the default processing tile height. More...
 
virtual double getNullPixelValue (ossim_uint32 band=0) const
 Each band has a null pixel associated with it. More...
 
virtual double getMinPixelValue (ossim_uint32 band=0) const
 Returns the min pixel of the band. More...
 
virtual double getMaxPixelValue (ossim_uint32 band=0) const
 Returns the max pixel of the band. More...
 
virtual ossim_uint32 getNumberOfOverlappingImages (const ossimIrect &rect, ossim_uint32 resLevel=0) const
 Used to retrieve the number of overlapping images withint the given rect. More...
 
virtual void getOverlappingImages (std::vector< ossim_uint32 > &result, const ossimIrect &rect, ossim_uint32 resLevel=0) const
 Used to populate the result with the index of the overlapping images. More...
 
virtual ossimRefPtr< ossimImageDatagetNextTile (ossim_uint32 &returnedIdx, const ossim_uint32 startIdx, const ossimIrect &tileRect, ossim_uint32 resLevel=0)
 
virtual ossimRefPtr< ossimImageDatagetNextTile (ossim_uint32 &returnedIdx, const ossimIrect &tileRect, ossim_uint32 resLevel=0)
 
virtual bool getNextTile (ossim_uint32 &returnedIdx, const ossim_uint32 startIdx, ossimImageData *tile, ossim_uint32 resLevel=0)
 
virtual ossimRefPtr< ossimImageDatagetNextNormTile (ossim_uint32 &returnedIdx, const ossim_uint32 index, const ossimIrect &tileRect, ossim_uint32 resLevel=0)
 
virtual ossimRefPtr< ossimImageDatagetNextNormTile (ossim_uint32 &returnedIdx, const ossimIrect &tileRect, ossim_uint32 resLevel=0)
 
virtual bool canConnectMyInputTo (ossim_int32 inputIndex, const ossimConnectableObject *object) const
 required to be overriden by derived classes More...
 
virtual void connectInputEvent (ossimConnectionEvent &event)
 
virtual void disconnectInputEvent (ossimConnectionEvent &event)
 
virtual void propertyEvent (ossimPropertyEvent &event)
 
virtual void refreshEvent (ossimRefreshEvent &event)
 
virtual bool hasDifferentInputs () const
 
- Public Member Functions inherited from ossimImageSource
 ossimImageSource (ossimObject *owner=0)
 
 ossimImageSource (ossimObject *owner, ossim_uint32 inputListSize, ossim_uint32 outputListSize, bool inputListIsFixedFlag=true, bool outputListIsFixedFlag=true)
 
virtual ~ossimImageSource ()
 
virtual ossimRefPtr< ossimImageDatagetTile (const ossimIpt &origin, ossim_uint32 resLevel=0)
 
virtual bool getTile (ossimImageData *result, ossim_uint32 resLevel=0)
 Method to get a tile. More...
 
virtual ossimObjectgetObject ()
 For RTTI support. More...
 
virtual const ossimObjectgetObject () const
 For RTTI support. More...
 
virtual void getDecimationFactor (ossim_uint32 resLevel, ossimDpt &result) const
 Will return the decimation factor for the given resolution level. More...
 
virtual void getDecimationFactors (std::vector< ossimDpt > &decimations) const
 Will return an array of all decimations for each resolution level. More...
 
virtual ossim_uint32 getNumberOfDecimationLevels () const
 Will return the number of resolution levels. More...
 
virtual ossim_uint32 getNumberOfOutputBands () const
 Returns the number of bands in a tile returned from this TileSource. More...
 
virtual void getOutputBandList (std::vector< ossim_uint32 > &bandList) const
 Initializes bandList. More...
 
virtual void getBoundingRect (ossimIrect &rect, ossim_uint32 resLevel=0) const
 Gets the bounding rectangle of the source. More...
 
virtual void getValidImageVertices (std::vector< ossimIpt > &validVertices, ossimVertexOrdering ordering=OSSIM_CLOCKWISE_ORDER, ossim_uint32 resLevel=0) const
 ordering specifies how the vertices should be arranged. More...
 
virtual ossimRefPtr< ossimImageGeometrygetImageGeometry ()
 Returns the image geometry object associated with this tile source or NULL if not defined. More...
 
virtual void setImageGeometry (const ossimImageGeometry *geom)
 Default implementation sets geometry of the first input to the geometry specified. More...
 
virtual void saveImageGeometry () const
 Default method to call input's saveImageGeometry. More...
 
virtual void saveImageGeometry (const ossimFilename &geometry_file) const
 Default method to call input's saveImageGeometry. More...
 
virtual ossimRefPtr< ossimPropertygetProperty (const ossimString &name) const
 
virtual void setProperty (ossimRefPtr< ossimProperty > property)
 
virtual void getPropertyNames (std::vector< ossimString > &propertyNames) const
 
virtual bool isIndexedData () const
 
- Public Member Functions inherited from ossimSource
 ossimSource (ossimObject *owner=0)
 
 ossimSource (ossimObject *owner, ossim_uint32 inputListSize, ossim_uint32 outputListSize, bool inputListIsFixedFlag=true, bool outputListIsFixedFlag=true)
 
virtual ~ossimSource ()
 
virtual bool isSourceEnabled () const
 
virtual void enableSource ()
 
virtual void disableSource ()
 
virtual bool getEnableFlag () const
 
virtual void setEnableFlag (bool flag)
 
virtual bool isInitialized () const
 
virtual void setInitializedFlag (bool flag)
 
virtual std::ostream & print (std::ostream &out) const
 Outputs theErrorStatus as an ossimErrorCode and an ossimString. More...
 
- Public Member Functions inherited from ossimConnectableObject
 ossimConnectableObject (ossimObject *owner=0)
 Base constructor of this object. More...
 
 ossimConnectableObject (ossimObject *owner, ossim_int32 inputListSize, ossim_int32 outputListSize, bool inputListIsFixedFlag=true, bool outputListIsFixedFlag=true)
 
virtual ~ossimConnectableObject ()
 
void setId (const ossimId &id)
 All connectable objects will have id's. More...
 
const ossimIdgetId () const
 Will allow us to get this object's id. More...
 
const ossimObjectgetOwner () const
 Fetches the current owner, most likely a container but not limited to one. More...
 
virtual void changeOwner (ossimObject *owner)
 Permits changing the object's owner. More...
 
virtual void setDescription (const ossimString &description)
 
virtual bool isConnected (ossimConnectableObjectDirectionType direction=CONNECTABLE_DIRECTION_INPUT) const
 will check the direction specified to see if all slots are full. More...
 
 OSSIM_DEPRECATE_METHOD (virtual ossimConnectableObject *findConnectableObject(const ossimId &id))
 
 OSSIM_DEPRECATE_METHOD (virtual ossimConnectableObject *findObjectOfType(RTTItypeid typeId, ossimConnectableObjectDirectionType directionType, bool recurse=true))
 
 OSSIM_DEPRECATE_METHOD (virtual ossimConnectableObject *findObjectOfType(const ossimString &obj, ossimConnectableObjectDirectionType directionType, bool recurse=true))
 
 OSSIM_DEPRECATE_METHOD (virtual ossimConnectableObject *findInputObjectOfType(const ossimString &className))
 
virtual ossim_int32 findInputIndex (const ossimConnectableObject *object)
 Return a valid index of the input list if the passed in object is found else return -1. More...
 
virtual ossim_int32 findInputIndex (const ossimId &id)
 Return a valid index of the input list if the passed id is found else return -1. More...
 
virtual ossim_int32 findOutputIndex (const ossimConnectableObject *object)
 Return a valid index of the output list if the passed in object is found else return -1. More...
 
virtual ossim_int32 findOutputIndex (const ossimId &id)
 Return a valid index of the output list if the passed in object is found else return -1. More...
 
virtual ossim_int32 getMyInputIndexToConnectTo (ossimConnectableObject *object) const
 Should return the first available index to connect to. More...
 
virtual ossim_int32 getMyOutputIndexToConnectTo (ossimConnectableObject *object) const
 Should return the first available index to connect to. More...
 
virtual bool canConnectMyOutputTo (ossim_int32 myOutputIndex, const ossimConnectableObject *object) const
 default implementation is to allow anyone to connect to us. More...
 
virtual void disconnect (ossimConnectableObject *object=0)
 Will disconnect the object passed in. More...
 
virtual void disconnect (const ossimId &id)
 Will disconnect the object passed in. More...
 
virtual ossimRefPtr< ossimConnectableObjectdisconnectMyInput (ossim_int32 inputIndex, bool disconnectOutputFlag=true, bool createEventFlag=true)
 Will disconnect the object at the given input index and generate a connection event. More...
 
virtual void disconnectMyInput (ossimConnectableObject *input, bool disconnectOutputFlag=true, bool createEventFlag=true)
 Finds the index of the passed in input and calls disconnectMyInput(inputIndex, disconnectOutputFlag, createEventFlag);. More...
 
virtual void disconnectMyInputs (ConnectableObjectList &inputList, bool disconnectOutputFlag=true, bool createEventFlag=true)
 
virtual ossimRefPtr< ossimConnectableObjectdisconnectMyOutput (ossim_int32 outputIndex, bool disconnectInputFlag=true, bool createEventFlag=true)
 Will disconnect the object at the given output index and generate a connection event. More...
 
virtual void disconnectMyOutput (ossimConnectableObject *output, bool disconnectInputFlag=true, bool createEventFlag=true)
 Will disconnect the output object. More...
 
virtual void disconnectMyOutputs (ConnectableObjectList &outputList, bool disconnectOutputFlag=true, bool createEventFlag=true)
 
virtual void disconnectAllInputs ()
 Will disconnect all of the input objects. More...
 
virtual void disconnectAllOutputs ()
 Will disconnect all of the output objects. More...
 
virtual ossim_int32 connectMyInputTo (ossimConnectableObject *inputObject, bool makeOutputConnection=true, bool createEventFlag=true)
 Will try to connect this objects input to the passed in object. More...
 
virtual ossim_int32 connectMyInputTo (ossim_int32 inputIndex, ossimConnectableObject *inputObject, bool makeOutputConnection=true, bool createEventFlag=true)
 Will connect the specified input to the passed in object. More...
 
virtual bool connectMyInputTo (ConnectableObjectList &inputList, bool makeOutputConnection=true, bool createEventFlag=true)
 
virtual ossim_int32 connectMyOutputTo (ossimConnectableObject *outputObject, bool makeInputConnection=true, bool createEventFlag=true)
 Will try to connect this objects output to the passed in object. More...
 
virtual bool connectMyOutputTo (ConnectableObjectList &outputList, bool makeInputConnection=true, bool createEventFlag=true)
 
virtual bool connectInputList (ConnectableObjectList &inputList)
 Will disconnect itself from all inputs and reset to the passed in input list. More...
 
virtual bool connectOutputList (ConnectableObjectList &outputList)
 Will disconnect itself from all outputs and reset to the passed in output list. More...
 
virtual ossim_uint32 getNumberOfInputs () const
 Returns the number of input objects. More...
 
virtual ossim_uint32 getNumberOfOutputs () const
 Return the number of output objects. More...
 
ossimConnectableObjectgetInput (ossim_uint32 index=0)
 returns the object at the specified index. More...
 
const ossimConnectableObjectgetInput (ossim_uint32 index=0) const
 returns the object at the specified index. More...
 
ossimConnectableObjectgetOutput (ossim_uint32 index=0)
 returns the object at the specified index. More...
 
const ossimConnectableObjectgetOutput (ossim_uint32 index=0) const
 returns the object at the specified index. More...
 
virtual void setNumberOfInputs (ossim_int32 numberOfInputs)
 Will set the number of inputs. More...
 
virtual bool getInputListIsFixedFlag () const
 
virtual bool getOutputListIsFixedFlag () const
 
virtual void setNumberOfOutputs (ossim_int32 numberOfInputs)
 Will set the number of outputs. More...
 
const ConnectableObjectListgetInputList () const
 
const ConnectableObjectListgetOutputList () const
 
ConnectableObjectListgetInputList ()
 
ConnectableObjectListgetOutputList ()
 
 OSSIM_DEPRECATE_METHOD (virtual void findAllObjectsOfType(ConnectableObjectList &result, const RTTItypeid &typeInfo, bool recurse=true))
 
 OSSIM_DEPRECATE_METHOD (virtual void findAllObjectsOfType(ConnectableObjectList &result, const ossimString &className, bool recurse=true))
 
virtual void propagateEventToOutputs (ossimEvent &event)
 
virtual void propagateEventToInputs (ossimEvent &event)
 
virtual void setProperty (const ossimString &name, const ossimString &value)
 
virtual ossim_uint32 saveStateOfAllInputs (ossimKeywordlist &kwl, bool saveThisStateFlag=true, ossim_uint32 objectIndex=1, const char *prefix=0) const
 Save the state of all inputs to a keyword list. More...
 
virtual bool fillContainer (ossimConnectableContainer &container)
 Inserts this object and all of its children and inputs into the container provided. More...
 
bool moveInputUp (const ossimId &id)
 Moves the input connection matching id up one in the connection list. More...
 
bool moveInputDown (const ossimId &id)
 Moves the input connection matching id down one in the connection list. More...
 
bool moveInputToTop (const ossimId &id)
 Moves the input connection matching id to the top of the connection list. More...
 
bool moveInputToBottom (const ossimId &id)
 Moves the input connection matching id to the bottom of the connection list. More...
 
virtual void accept (ossimVisitor &visitor)
 We will add a visitor interface for all connectable objects. More...
 
- Public Member Functions inherited from ossimObject
 ossimObject ()
 
virtual ~ossimObject ()
 
virtual ossimObjectdup () const
 
virtual ossimString getClassName () const
 
virtual RTTItypeid getType () const
 
virtual bool canCastTo (ossimObject *obj) const
 
virtual bool canCastTo (const RTTItypeid &id) const
 
virtual bool canCastTo (const ossimString &parentClassName) const
 
virtual bool isEqualTo (const ossimObject &obj, ossimCompareType compareType=OSSIM_COMPARE_FULL) const
 
- Public Member Functions inherited from ossimReferenced
 ossimReferenced ()
 
 ossimReferenced (const ossimReferenced &)
 
ossimReferencedoperator= (const ossimReferenced &)
 
void ref () const
 increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
void unref () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
void unref_nodelete () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
int referenceCount () const
 
- Public Member Functions inherited from ossimListenerManager
 ossimListenerManager ()
 
virtual ~ossimListenerManager ()
 
virtual void fireEvent (ossimEvent &event)
 
virtual bool addListener (ossimListener *listener)
 
virtual bool removeListener (ossimListener *listener)
 
virtual bool findListener (ossimListener *listener)
 
- Public Member Functions inherited from ossimPropertyInterface
 ossimPropertyInterface ()
 
virtual ~ossimPropertyInterface ()
 
virtual ossimString getPropertyValueAsString (const ossimString &name) const
 
void getPropertyList (std::vector< ossimRefPtr< ossimProperty > > &propertyList) const
 
void setProperties (std::vector< ossimRefPtr< ossimProperty > > &propertyList)
 
- Public Member Functions inherited from ossimErrorStatusInterface
 ossimErrorStatusInterface ()
 
virtual ~ossimErrorStatusInterface ()
 
virtual ossimErrorCode getErrorStatus () const
 
virtual ossimString getErrorStatusString () const
 
virtual void setErrorStatus (ossimErrorCode error_status) const
 
virtual void setErrorStatus () const
 
virtual void clearErrorStatus () const
 
bool hasError () const
 
- Public Member Functions inherited from ossimConnectableObjectListener
 ossimConnectableObjectListener ()
 
virtual ~ossimConnectableObjectListener ()
 
virtual void processEvent (ossimEvent &event)
 ProcessEvent. More...
 
virtual void objectDestructingEvent (ossimObjectDestructingEvent &)
 
virtual void connectionEvent (ossimConnectionEvent &)
 
virtual void disconnectOutputEvent (ossimConnectionEvent &)
 
virtual void connectOutputEvent (ossimConnectionEvent &)
 
virtual void addObjectEvent (ossimContainerEvent &)
 
virtual void removeObjectEvent (ossimContainerEvent &)
 
virtual void containerEvent (ossimContainerEvent &)
 
- Public Member Functions inherited from ossimListener
 ossimListener ()
 
virtual ~ossimListener ()
 
void enableListener ()
 
void disableListener ()
 
void setListenerEnableFlag (bool flag)
 
bool isListenerEnabled () const
 
bool getListenerEnableFlag () const
 

Protected Member Functions

virtual ~ossimMaxMosaic ()
 
void allocate ()
 Called on first getTile, will initialize all data needed. More...
 
template<class T >
ossimRefPtr< ossimImageDatacombine (T, const ossimIrect &tileRect, ossim_uint32 resLevel=0)
 
template<class T >
ossimRefPtr< ossimImageDatacombineNorm (T, const ossimIrect &tileRect, ossim_uint32 resLevel=0)
 
- Protected Member Functions inherited from ossimImageCombiner
virtual ~ossimImageCombiner ()
 
void precomputeBounds () const
 
- Protected Member Functions inherited from ossimImageSource
 ossimImageSource (const ossimImageSource &rhs)
 
const ossimImageSourceoperator= (const ossimImageSource &)
 
- Protected Member Functions inherited from ossimSource
 ossimSource (const ossimSource &rhs)
 
const ossimSourceoperator= (const ossimSource &rhs)
 
- Protected Member Functions inherited from ossimConnectableObject
ossimConnectableObjectfindObjectOfType (ConnectableObjectList *connectableList, ossimVisitor &visitor)
 
- Protected Member Functions inherited from ossimReferenced
virtual ~ossimReferenced ()
 
- Protected Member Functions inherited from ossimListenerManager
 ossimListenerManager (const ossimListenerManager &rhs)
 

Protected Attributes

ossimRefPtr< ossimImageDatatheTile
 
- Protected Attributes inherited from ossimImageCombiner
ossim_uint32 theLargestNumberOfInputBands
 
ossim_uint32 theInputToPassThrough
 
bool theHasDifferentInputs
 
ossimRefPtr< ossimImageDatatheNormTile
 
std::vector< ossimIrecttheFullResBounds
 
bool theComputeFullResBoundsFlag
 
ossim_uint32 theCurrentIndex
 
- Protected Attributes inherited from ossimSource
bool theEnableFlag
 
bool theInitializedFlag
 
- Protected Attributes inherited from ossimConnectableObject
ossimId theId
 
ossimString theDescription
 
ossimObjecttheOwner
 
bool theInputListIsFixedFlag
 Indicates whether the theInputObjectList is fixed. More...
 
bool theOutputListIsFixedFlag
 Indicates whether the theOutputObjectList is fixed. More...
 
ConnectableObjectList theInputObjectList
 Holds a list of input objects. More...
 
ConnectableObjectList theOutputObjectList
 Holds a list of output objects. More...
 
- Protected Attributes inherited from ossimListenerManager
std::list< ossimListener * > theListenerList
 
bool theEnabledFlag
 
std::list< ossimListener * > theDelayedAdd
 
std::list< ossimListener * > theDelayedRemove
 
bool theFireEventFlag
 
- Protected Attributes inherited from ossimErrorStatusInterface
ossimErrorCode theErrorStatus
 
- Protected Attributes inherited from ossimListener
bool theListenerEnableFlag
 

Additional Inherited Members

- Public Types inherited from ossimConnectableObject
enum  ossimConnectableObjectDirectionType { CONNECTABLE_DIRECTION_NONE = 0, CONNECTABLE_DIRECTION_INPUT = 1, CONNECTABLE_DIRECTION_OUTPUT = 2 }
 
typedef std::vector< ossimRefPtr< ossimConnectableObject > > ConnectableObjectList
 

Detailed Description

An image mosaic is a simple combiner that will just do a simple mosaic.

It just checks NULL pix values until it finds a pixel that is not empty and copies it out to the output. The list will have same size tiles and have the same number of bands.

Definition at line 28 of file ossimMaxMosaic.h.

Constructor & Destructor Documentation

◆ ossimMaxMosaic() [1/2]

ossimMaxMosaic::ossimMaxMosaic ( )

Definition at line 26 of file ossimMaxMosaic.cpp.

28  theTile(NULL)
29 {
30 }
ossimRefPtr< ossimImageData > theTile

◆ ossimMaxMosaic() [2/2]

ossimMaxMosaic::ossimMaxMosaic ( ossimConnectableObject::ConnectableObjectList inputSources)

Definition at line 32 of file ossimMaxMosaic.cpp.

33  : ossimImageCombiner(inputSources),
34  theTile(NULL)
35 {
36 }
ossimRefPtr< ossimImageData > theTile

◆ ~ossimMaxMosaic()

ossimMaxMosaic::~ossimMaxMosaic ( )
protectedvirtual

Definition at line 39 of file ossimMaxMosaic.cpp.

40 {
41 }

Member Function Documentation

◆ allocate()

void ossimMaxMosaic::allocate ( )
protected

Called on first getTile, will initialize all data needed.

Definition at line 243 of file ossimMaxMosaic.cpp.

References ossimImageDataFactory::create(), ossimConnectableObject::getInput(), ossimConnectableObject::getNumberOfInputs(), ossimImageData::initialize(), ossimImageDataFactory::instance(), and theTile.

Referenced by getTile().

244 {
245  theTile = NULL;
246 
247  if( (getNumberOfInputs() > 0) && getInput(0) )
248  {
250  theTile->initialize();
251  }
252 }
virtual void initialize()
Initialize the data buffer.
ossimConnectableObject * getInput(ossim_uint32 index=0)
returns the object at the specified index.
static ossimImageDataFactory * instance()
virtual ossimRefPtr< ossimImageData > create(ossimSource *owner, ossimScalarType scalar, ossim_uint32 bands=1) const
ossimRefPtr< ossimImageData > theTile
virtual ossim_uint32 getNumberOfInputs() const
Returns the number of input objects.

◆ combine()

template<class T >
ossimRefPtr< ossimImageData > ossimMaxMosaic::combine ( ,
const ossimIrect tileRect,
ossim_uint32  resLevel = 0 
)
protected

Definition at line 419 of file ossimMaxMosaic.cpp.

References ossimImageData::getBuf(), ossimDataObject::getDataObjectStatus(), ossimImageData::getHeight(), ossimImageCombiner::getNextTile(), ossimImageData::getNullPix(), ossimImageData::getNumberOfBands(), ossimImageData::getWidth(), OSSIM_EMPTY, OSSIM_NULL, OSSIM_PARTIAL, ossimDataObject::setDataObjectStatus(), ossimImageCombiner::theLargestNumberOfInputBands, theTile, ossimRefPtr< T >::valid(), and ossimImageData::validate().

Referenced by getTile().

423 {
424  ossim_uint32 layerIdx = 0;
425  ossimRefPtr<ossimImageData> destination = theTile;
426 
427  ossimRefPtr<ossimImageData> currentImageData = getNextTile(layerIdx, 0, tileRect, resLevel);
428  if(!currentImageData)
429  {
430  return currentImageData;
431  }
432 
433  T** srcBands = new T*[theLargestNumberOfInputBands];
434  T* srcBandsNullPix = new T[theLargestNumberOfInputBands];
435  T** destBands = new T*[theLargestNumberOfInputBands];
436  T* destBandsNullPix = new T[theLargestNumberOfInputBands];
437 
438  ossim_uint32 band;
439  ossim_uint32 upperBound = destination->getWidth()*destination->getHeight();
440  ossim_uint32 bandIndex = 0;
441 
442  ossim_uint32 offset=0;
443  ossim_uint32 minNumberOfBands = currentImageData->getNumberOfBands();
444  for(band = 0; band < minNumberOfBands; ++band)
445  {
446  srcBands[band] = static_cast<T*>(currentImageData->getBuf(band));
447  destBands[band] = static_cast<T*>(theTile->getBuf(band));
448  srcBandsNullPix[band] = static_cast<T>(currentImageData->getNullPix(band));
449  destBandsNullPix[band] = static_cast<T>(theTile->getNullPix(band));
450  }
451  // if the src is smaller than the destination in number
452  // of bands we will just duplicate the last band.
453  for(;band < theLargestNumberOfInputBands; ++band)
454  {
455  srcBands[band] = static_cast<T*>(srcBands[minNumberOfBands - 1]);
456  destBands[band] = static_cast<T*>(theTile->getBuf(band));
457  srcBandsNullPix[band] = static_cast<T>(currentImageData->getNullPix(minNumberOfBands - 1));
458  destBandsNullPix[band] = static_cast<T>(theTile->getNullPix(band));
459  }
460  // most of the time we will not overlap so let's
461  // copy the first tile into destination and check later.
462  //
463  for(band = 0; band < theTile->getNumberOfBands();++band)
464  {
465  T* destBand = destBands[band];
466  T* srcBand = srcBands[band];
467  if(destBand&&srcBand)
468  {
469  for(offset = 0; offset < upperBound;++offset)
470  {
471  *destBand = *srcBand;
472  ++srcBand; ++destBand;
473  }
474  }
475  }
476  destination->setDataObjectStatus(currentImageData->getDataObjectStatus());
477 
478  currentImageData = getNextTile(layerIdx,
479  tileRect,
480  resLevel);
481 
482  while(currentImageData.valid())
483  {
484  ossim_uint32 minNumberOfBands = currentImageData->getNumberOfBands();
485  ossimDataObjectStatus currentStatus = currentImageData->getDataObjectStatus();
486  ossimDataObjectStatus destinationStatus = destination->getDataObjectStatus();
487 
488  for(band = 0; band < minNumberOfBands; ++band)
489  {
490  srcBands[band] = static_cast<T*>(currentImageData->getBuf(band));
491  srcBandsNullPix[band] = static_cast<T>(currentImageData->getNullPix(band));
492  }
493  // if the src is smaller than the destination in number
494  // of bands we will just duplicate the last band.
495  for(;band < theLargestNumberOfInputBands; ++band)
496  {
497  srcBands[band] = srcBands[minNumberOfBands - 1];
498  srcBandsNullPix[band] = static_cast<T>(currentImageData->getNullPix(minNumberOfBands - 1));
499  }
500 
501  if((destinationStatus == OSSIM_PARTIAL)&&
502  (currentStatus != OSSIM_EMPTY)&&
503  (currentStatus != OSSIM_NULL))
504  {
505  for(bandIndex = 0; bandIndex < theLargestNumberOfInputBands; ++bandIndex)
506  {
507 
508  for(ossim_uint32 offset = 0;
509  offset < upperBound;
510  ++offset)
511  {
512  if(srcBands[bandIndex][offset] > destBands[bandIndex][offset])
513  {
514  destBands[bandIndex][offset] = srcBands[bandIndex][offset];
515  }
516  }
517  }
518  }
519  else
520  {
521  ossim_uint32 upperBound = destination->getWidth()*destination->getHeight();
522  for(ossim_uint32 band=0; band < theLargestNumberOfInputBands; ++band)
523  {
524  for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
525  {
526  if(srcBands[band][offset] > destBands[band][offset])
527  {
528  destBands[band][offset] = srcBands[band][offset];
529  }
530  }
531  }
532  }
533 
534  destination->validate();
535 
536  currentImageData = getNextTile(layerIdx,tileRect, resLevel);
537  }
538  // Cleanup...
539  delete [] srcBands;
540  delete [] srcBandsNullPix;
541  delete [] destBands;
542  delete [] destBandsNullPix;
543  return destination;
544 }
virtual ossim_uint32 getWidth() const
virtual ossim_uint32 getNumberOfBands() const
bool valid() const
Definition: ossimRefPtr.h:75
virtual ossimDataObjectStatus getDataObjectStatus() const
virtual ossim_uint32 getHeight() const
virtual ossimRefPtr< ossimImageData > getNextTile(ossim_uint32 &returnedIdx, const ossim_uint32 startIdx, const ossimIrect &tileRect, ossim_uint32 resLevel=0)
ossim_uint32 theLargestNumberOfInputBands
virtual ossimDataObjectStatus validate() const
unsigned int ossim_uint32
virtual const ossim_float64 * getNullPix() const
ossimRefPtr< ossimImageData > theTile
virtual const void * getBuf() const
virtual void setDataObjectStatus(ossimDataObjectStatus status) const
Full list found in ossimConstants.h.
ossimDataObjectStatus
Definitions for data object status.

◆ combineNorm()

template<class T >
ossimRefPtr< ossimImageData > ossimMaxMosaic::combineNorm ( ,
const ossimIrect tileRect,
ossim_uint32  resLevel = 0 
)
protected

Definition at line 266 of file ossimMaxMosaic.cpp.

References ossimImageData::copyNormalizedBufferToTile(), ossimImageData::getBuf(), ossimDataObject::getDataObjectStatus(), ossimImageData::getHeight(), ossimImageData::getMaxPix(), ossimImageData::getMinPix(), ossimImageCombiner::getNextNormTile(), ossimImageData::getNullPix(), ossimImageData::getNumberOfBands(), ossimImageData::getWidth(), OSSIM_EMPTY, OSSIM_FULL, OSSIM_NULL, OSSIM_PARTIAL, ossimImageCombiner::theLargestNumberOfInputBands, theTile, ossimRefPtr< T >::valid(), and ossimImageData::validate().

Referenced by getTile().

270 {
271  ossim_uint32 layerIdx = 0;
272  ossimRefPtr<ossimImageData> destination = theTile;
273 
274  ossimRefPtr<ossimImageData> currentImageData =
275  getNextNormTile(layerIdx, 0, tileRect, resLevel);
276 
277  if(!currentImageData)
278  {
279  return currentImageData;
280  }
281 
282  std::vector<float*> srcBands(theLargestNumberOfInputBands);
283  std::vector<float> srcBandsNullPix(theLargestNumberOfInputBands);
284  std::vector<T*> destBands(theLargestNumberOfInputBands);
285  std::vector<T> destBandsNullPix(theLargestNumberOfInputBands);
286  std::vector<T> destBandsMinPix(theLargestNumberOfInputBands);
287  std::vector<T> destBandsMaxPix(theLargestNumberOfInputBands);
288  //float** srcBands = new float*[theLargestNumberOfInputBands];
289  //float* srcBandsNullPix = new float[theLargestNumberOfInputBands];
290  //T** destBands = new T*[theLargestNumberOfInputBands];
291  //T* destBandsNullPix = new T[theLargestNumberOfInputBands];
292  //T* destBandsMinPix = new T[theLargestNumberOfInputBands];
293  //T* destBandsMaxPix = new T[theLargestNumberOfInputBands];
294 
295  ossim_uint32 band;
296  ossim_uint32 upperBound = destination->getWidth()*destination->getHeight();
297  ossim_uint32 minNumberOfBands = currentImageData->getNumberOfBands();
298  for(band = 0; band < minNumberOfBands; ++band)
299  {
300  srcBands[band] = static_cast<float*>(currentImageData->getBuf(band));
301  srcBandsNullPix[band] = static_cast<float>(currentImageData->getNullPix(band));
302 
303  destBands[band] = static_cast<T*>(theTile->getBuf(band));
304  destBandsNullPix[band] = static_cast<T>(theTile->getNullPix(band));
305  destBandsMinPix[band] = static_cast<T>(theTile->getMinPix(band));
306  destBandsMaxPix[band] = static_cast<T>(theTile->getMaxPix(band));
307  }
308  // if the src is smaller than the destination in number
309  // of bands we will just duplicate the last band.
310  for(;band < theLargestNumberOfInputBands; ++band)
311  {
312  srcBands[band] = static_cast<float*>(srcBands[minNumberOfBands - 1]);
313  srcBandsNullPix[band] = static_cast<float>(currentImageData->getNullPix(minNumberOfBands - 1));
314 
315  destBands[band] = static_cast<T*>(theTile->getBuf(band));
316  destBandsNullPix[band] = static_cast<T>(theTile->getNullPix(band));
317  destBandsMinPix[band] = static_cast<T>(theTile->getMinPix(band));
318  destBandsMaxPix[band] = static_cast<T>(theTile->getMaxPix(band));
319  }
320  // most of the time we will not overlap so let's
321  // copy the first tile into destination and check later.
322  //
323  ossim_uint32 tempBandIdx = 0;
324  for(band = 0; band < theTile->getNumberOfBands();++band)
325  {
326  if(band < currentImageData->getNumberOfBands())
327  {
329  (float*)currentImageData->getBuf(band));
330  ++tempBandIdx;
331  }
332  else
333  {
334  if(tempBandIdx)
335  {
337  (float*)currentImageData->getBuf(tempBandIdx-1));
338  }
339  }
340  }
341  destination->validate();
342 
343  currentImageData = getNextNormTile(layerIdx, tileRect, resLevel);
344 
345  while(currentImageData.valid())
346  {
347  ossim_uint32 minNumberOfBands = currentImageData->getNumberOfBands();
348  ossimDataObjectStatus currentStatus = currentImageData->getDataObjectStatus();
349  ossimDataObjectStatus destinationStatus = destination->getDataObjectStatus();
350 
351  if(destinationStatus == OSSIM_FULL)
352  {
353  return destination;
354  }
355  for(band = 0; band < minNumberOfBands; ++band)
356  {
357  srcBands[band] = static_cast<float*>(currentImageData->getBuf(band));
358  srcBandsNullPix[band] = static_cast<float>(currentImageData->getNullPix(band));
359  }
360  // if the src is smaller than the destination in number
361  // of bands we will just duplicate the last band.
362  for(;band < theLargestNumberOfInputBands; ++band)
363  {
364  srcBands[band] = srcBands[minNumberOfBands - 1];
365  srcBandsNullPix[band] = static_cast<T>(currentImageData->getNullPix(minNumberOfBands - 1));
366  }
367 
368  if((destinationStatus == OSSIM_EMPTY)&&
369  (currentStatus != OSSIM_EMPTY)&&
370  (currentStatus != OSSIM_NULL))
371  {
372  ossim_uint32 upperBound = destination->getWidth()*destination->getHeight();
373  for(band=0; band < theLargestNumberOfInputBands; ++band)
374  {
375  float delta = destBandsMaxPix[band] - destBandsMinPix[band];
376  float minP = destBandsMinPix[band];
377  for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
378  {
379  destBands[band][offset] = (T)( minP + delta*srcBands[band][offset]);
380  }
381  }
382  }
383  else if((destinationStatus == OSSIM_PARTIAL)&&
384  (currentStatus != OSSIM_EMPTY)&&
385  (currentStatus != OSSIM_NULL))
386  {
387  for(band = 0; band < theLargestNumberOfInputBands; ++band)
388  {
389 
390  float delta = destBandsMaxPix[band] - destBandsMinPix[band];
391  float minP = destBandsMinPix[band];
392  for(ossim_uint32 offset = 0;
393  offset < upperBound;
394  ++offset)
395  {
396 
397  if(destBands[band][offset] == destBandsNullPix[band])
398  {
399  destBands[band][offset] = (T)(minP + delta*srcBands[band][offset]);
400  }
401  }
402  }
403  }
404  destination->validate();
405 
406  currentImageData = getNextNormTile(layerIdx, tileRect, resLevel);
407  }
408  // Cleanup...
409  // delete [] srcBands;
410  // delete [] srcBandsNullPix;
411  // delete [] destBands;
412  // delete [] destBandsNullPix;
413  // delete [] destBandsMinPix;
414  // delete [] destBandsMaxPix;
415 
416  return destination;
417 }
virtual ossim_uint32 getWidth() const
virtual const ossim_float64 * getMaxPix() const
virtual ossim_uint32 getNumberOfBands() const
bool valid() const
Definition: ossimRefPtr.h:75
virtual ossimRefPtr< ossimImageData > getNextNormTile(ossim_uint32 &returnedIdx, const ossim_uint32 index, const ossimIrect &tileRect, ossim_uint32 resLevel=0)
virtual ossimDataObjectStatus getDataObjectStatus() const
virtual ossim_uint32 getHeight() const
ossim_uint32 theLargestNumberOfInputBands
virtual ossimDataObjectStatus validate() const
unsigned int ossim_uint32
virtual const ossim_float64 * getNullPix() const
virtual void copyNormalizedBufferToTile(ossim_float64 *buf)
Copies buf passed in to tile.
virtual const ossim_float64 * getMinPix() const
ossimRefPtr< ossimImageData > theTile
virtual const void * getBuf() const
ossimDataObjectStatus
Definitions for data object status.

◆ getDescription()

ossimString ossimMaxMosaic::getDescription ( ) const
virtual

Reimplemented from ossimConnectableObject.

Definition at line 556 of file ossimMaxMosaic.cpp.

557 {
558  return ossimString("Combiner which puts maximum dn value on image.");
559 }

◆ getLongName()

ossimString ossimMaxMosaic::getLongName ( ) const
virtual

Reimplemented from ossimObject.

Definition at line 551 of file ossimMaxMosaic.cpp.

552 {
553  return ossimString("Max Mosaic");
554 }

◆ getShortName()

ossimString ossimMaxMosaic::getShortName ( ) const
virtual

Reimplemented from ossimObject.

Definition at line 546 of file ossimMaxMosaic.cpp.

547 {
548  return ossimString("ossimMaxMosaic");
549 }

◆ getTile()

ossimRefPtr< ossimImageData > ossimMaxMosaic::getTile ( const ossimIrect rect,
ossim_uint32  resLevel = 0 
)
virtual
Returns
the requested region of interest

Reimplemented from ossimImageSource.

Definition at line 43 of file ossimMaxMosaic.cpp.

References allocate(), combine(), combineNorm(), ossimImageData::getHeight(), ossimImageCombiner::getNextTile(), ossimConnectableObject::getNumberOfInputs(), ossimRectilinearDataObject::getScalarType(), ossimImageData::getWidth(), ossimImageCombiner::hasDifferentInputs(), ossimIrect::height(), ossimImageData::initialize(), ossimImageData::makeBlank(), OSSIM_DOUBLE, OSSIM_FLOAT, OSSIM_NORMALIZED_DOUBLE, OSSIM_NORMALIZED_FLOAT, OSSIM_SCALAR_UNKNOWN, OSSIM_SINT32, OSSIM_SINT8, OSSIM_SSHORT16, OSSIM_UCHAR, OSSIM_UINT32, OSSIM_USHORT11, OSSIM_USHORT12, OSSIM_USHORT13, OSSIM_USHORT14, OSSIM_USHORT15, OSSIM_USHORT16, ossimNotify(), ossimNotifyLevel_WARN, ossimImageData::setHeight(), ossimImageData::setOrigin(), ossimImageData::setWidth(), size, theTile, ossimIrect::ul(), ossimRefPtr< T >::valid(), and ossimIrect::width().

46 {
47  long size = getNumberOfInputs();
48  ossim_uint32 layerIdx = 0;
49  // If there is only one in the mosaic then just return it.
50  if(size == 1)
51  {
52  return getNextTile(layerIdx, 0, tileRect, resLevel);
53  }
54 
55  ossimIpt origin = tileRect.ul();
56  ossim_uint32 w = tileRect.width();
57  ossim_uint32 h = tileRect.height();
58 
59  if(!theTile.valid())
60  {
61  // First time through...
62  allocate();
63 
64  // If we still don't have a buffer then we will leave.
65  if(!theTile.valid())
66  {
68  }
69  }
70 
71  ossim_uint32 tileW = theTile->getWidth();
72  ossim_uint32 tileH = theTile->getHeight();
73  if((w != tileW)||
74  (h != tileH))
75  {
76  theTile->setWidth(w);
77  theTile->setHeight(h);
78  if((w*h)!=(tileW*tileH))
79  {
81  }
82  }
83  theTile->setOrigin(origin);
84 
85  //---
86  // General Note:
87  //
88  // Note: I will not check for disabled or enabled since we have
89  // no clear way to handle this within a mosaic. The default will be
90  // to do a simple a A over B type mosaic. Derived classes should
91  // check for the enabled and disabled and always
92  // use this default implementation if they are disabled.
93  //---
94  theTile->setOrigin(origin);
95  theTile->makeBlank();
96  switch(theTile->getScalarType())
97  {
98  case OSSIM_UCHAR:
99  {
100  if(!hasDifferentInputs())
101  {
102  return combine(static_cast<ossim_uint8>(0),
103  tileRect,
104  resLevel);
105  }
106  else
107  {
108  return combineNorm(static_cast<ossim_uint8>(0),
109  tileRect,
110  resLevel);
111  }
112  }
113  case OSSIM_SINT8:
114  {
115  if(!hasDifferentInputs())
116  {
117  return combine(static_cast<ossim_sint8>(0),
118  tileRect,
119  resLevel);
120  }
121  else
122  {
123  return combineNorm(static_cast<ossim_sint8>(0),
124  tileRect,
125  resLevel);
126  }
127  }
128  case OSSIM_FLOAT:
130  {
131  if(!hasDifferentInputs())
132  {
133  return combine(static_cast<float>(0),
134  tileRect,
135  resLevel);
136  }
137  else
138  {
139  return combineNorm(static_cast<float>(0),
140  tileRect,
141  resLevel);
142  }
143  }
144  case OSSIM_USHORT16:
145  case OSSIM_USHORT11:
146  case OSSIM_USHORT12:
147  case OSSIM_USHORT13:
148  case OSSIM_USHORT14:
149  case OSSIM_USHORT15:
150  {
151  if(!hasDifferentInputs())
152  {
153  return combine(static_cast<ossim_uint16>(0),
154  tileRect,
155  resLevel);
156  }
157  else
158  {
159  return combineNorm(static_cast<ossim_uint16>(0),
160  tileRect,
161  resLevel);
162  }
163  }
164  case OSSIM_SSHORT16:
165  {
166  if(!hasDifferentInputs())
167  {
168  return combine(static_cast<ossim_sint16>(0),
169  tileRect,
170  resLevel);
171  }
172  else
173  {
174  return combineNorm(static_cast<ossim_sint16>(0),
175  tileRect,
176  resLevel);
177  }
178  }
179  case OSSIM_SINT32:
180  {
181  if(!hasDifferentInputs())
182  {
183  return combine(static_cast<ossim_sint32>(0),
184  tileRect,
185  resLevel);
186  }
187  else
188  {
189  return combineNorm(static_cast<ossim_sint32>(0),
190  tileRect,
191  resLevel);
192  }
193  }
194  case OSSIM_UINT32:
195  {
196  if(!hasDifferentInputs())
197  {
198  return combine(static_cast<ossim_uint32>(0),
199  tileRect,
200  resLevel);
201  }
202  else
203  {
204  return combineNorm(static_cast<ossim_uint32>(0),
205  tileRect,
206  resLevel);
207  }
208  }
209  case OSSIM_DOUBLE:
211  {
212  if(!hasDifferentInputs())
213  {
214  return combine(static_cast<double>(0),
215  tileRect,
216  resLevel);
217  }
218  else
219  {
220  return combineNorm(static_cast<double>(0),
221  tileRect,
222  resLevel);
223  }
224  }
226  default:
227  {
229  << "Scalar type = " << theTile->getScalarType()
230  << " Not supported by ossimMaxMosaic" << endl;
231  }
232  }
233 
235 }
16 bit unsigned integer (15 bits used)
8 bit signed integer
virtual ossim_uint32 getWidth() const
bool valid() const
Definition: ossimRefPtr.h:75
virtual ossim_uint32 getHeight() const
16 bit unsigned integer (14 bits used)
16 bit unsigned integer (13 bits used)
32 bit unsigned integer
virtual void initialize()
Initialize the data buffer.
void allocate()
Called on first getTile, will initialize all data needed.
ossimRefPtr< ossimImageData > combine(T, const ossimIrect &tileRect, ossim_uint32 resLevel=0)
virtual void setHeight(ossim_uint32 height)
virtual ossimRefPtr< ossimImageData > getNextTile(ossim_uint32 &returnedIdx, const ossim_uint32 startIdx, const ossimIrect &tileRect, ossim_uint32 resLevel=0)
yy_size_t size
32 bit signed integer
unsigned int ossim_uint32
32 bit normalized floating point
virtual void setWidth(ossim_uint32 width)
virtual bool hasDifferentInputs() const
virtual void setOrigin(const ossimIpt &origin)
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)
ossimRefPtr< ossimImageData > combineNorm(T, const ossimIrect &tileRect, ossim_uint32 resLevel=0)
ossimRefPtr< ossimImageData > theTile
virtual ossim_uint32 getNumberOfInputs() const
Returns the number of input objects.
32 bit floating point
16 bit unsigned iteger
64 bit floating point
16 bit signed integer
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
8 bit unsigned iteger
16 bit unsigned integer (12 bits used)

◆ initialize()

void ossimMaxMosaic::initialize ( )
virtual

Reimplemented from ossimImageCombiner.

Definition at line 237 of file ossimMaxMosaic.cpp.

References ossimImageCombiner::initialize(), and theTile.

238 {
240  theTile = NULL;
241 }
ossimRefPtr< ossimImageData > theTile

◆ loadState()

bool ossimMaxMosaic::loadState ( const ossimKeywordlist kwl,
const char *  prefix = 0 
)
virtual

Method to the load (recreate) the state of an object from a keyword list.

Return true if ok or false on error.

Reimplemented from ossimImageCombiner.

Definition at line 260 of file ossimMaxMosaic.cpp.

References ossimImageCombiner::loadState().

262 {
263  return ossimImageCombiner::loadState(kwl, prefix);
264 }
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=NULL)
Method to the load (recreate) the state of an object from a keyword list.

◆ saveState()

bool ossimMaxMosaic::saveState ( ossimKeywordlist kwl,
const char *  prefix = 0 
) const
virtual

Method to save the state of an object to a keyword list.

Return true if ok or false on error.

Reimplemented from ossimImageCombiner.

Definition at line 254 of file ossimMaxMosaic.cpp.

References ossimImageCombiner::saveState().

256 {
257  return ossimImageCombiner::saveState(kwl, prefix);
258 }
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=NULL) const
Method to save the state of an object to a keyword list.

Member Data Documentation

◆ theTile

ossimRefPtr<ossimImageData> ossimMaxMosaic::theTile
protected

Definition at line 64 of file ossimMaxMosaic.h.

Referenced by allocate(), combine(), combineNorm(), getTile(), and initialize().


The documentation for this class was generated from the following files: