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

Performs a spatial blend accross overlapping regions. More...

#include <ossimFeatherMosaic.h>

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

Classes

class  ossimFeatherInputInformation
 This is only visible by this class and will remain here unless we want to move it later. More...
 

Public Member Functions

 ossimFeatherMosaic ()
 
 ossimFeatherMosaic (ossimConnectableObject::ConnectableObjectList &inputSources)
 
virtual ossimRefPtr< ossimImageDatagetTile (const ossimIrect &origin, ossim_uint32 resLevel=0)
 
virtual void initialize ()
 
- Public Member Functions inherited from ossimImageMosaic
 ossimImageMosaic ()
 
 ossimImageMosaic (ossimConnectableObject::ConnectableObjectList &inputSources)
 
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 ~ossimFeatherMosaic ()
 
template<class T >
ossimRefPtr< ossimImageDatacombine (T dummyVariableNotUsed, const ossimIrect &tileRect, ossim_uint32 resLevel)
 The dummy variable is used for the template type. More...
 
virtual double computeWeight (long index, const ossimDpt &point) const
 
- Protected Member Functions inherited from ossimImageMosaic
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

ossimFeatherInputInformationtheInputFeatherInformation
 will hold an array of input information More...
 
ossimRefPtr< ossimImageDatatheAlphaSum
 
ossimRefPtr< ossimImageDatatheResult
 
long theFeatherInfoSize
 Will hold the count for the feather information list. More...
 
- Protected Attributes inherited from ossimImageMosaic
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
 

Friends

ostream & operator<< (ostream &out, const ossimFeatherInputInformation &data)
 

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

Performs a spatial blend accross overlapping regions.

Definition at line 24 of file ossimFeatherMosaic.h.

Constructor & Destructor Documentation

◆ ossimFeatherMosaic() [1/2]

ossimFeatherMosaic::ossimFeatherMosaic ( )

Definition at line 24 of file ossimFeatherMosaic.cpp.

27  theAlphaSum(NULL),
28  theResult(NULL),
30 {
31 }
ossimRefPtr< ossimImageData > theAlphaSum
long theFeatherInfoSize
Will hold the count for the feather information list.
ossimRefPtr< ossimImageData > theResult
ossimFeatherInputInformation * theInputFeatherInformation
will hold an array of input information

◆ ossimFeatherMosaic() [2/2]

ossimFeatherMosaic::ossimFeatherMosaic ( ossimConnectableObject::ConnectableObjectList inputSources)

Definition at line 33 of file ossimFeatherMosaic.cpp.

References initialize().

34  :ossimImageMosaic(inputSources),
36  theAlphaSum(NULL),
37  theResult(NULL),
39 {
40  initialize();
41 }
ossimRefPtr< ossimImageData > theAlphaSum
long theFeatherInfoSize
Will hold the count for the feather information list.
ossimRefPtr< ossimImageData > theResult
ossimFeatherInputInformation * theInputFeatherInformation
will hold an array of input information

◆ ~ossimFeatherMosaic()

ossimFeatherMosaic::~ossimFeatherMosaic ( )
protectedvirtual

Definition at line 43 of file ossimFeatherMosaic.cpp.

References theFeatherInfoSize, and theInputFeatherInformation.

44 {
46  {
49  }
51 }
long theFeatherInfoSize
Will hold the count for the feather information list.
ossimFeatherInputInformation * theInputFeatherInformation
will hold an array of input information

Member Function Documentation

◆ combine()

template<class T >
ossimRefPtr< ossimImageData > ossimFeatherMosaic::combine ( dummyVariableNotUsed,
const ossimIrect tileRect,
ossim_uint32  resLevel 
)
protected

The dummy variable is used for the template type.

See the getTile method for the call.

Definition at line 148 of file ossimFeatherMosaic.cpp.

References computeWeight(), ossimImageData::fill(), ossimImageData::getBuf(), ossimDataObject::getDataObjectStatus(), ossimImageData::getHeight(), ossimImageData::getMaxPix(), ossimImageData::getMinPix(), ossimImageCombiner::getNextTile(), ossimImageData::getNullPix(), ossimImageData::getNumberOfBands(), ossimImageData::getOrigin(), ossimImageData::getWidth(), ossimImageData::isNull(), OSSIM_EMPTY, OSSIM_NULL, OSSIM_PARTIAL, ossimDataObject::setDataObjectStatus(), theAlphaSum, ossimImageCombiner::theLargestNumberOfInputBands, theResult, ossimImageMosaic::theTile, ossimRefPtr< T >::valid(), ossimImageData::validate(), ossimIpt::x, and ossimIpt::y.

Referenced by getTile().

152 {
153  ossimRefPtr<ossimImageData> currentImageData;
154  ossim_uint32 band;
155  long upperBound = theTile->getWidth()*theTile->getHeight();
156  long offset = 0;
157  long row = 0;
158  long col = 0;
159  long numberOfTilesProcessed = 0;
160  float *sumBand = static_cast<float*>(theAlphaSum->getBuf());
161  float *bandRes = NULL;
162  ossimIpt point;
163 
164  theAlphaSum->fill(0.0);
165  theResult->fill(0.0);
166 
167  T** srcBands = new T*[theLargestNumberOfInputBands];
168  T** destBands = new T*[theLargestNumberOfInputBands];
169  ossim_uint32 layerIdx = 0;
170  currentImageData = getNextTile(layerIdx,
171  0,
172  tileRect,
173  resLevel);
174  if(!currentImageData.valid())
175  {
176  delete [] srcBands;
177  delete [] destBands;
178  return currentImageData;
179  }
180  ossim_uint32 minNumberOfBands = currentImageData->getNumberOfBands();
181  for(band = 0; band < minNumberOfBands; ++band)
182  {
183  srcBands[band] = static_cast<T*>(currentImageData->getBuf(band));
184  destBands[band] = static_cast<T*>(theTile->getBuf(band));
185  }
186  // if the src is smaller than the destination in number
187  // of bands we will just duplicate the last band.
188  for(;band < theLargestNumberOfInputBands; ++band)
189  {
190  srcBands[band] = srcBands[minNumberOfBands - 1];
191  destBands[band] = static_cast<T*>(theTile->getBuf(band));
192  }
193 
194  // most of the time we will not overlap so let's
195  // copy the first tile into destination and check later.
196  //
197  for(band = 0; band < theTile->getNumberOfBands();++band)
198  {
199  T* destBand = destBands[band];
200  T* srcBand = srcBands[band];
201  if(destBand&&srcBand)
202  {
203  for(offset = 0; offset < upperBound;++offset)
204  {
205  *destBand = *srcBand;
206  ++srcBand; ++destBand;
207  }
208  }
209  }
210  theTile->setDataObjectStatus(currentImageData->getDataObjectStatus());
211 
212  while(currentImageData.valid())
213  {
214  ossimDataObjectStatus currentStatus = currentImageData->getDataObjectStatus();
215  point = currentImageData->getOrigin();
216  long h = (long)currentImageData->getHeight();
217  long w = (long)currentImageData->getWidth();
218  if( (currentStatus != OSSIM_EMPTY) &&
219  (currentStatus != OSSIM_NULL))
220  {
221  ++numberOfTilesProcessed;
222  offset = 0;
223  minNumberOfBands = currentImageData->getNumberOfBands();
224  for(band = 0; band < minNumberOfBands; ++band)
225  {
226  srcBands[band] = static_cast<T*>(currentImageData->getBuf(band));
227  }
228  // if the src is smaller than the destination in number
229  // of bands we will just duplicate the last band.
230  for(;band < theLargestNumberOfInputBands; ++band)
231  {
232  srcBands[band] = srcBands[minNumberOfBands - 1];
233  }
234  if(currentStatus == OSSIM_PARTIAL)
235  {
236  for(row = 0; row < h; ++row)
237  {
238  for(col = 0; col < w; ++col)
239  {
240  if(!currentImageData->isNull(offset))
241  {
242  double weight = computeWeight(layerIdx,
243  ossimDpt(point.x+col,
244  point.y+row));
245 
246  for(band = 0; band < theLargestNumberOfInputBands; ++band)
247  {
248  bandRes = static_cast<float*>(theResult->getBuf(band));
249  bandRes[offset] += (srcBands[band][offset]*weight);
250  }
251  sumBand[offset] += weight;
252  }
253  ++offset;
254  }
255  }
256  }
257  else
258  {
259  offset = 0;
260 
261  for(row = 0; row < h; ++row)
262  {
263  for(col = 0; col < w; ++col)
264  {
265  double weight = computeWeight(layerIdx,
266  ossimDpt(point.x+col,
267  point.y+row));
268 
269  for(band = 0; band < theLargestNumberOfInputBands; ++band)
270  {
271  bandRes = static_cast<float*>(theResult->getBuf(band));
272 
273  bandRes[offset] += (srcBands[band][offset]*weight);
274  }
275  sumBand[offset] += weight;
276  ++offset;
277  }
278  }
279  }
280  }
281  currentImageData = getNextTile(layerIdx, tileRect, resLevel);
282  }
283  upperBound = theTile->getWidth()*theTile->getHeight();
284 
285  if(numberOfTilesProcessed > 1)
286  {
287  const double* minPix = theTile->getMinPix();
288  const double* maxPix = theTile->getMaxPix();
289  const double* nullPix= theTile->getNullPix();
290  for(offset = 0; offset < upperBound;++offset)
291  {
292  for(band = 0; band < theTile->getNumberOfBands();++band)
293  {
294  T* destBand = static_cast<T*>(theTile->getBuf(band));
295  float* weightedBand = static_cast<float*>(theResult->getBuf(band));
296 
297  // this should be ok to test 0.0 instead of
298  // FLT_EPSILON range for 0 since we set it.
299  if(sumBand[offset] != 0.0)
300  {
301  weightedBand[offset] = (weightedBand[offset])/sumBand[offset];
302  if(weightedBand[offset]<minPix[band])
303  {
304  weightedBand[offset] = minPix[band];
305  }
306  else if(weightedBand[offset] > maxPix[band])
307  {
308  weightedBand[offset] = maxPix[band];
309  }
310  }
311  else
312  {
313  weightedBand[offset] = nullPix[band];
314  }
315  destBand[offset] = static_cast<T>(weightedBand[offset]);
316  }
317  }
318  theTile->validate();
319  }
320 
321  delete [] srcBands;
322  delete [] destBands;
323 
324  return theTile;
325 }
ossimRefPtr< ossimImageData > theAlphaSum
virtual ossim_uint32 getWidth() const
void fill(ossim_uint32 band, ossim_float64 value)
will fill the entire band with the value.
ossimRefPtr< ossimImageData > theTile
virtual const ossim_float64 * getMaxPix() const
virtual ossim_uint32 getNumberOfBands() const
bool valid() const
Definition: ossimRefPtr.h:75
virtual ossimDataObjectStatus getDataObjectStatus() const
virtual ossim_uint32 getHeight() const
bool isNull(ossim_uint32 offset) 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 ossim_float64 * getMinPix() const
ossimRefPtr< ossimImageData > theResult
ossim_int32 y
Definition: ossimIpt.h:142
virtual const void * getBuf() const
virtual void setDataObjectStatus(ossimDataObjectStatus status) const
Full list found in ossimConstants.h.
ossim_int32 x
Definition: ossimIpt.h:141
virtual double computeWeight(long index, const ossimDpt &point) const
ossimDataObjectStatus
Definitions for data object status.
virtual const ossimIpt & getOrigin() const

◆ computeWeight()

double ossimFeatherMosaic::computeWeight ( long  index,
const ossimDpt point 
) const
protectedvirtual

Definition at line 327 of file ossimFeatherMosaic.cpp.

References ossimFeatherMosaic::ossimFeatherInputInformation::theAxis1, ossimFeatherMosaic::ossimFeatherInputInformation::theAxis1Length, ossimFeatherMosaic::ossimFeatherInputInformation::theAxis2, ossimFeatherMosaic::ossimFeatherInputInformation::theAxis2Length, ossimFeatherMosaic::ossimFeatherInputInformation::theCenter, theInputFeatherInformation, ossimDpt::x, and ossimDpt::y.

Referenced by combine().

329 {
330  ossimFeatherInputInformation& info = theInputFeatherInformation[index];
331  double result = 0.0;
332  ossimDpt delta = point-info.theCenter;
333 
334  double length1 = fabs(delta.x*info.theAxis1.x + delta.y*info.theAxis1.y)/info.theAxis1Length;
335  double length2 = fabs(delta.x*info.theAxis2.x + delta.y*info.theAxis2.y)/info.theAxis2Length;
336 
337  if(length1 > length2)
338  {
339  result = (1.0 - length1);
340  }
341  else
342  {
343  result = (1.0 - length2);
344  }
345  if(result < 0) result = 0;
346 
347  return result;
348 }
double y
Definition: ossimDpt.h:165
double x
Definition: ossimDpt.h:164
ossimFeatherInputInformation * theInputFeatherInformation
will hold an array of input information

◆ getTile()

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

Reimplemented from ossimImageMosaic.

Definition at line 53 of file ossimFeatherMosaic.cpp.

References combine(), ossimImageData::getHeight(), ossimConnectableObject::getNumberOfInputs(), ossimRectilinearDataObject::getScalarType(), ossimImageMosaic::getTile(), ossimImageData::getWidth(), ossimIrect::height(), initialize(), ossimImageData::initialize(), ossimSource::isSourceEnabled(), ossimImageData::makeBlank(), OSSIM_DOUBLE, OSSIM_FLOAT, OSSIM_NORMALIZED_DOUBLE, OSSIM_NORMALIZED_FLOAT, OSSIM_SCALAR_UNKNOWN, OSSIM_SSHORT16, OSSIM_UCHAR, OSSIM_USHORT11, OSSIM_USHORT12, OSSIM_USHORT13, OSSIM_USHORT14, OSSIM_USHORT15, OSSIM_USHORT16, ossimNotify(), ossimNotifyLevel_WARN, ossimImageData::setHeight(), ossimImageData::setImageRectangle(), ossimImageData::setOrigin(), ossimImageData::setWidth(), size, theAlphaSum, theInputFeatherInformation, theResult, ossimImageMosaic::theTile, ossimIrect::ul(), and ossimIrect::width().

55 {
56  long w = tileRect.width();
57  long h = tileRect.height();
58  ossimIpt origin = tileRect.ul();
59 
60  if(!isSourceEnabled())
61  {
62  return ossimImageMosaic::getTile(tileRect, resLevel);
63  }
65  {
66  initialize();
67 
69  {
70  return ossimImageMosaic::getTile(tileRect, resLevel);
71  }
72  }
74  theAlphaSum->setImageRectangle(tileRect);
75  theResult->setImageRectangle(tileRect);
76 
77  if(size == 0)
78  {
80  }
81 
82  if(size == 1)
83  {
84  return ossimImageMosaic::getTile(tileRect, resLevel);
85  }
86 
87  long tileW = theTile->getWidth();
88  long tileH = theTile->getHeight();
89  if((w != tileW)||
90  (h != tileH))
91  {
92  theTile->setWidth(w);
93  theTile->setHeight(h);
94  if((w*h)!=(tileW*tileH))
95  {
97  }
98  }
99  theTile->setOrigin(origin);
100  theTile->makeBlank();
101 
102  switch(theTile->getScalarType())
103  {
104  case OSSIM_UCHAR:
105  {
106  return combine(static_cast<ossim_uint8>(0),
107  tileRect, resLevel);
108  }
109  case OSSIM_USHORT16:
110  case OSSIM_USHORT11:
111  case OSSIM_USHORT12:
112  case OSSIM_USHORT13:
113  case OSSIM_USHORT14:
114  case OSSIM_USHORT15:
115  {
116  return combine(static_cast<ossim_uint16>(0),
117  tileRect, resLevel);
118  }
119  case OSSIM_SSHORT16:
120  {
121  return combine(static_cast<ossim_sint16>(0),
122  tileRect, resLevel);
123  }
124  case OSSIM_DOUBLE:
126  {
127  return combine(static_cast<double>(0),
128  tileRect, resLevel);
129  }
130  case OSSIM_FLOAT:
132  {
133  return combine(static_cast<float>(0),
134  tileRect, resLevel);
135  }
137  default:
138  {
140  << "ossimFeatherMosaic::getTile: error, unknown scalar type!!!"
141  << std::endl;
142  }
143  }
145 }
ossimRefPtr< ossimImageData > theAlphaSum
16 bit unsigned integer (15 bits used)
virtual ossim_uint32 getWidth() const
virtual bool isSourceEnabled() const
Definition: ossimSource.cpp:79
ossimRefPtr< ossimImageData > theTile
ossimRefPtr< ossimImageData > combine(T dummyVariableNotUsed, const ossimIrect &tileRect, ossim_uint32 resLevel)
The dummy variable is used for the template type.
virtual void setImageRectangle(const ossimIrect &rect)
virtual ossim_uint32 getHeight() const
16 bit unsigned integer (14 bits used)
16 bit unsigned integer (13 bits used)
virtual ossimRefPtr< ossimImageData > getTile(const ossimIrect &origin, ossim_uint32 resLevel=0)
virtual void initialize()
Initialize the data buffer.
virtual void setHeight(ossim_uint32 height)
yy_size_t size
unsigned int ossim_uint32
32 bit normalized floating point
virtual void setWidth(ossim_uint32 width)
virtual void setOrigin(const ossimIpt &origin)
ossimRefPtr< ossimImageData > theResult
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
ossimFeatherInputInformation * theInputFeatherInformation
will hold an array of input information
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 ossimFeatherMosaic::initialize ( )
virtual

Reimplemented from ossimImageMosaic.

Definition at line 350 of file ossimFeatherMosaic.cpp.

References ossimImageMosaic::allocate(), ossimImageData::getHeight(), ossimConnectableObject::getInput(), ossimConnectableObject::getNumberOfInputs(), ossimImageSource::getValidImageVertices(), ossimImageData::getWidth(), ossimImageMosaic::initialize(), ossimImageData::initialize(), OSSIM_CLOCKWISE_ORDER, OSSIM_FLOAT, PTR_CAST, ossimFeatherMosaic::ossimFeatherInputInformation::setVertexList(), theAlphaSum, theFeatherInfoSize, theInputFeatherInformation, ossimImageCombiner::theLargestNumberOfInputBands, theResult, ossimImageMosaic::theTile, and ossimRefPtr< T >::valid().

Referenced by getTile(), and ossimFeatherMosaic().

351 {
353 
354  allocate();
355  if(theTile.valid())
356  {
357  theAlphaSum = new ossimImageData(this,
358  OSSIM_FLOAT,
359  1,
360  theTile->getWidth(),
361  theTile->getHeight());
362  theResult = new ossimImageData(this,
363  OSSIM_FLOAT,
365  theTile->getWidth(),
366  theTile->getHeight());
369  }
370  std::vector<ossimIpt> validVertices;
371  if(!getNumberOfInputs()) return;
372 
374  {
375  delete [] theInputFeatherInformation;
377  }
379  theInputFeatherInformation = new ossimFeatherInputInformation[theFeatherInfoSize];
380  for(long index = 0; index < theFeatherInfoSize; ++ index)
381  {
382  validVertices.clear();
384  if(temp)
385  {
386  temp->getValidImageVertices(validVertices, OSSIM_CLOCKWISE_ORDER);
387  theInputFeatherInformation[index].setVertexList(validVertices);
388  }
389  }
390 }
ossimRefPtr< ossimImageData > theAlphaSum
virtual ossim_uint32 getWidth() const
long theFeatherInfoSize
Will hold the count for the feather information list.
ossimRefPtr< ossimImageData > theTile
bool valid() const
Definition: ossimRefPtr.h:75
virtual ossim_uint32 getHeight() const
void setVertexList(const vector< ossimIpt > &validVertices)
virtual void initialize()
Initialize the data buffer.
ossimConnectableObject * getInput(ossim_uint32 index=0)
returns the object at the specified index.
void allocate()
Called on first getTile, will initialize all data needed.
virtual void initialize()
ossim_uint32 theLargestNumberOfInputBands
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.
#define PTR_CAST(T, p)
Definition: ossimRtti.h:321
ossimRefPtr< ossimImageData > theResult
virtual ossim_uint32 getNumberOfInputs() const
Returns the number of input objects.
32 bit floating point
ossimFeatherInputInformation * theInputFeatherInformation
will hold an array of input information

Friends And Related Function Documentation

◆ operator<<

ostream& operator<< ( ostream &  out,
const ossimFeatherInputInformation data 
)
friend

Definition at line 466 of file ossimFeatherMosaic.cpp.

468 {
469  out << "center: " << data.theCenter << endl
470  << "axis1: " << data.theAxis1 << endl
471  << "axis2: " << data.theAxis2 << endl
472  << "axis1_length: " << data.theAxis1Length << endl
473  << "axis2_length: " << data.theAxis2Length << endl
474  << "valid vertices: " << endl;
475  std::copy(data.theValidVertices.begin(),
476  data.theValidVertices.end(),
477  std::ostream_iterator<ossimDpt>(out, "\n"));
478  return out;
479 }

Member Data Documentation

◆ theAlphaSum

ossimRefPtr<ossimImageData> ossimFeatherMosaic::theAlphaSum
protected

Definition at line 65 of file ossimFeatherMosaic.h.

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

◆ theFeatherInfoSize

long ossimFeatherMosaic::theFeatherInfoSize
protected

Will hold the count for the feather information list.

Definition at line 71 of file ossimFeatherMosaic.h.

Referenced by initialize(), and ~ossimFeatherMosaic().

◆ theInputFeatherInformation

ossimFeatherInputInformation* ossimFeatherMosaic::theInputFeatherInformation
protected

will hold an array of input information

Definition at line 64 of file ossimFeatherMosaic.h.

Referenced by computeWeight(), getTile(), initialize(), and ~ossimFeatherMosaic().

◆ theResult

ossimRefPtr<ossimImageData> ossimFeatherMosaic::theResult
protected

Definition at line 66 of file ossimFeatherMosaic.h.

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


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