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

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

#include <ossimElevationMosaic.h>

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

Public Member Functions

 ossimElevationMosaic ()
 
 ossimElevationMosaic (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 ~ossimElevationMosaic ()
 
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 ossimElevationMosaic.h.

Constructor & Destructor Documentation

◆ ossimElevationMosaic() [1/2]

ossimElevationMosaic::ossimElevationMosaic ( )

Definition at line 23 of file ossimElevationMosaic.cpp.

25  theTile(NULL)
26 {
27 
28 }
ossimRefPtr< ossimImageData > theTile

◆ ossimElevationMosaic() [2/2]

ossimElevationMosaic::ossimElevationMosaic ( ossimConnectableObject::ConnectableObjectList inputSources)

Definition at line 30 of file ossimElevationMosaic.cpp.

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

◆ ~ossimElevationMosaic()

ossimElevationMosaic::~ossimElevationMosaic ( )
protectedvirtual

Definition at line 37 of file ossimElevationMosaic.cpp.

38 {
39 }

Member Function Documentation

◆ allocate()

void ossimElevationMosaic::allocate ( )
protected

Called on first getTile, will initialize all data needed.

Definition at line 243 of file ossimElevationMosaic.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()
ossimRefPtr< ossimImageData > theTile
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 > ossimElevationMosaic::combine ( ,
const ossimIrect tileRect,
ossim_uint32  resLevel = 0 
)
protected

Definition at line 411 of file ossimElevationMosaic.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, and ossimRefPtr< T >::valid().

Referenced by getTile().

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

= srcBandsNullPix[band])

Definition at line 266 of file ossimElevationMosaic.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, and ossimRefPtr< T >::valid().

Referenced by getTile().

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

Reimplemented from ossimImageSource.

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

44 {
45  long size = getNumberOfInputs();
46  ossim_uint32 layerIdx = 0;
47  // If there is only one in the mosaic then just return it.
48  if(size == 1)
49  {
50  return getNextTile(layerIdx, 0, tileRect, resLevel);
51  }
52 
53  ossimIpt origin = tileRect.ul();
54  ossim_uint32 w = tileRect.width();
55  ossim_uint32 h = tileRect.height();
56 
57  if(!theTile.valid())
58  {
59  // try to initialize
60  allocate();
61 
62  // if we still don't have a buffer
63  // then we will leave
64  if(!theTile.valid())
65  {
67  }
68  }
69 
70  ossim_uint32 tileW = theTile->getWidth();
71  ossim_uint32 tileH = theTile->getHeight();
72  if((w != tileW)||
73  (h != tileH))
74  {
75  theTile->setWidth(w);
76  theTile->setHeight(h);
77  if((w*h)!=(tileW*tileH))
78  {
80  }
81  }
82  theTile->setOrigin(origin);
83 
84  //---
85  // General Note:
86  //
87  // Note: I will not check for disabled or enabled since we have
88  // no clear way to handle this within a mosaic. The default will be
89  // to do a simple a A over B type mosaic. Derived classes should
90  // check for the enabled and disabled and always
91  // use this default implementation if they are disabled.
92  //---
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 ossimElevationMosaic" << 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
ossimRefPtr< ossimImageData > combine(T, const ossimIrect &tileRect, ossim_uint32 resLevel=0)
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)
virtual ossimRefPtr< ossimImageData > getNextTile(ossim_uint32 &returnedIdx, const ossim_uint32 startIdx, const ossimIrect &tileRect, ossim_uint32 resLevel=0)
ossimRefPtr< ossimImageData > theTile
yy_size_t size
32 bit signed integer
unsigned int ossim_uint32
32 bit normalized floating point
virtual void setWidth(ossim_uint32 width)
ossimRefPtr< ossimImageData > combineNorm(T, const ossimIrect &tileRect, ossim_uint32 resLevel=0)
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.
void allocate()
Called on first getTile, will initialize all data needed.
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 ossimElevationMosaic::initialize ( )
virtual

Reimplemented from ossimImageCombiner.

Definition at line 237 of file ossimElevationMosaic.cpp.

References ossimImageCombiner::initialize(), and theTile.

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

◆ loadState()

bool ossimElevationMosaic::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 ossimElevationMosaic.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 ossimElevationMosaic::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 ossimElevationMosaic.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> ossimElevationMosaic::theTile
protected

Definition at line 59 of file ossimElevationMosaic.h.

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


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