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

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

#include <ossimImageMosaic.h>

Inheritance diagram for ossimImageMosaic:
ossimImageCombiner ossimImageSource ossimConnectableObjectListener ossimSource ossimListener ossimConnectableObject ossimErrorStatusInterface ossimObject ossimListenerManager ossimPropertyInterface ossimReferenced ossimBlendMosaic ossimClosestToCenterCombiner ossimFeatherMosaic ossimOrthoImageMosaic

Public Member Functions

 ossimImageMosaic ()
 
 ossimImageMosaic (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...
 
- 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 ossimString getDescription () const
 
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 getShortName () const
 
virtual ossimString getLongName () 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 ~ossimImageMosaic ()
 
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 26 of file ossimImageMosaic.h.

Constructor & Destructor Documentation

◆ ossimImageMosaic() [1/2]

ossimImageMosaic::ossimImageMosaic ( )

Definition at line 21 of file ossimImageMosaic.cpp.

23  theTile(NULL)
24 {
25 
26 }
ossimRefPtr< ossimImageData > theTile

◆ ossimImageMosaic() [2/2]

ossimImageMosaic::ossimImageMosaic ( ossimConnectableObject::ConnectableObjectList inputSources)

Definition at line 28 of file ossimImageMosaic.cpp.

29  : ossimImageCombiner(inputSources),
30  theTile(NULL)
31 {
32 }
ossimRefPtr< ossimImageData > theTile

◆ ~ossimImageMosaic()

ossimImageMosaic::~ossimImageMosaic ( )
protectedvirtual

Definition at line 35 of file ossimImageMosaic.cpp.

36 {
37 }

Member Function Documentation

◆ allocate()

void ossimImageMosaic::allocate ( )
protected

Called on first getTile, will initialize all data needed.

Definition at line 241 of file ossimImageMosaic.cpp.

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

Referenced by getTile(), ossimClosestToCenterCombiner::getTile(), ossimBlendMosaic::initialize(), and ossimFeatherMosaic::initialize().

242 {
243  theTile = NULL;
244 
245  if( (getNumberOfInputs() > 0) && getInput(0) )
246  {
248  theTile->initialize();
249  }
250 }
ossimRefPtr< ossimImageData > theTile
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
virtual ossim_uint32 getNumberOfInputs() const
Returns the number of input objects.

◆ combine()

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

Definition at line 409 of file ossimImageMosaic.cpp.

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

Referenced by getTile().

413 {
414  ossim_uint32 layerIdx = 0;
415  //---
416  // Get the first tile from the input sources. If this(index 0) is blank
417  // that means there are no layers so go no further.
418  //---
419  ossimRefPtr<ossimImageData> currentImageData =
420  getNextTile(layerIdx, 0, tileRect, resLevel);
421  if (!currentImageData)
422  {
423  return theTile;
424  }
425 
426  ossimRefPtr<ossimImageData> destination = theTile;
427  ossimDataObjectStatus destinationStatus = theTile->getDataObjectStatus();
428 
429  T** srcBands = new T*[theLargestNumberOfInputBands];
430  T* srcBandsNullPix = new T[theLargestNumberOfInputBands];
431  T** destBands = new T*[theLargestNumberOfInputBands];
432  T* destBandsNullPix = new T[theLargestNumberOfInputBands];
433 
434  ossim_uint32 band;
435  ossim_uint32 upperBound = destination->getWidth()*destination->getHeight();
436  ossim_uint32 minNumberOfBands = currentImageData->getNumberOfBands();
437  for(band = 0; band < minNumberOfBands; ++band)
438  {
439  srcBands[band] = static_cast<T*>(currentImageData->getBuf(band));
440  destBands[band] = static_cast<T*>(theTile->getBuf(band));
441  srcBandsNullPix[band] = static_cast<T>(currentImageData->getNullPix(band));
442  destBandsNullPix[band] = static_cast<T>(theTile->getNullPix(band));
443  }
444  // if the src is smaller than the destination in number
445  // of bands we will just duplicate the last band.
446  for(;band < theLargestNumberOfInputBands; ++band)
447  {
448  srcBands[band] = static_cast<T*>(srcBands[minNumberOfBands - 1]);
449  destBands[band] = static_cast<T*>(theTile->getBuf(band));
450  srcBandsNullPix[band] = static_cast<T>(currentImageData->getNullPix(minNumberOfBands - 1));
451  destBandsNullPix[band] = static_cast<T>(theTile->getNullPix(band));
452  }
453 
454  // Loop to copy from layers to output tile.
455  while(currentImageData.valid())
456  {
457  //---
458  // Check the status of the source tile. If empty get the next source
459  // tile and loop back.
460  //---
461  ossimDataObjectStatus currentStatus =
462  currentImageData->getDataObjectStatus();
463  if ( (currentStatus == OSSIM_EMPTY) || (currentStatus == OSSIM_NULL) )
464  {
465  currentImageData = getNextNormTile(layerIdx, tileRect, resLevel);
466  continue;
467  }
468 
469  ossim_uint32 minNumberOfBands = currentImageData->getNumberOfBands();
470 
471  for(band = 0; band < minNumberOfBands; ++band)
472  {
473  srcBands[band] = static_cast<T*>(currentImageData->getBuf(band));
474  srcBandsNullPix[band] = static_cast<T>(currentImageData->getNullPix(band));
475  }
476  // if the src is smaller than the destination in number
477  // of bands we will just duplicate the last band.
478  for(;band < theLargestNumberOfInputBands; ++band)
479  {
480  srcBands[band] = srcBands[minNumberOfBands - 1];
481  srcBandsNullPix[band] = static_cast<T>(currentImageData->getNullPix(minNumberOfBands - 1));
482  }
483 
484  if ( (currentStatus == OSSIM_FULL) &&
485  (destinationStatus == OSSIM_EMPTY) )
486  {
487  // Copy full tile to empty tile.
488  for(ossim_uint32 band=0; band < theLargestNumberOfInputBands; ++band)
489  {
490  for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
491  {
492  destBands[band][offset] = srcBands[band][offset];
493  }
494  }
495  }
496  else // Copy tile checking all the pixels...
497  {
498  for(band = 0; band < theLargestNumberOfInputBands; ++band)
499  {
500 
501  for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
502  {
503  if(destBands[band][offset] == destBandsNullPix[band])
504  {
505  destBands[band][offset] = srcBands[band][offset];
506  }
507  }
508  }
509  }
510 
511  // Validate output tile and return if full.
512  destinationStatus = destination->validate();
513  if (destinationStatus == OSSIM_FULL)
514  {
515  break;//return destination;
516  }
517 
518  // If we get here we're are still not full. Get a tile from next layer.
519  currentImageData = getNextTile(layerIdx, tileRect, resLevel);
520  }
521 
522  // Cleanup...
523  delete [] srcBands;
524  delete [] destBands;
525  delete [] srcBandsNullPix;
526  delete [] destBandsNullPix;
527 
528  return destination;
529 }
virtual ossim_uint32 getWidth() const
ossimRefPtr< ossimImageData > theTile
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
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
virtual const void * getBuf() const
ossimDataObjectStatus
Definitions for data object status.

◆ combineNorm()

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

Definition at line 264 of file ossimImageMosaic.cpp.

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

Referenced by getTile().

268 {
269  ossim_uint32 layerIdx = 0;
270  //---
271  // Get the first tile from the input sources. If this(index 0) is blank
272  // that means there are no layers so go no further.
273  //---
274  ossimRefPtr<ossimImageData> currentImageData =
275  getNextNormTile(layerIdx, 0, tileRect, resLevel);
276  if(!currentImageData)
277  {
278  return theTile;
279  }
280 
281  ossimRefPtr<ossimImageData> destination = theTile;
282  ossimDataObjectStatus destinationStatus = theTile->getDataObjectStatus();
283 
284 
285  float** srcBands = new float*[theLargestNumberOfInputBands];
286  float* srcBandsNullPix = new float[theLargestNumberOfInputBands];
287  T** destBands = new T*[theLargestNumberOfInputBands];
288  T* destBandsNullPix = new T[theLargestNumberOfInputBands];
289  T* destBandsMinPix = new T[theLargestNumberOfInputBands];
290  T* destBandsMaxPix = new T[theLargestNumberOfInputBands];
291 
292  ossim_uint32 band;
293  ossim_uint32 upperBound = destination->getWidth()*destination->getHeight();
294  ossim_uint32 minNumberOfBands = currentImageData->getNumberOfBands();
295  for(band = 0; band < minNumberOfBands; ++band)
296  {
297  srcBands[band] = static_cast<float*>(currentImageData->getBuf(band));
298  srcBandsNullPix[band] = static_cast<float>(currentImageData->getNullPix(band));
299 
300  destBands[band] = static_cast<T*>(theTile->getBuf(band));
301  destBandsNullPix[band] = static_cast<T>(theTile->getNullPix(band));
302  destBandsMinPix[band] = static_cast<T>(theTile->getMinPix(band));
303  destBandsMaxPix[band] = static_cast<T>(theTile->getMaxPix(band));
304  }
305 
306  // if the src is smaller than the destination in number
307  // of bands we will just duplicate the last band.
308  for(;band < theLargestNumberOfInputBands; ++band)
309  {
310  srcBands[band] = static_cast<float*>(srcBands[minNumberOfBands - 1]);
311  srcBandsNullPix[band] = static_cast<float>(currentImageData->getNullPix(minNumberOfBands - 1));
312 
313  destBands[band] = static_cast<T*>(theTile->getBuf(band));
314  destBandsNullPix[band] = static_cast<T>(theTile->getNullPix(band));
315  destBandsMinPix[band] = static_cast<T>(theTile->getMinPix(band));
316  destBandsMaxPix[band] = static_cast<T>(theTile->getMaxPix(band));
317  }
318 
319  // Loop to copy from layers to output tile.
320  while(currentImageData.valid())
321  {
322  //---
323  // Check the status of the source tile. If empty get the next source
324  // tile and loop back.
325  //---
326  ossimDataObjectStatus currentStatus =
327  currentImageData->getDataObjectStatus();
328  if ( (currentStatus == OSSIM_EMPTY) || (currentStatus == OSSIM_NULL) )
329  {
330  currentImageData = getNextNormTile(layerIdx, tileRect, resLevel);
331  continue;
332  }
333 
334  ossim_uint32 minNumberOfBands = currentImageData->getNumberOfBands();
335 
336  for(band = 0; band < minNumberOfBands; ++band)
337  {
338  srcBands[band] = static_cast<float*>(currentImageData->getBuf(band));
339  srcBandsNullPix[band] = static_cast<float>(currentImageData->getNullPix(band));
340  }
341  // if the src is smaller than the destination in number
342  // of bands we will just duplicate the last band.
343  for(;band < theLargestNumberOfInputBands; ++band)
344  {
345  srcBands[band] = srcBands[minNumberOfBands - 1];
346  srcBandsNullPix[band] = static_cast<T>(currentImageData->getNullPix(minNumberOfBands - 1));
347  }
348 
349  if ( (currentStatus == OSSIM_FULL) &&
350  (destinationStatus == OSSIM_EMPTY) )
351  {
352  // Copy full tile to empty tile.
353  for(band=0; band < theLargestNumberOfInputBands; ++band)
354  {
355  float delta = destBandsMaxPix[band] - destBandsMinPix[band];
356  float minP = destBandsMinPix[band];
357 
358  for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
359  {
360  destBands[band][offset] =
361  (T)( minP + delta*srcBands[band][offset]);
362  }
363  }
364  }
365  else // Copy tile checking all the pixels...
366  {
367  for(band = 0; band < theLargestNumberOfInputBands; ++band)
368  {
369  float delta = destBandsMaxPix[band] - destBandsMinPix[band];
370  float minP = destBandsMinPix[band];
371 
372  for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
373  {
374  if (destBands[band][offset] == destBandsNullPix[band])
375  {
376  if (srcBands[band][offset] != srcBandsNullPix[band])
377  {
378  destBands[band][offset] =
379  (T)(minP + delta*srcBands[band][offset]);
380  }
381  }
382  }
383  }
384  }
385 
386  // Validate output tile and return if full.
387  destinationStatus = destination->validate();
388  if (destinationStatus == OSSIM_FULL)
389  {
390 
391  break;//return destination;
392  }
393 
394  // If we get here we're are still not full. Get a tile from next layer.
395  currentImageData = getNextNormTile(layerIdx, tileRect, resLevel);
396  }
397 
398  // Cleanup...
399  delete [] srcBands;
400  delete [] destBands;
401  delete [] srcBandsNullPix;
402  delete [] destBandsNullPix;
403  delete [] destBandsMinPix;
404  delete [] destBandsMaxPix;
405 
406  return destination;
407 }
virtual ossim_uint32 getWidth() const
ossimRefPtr< ossimImageData > theTile
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 const ossim_float64 * getMinPix() const
virtual const void * getBuf() const
ossimDataObjectStatus
Definitions for data object status.

◆ getTile()

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

Reimplemented from ossimImageSource.

Reimplemented in ossimClosestToCenterCombiner, ossimFeatherMosaic, and ossimBlendMosaic.

Definition at line 39 of file ossimImageMosaic.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().

Referenced by ossimBlendMosaic::getTile(), ossimFeatherMosaic::getTile(), ossimClosestToCenterCombiner::getTile(), and ossimTiledElevationDatabase::mapRegion().

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

Reimplemented from ossimImageCombiner.

Reimplemented in ossimFeatherMosaic, ossimOrthoImageMosaic, and ossimBlendMosaic.

Definition at line 235 of file ossimImageMosaic.cpp.

References ossimImageCombiner::initialize(), and theTile.

Referenced by ossimBlendMosaic::initialize(), and ossimFeatherMosaic::initialize().

236 {
238  theTile = NULL;
239 }
ossimRefPtr< ossimImageData > theTile

◆ loadState()

bool ossimImageMosaic::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.

Reimplemented in ossimBlendMosaic.

Definition at line 258 of file ossimImageMosaic.cpp.

References ossimImageCombiner::loadState().

Referenced by ossimBlendMosaic::loadState().

260 {
261  return ossimImageCombiner::loadState(kwl, prefix);
262 }
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 ossimImageMosaic::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.

Reimplemented in ossimBlendMosaic.

Definition at line 252 of file ossimImageMosaic.cpp.

References ossimImageCombiner::saveState().

Referenced by ossimBlendMosaic::saveState().

254 {
255  return ossimImageCombiner::saveState(kwl, prefix);
256 }
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> ossimImageMosaic::theTile
protected

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