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

class for vertical or horizontal convolution More...

#include <ossimConvolutionFilter1D.h>

Inheritance diagram for ossimConvolutionFilter1D:
ossimImageSourceFilter ossimImageSource ossimConnectableObjectListener ossimSource ossimListener ossimConnectableObject ossimErrorStatusInterface ossimObject ossimListenerManager ossimPropertyInterface ossimReferenced

Public Member Functions

 ossimConvolutionFilter1D (ossimObject *owner=NULL)
 own class methods More...
 
virtual const std::vector< ossim_float64 > & getKernel () const
 
virtual void setKernel (const std::vector< ossim_float64 > &aKernel)
 
virtual bool isHorizontal () const
 
virtual void setIsHorizontal (bool aIsHz)
 
virtual ossim_int32 getCenterOffset () const
 
virtual void setCenterOffset (ossim_int32 aCenterOffset)
 
virtual bool isStrictNoData () const
 
virtual void setStrictNoData (bool aStrict)
 
virtual ossimString getShortName () const
 inherited methods More...
 
virtual ossimString getLongName () const
 
virtual ossimRefPtr< ossimImageDatagetTile (const ossimIrect &tileRect, ossim_uint32 resLevel=0)
 
virtual void initialize ()
 
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 void setProperty (ossimRefPtr< ossimProperty > property)
 
virtual ossimRefPtr< ossimPropertygetProperty (const ossimString &name) const
 
virtual void getPropertyNames (std::vector< ossimString > &propertyNames) const
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 Method to the load (recreate) the state of an object from a keyword list. More...
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 Method to save the state of an object to a keyword list. More...
 
- Public Member Functions inherited from ossimImageSourceFilter
 ossimImageSourceFilter (ossimObject *owner=NULL)
 
 ossimImageSourceFilter (ossimImageSource *inputSource)
 
 ossimImageSourceFilter (ossimObject *owner, ossimImageSource *inputSource)
 
virtual void getOutputBandList (std::vector< ossim_uint32 > &bandList) const
 
virtual ossim_uint32 getNumberOfInputBands () const
 
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)
 
- 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 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 ossimIrect getBoundingRect (ossim_uint32 resLevel=0) const
 This will return the bounding rect of the source. 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 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 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 ~ossimConvolutionFilter1D ()
 
void allocate ()
 Allocates theTile. More...
 
void clearNullMinMax ()
 Clears data members theNullPixValue, theMinPixValue, and theMaxPixValue. More...
 
void computeNullMinMax ()
 Computes null, min, and max considering input connection and theKernel. More...
 
template<class T >
void convolveFull (T, ossimRefPtr< ossimImageData > inputData, ossimRefPtr< ossimImageData > outputData)
 
template<class T >
void convolvePartial (T, ossimRefPtr< ossimImageData > inputData, ossimRefPtr< ossimImageData > outputData)
 
- Protected Member Functions inherited from ossimImageSourceFilter
virtual ~ossimImageSourceFilter ()
 
- 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

ossim_int32 theCenterOffset
 offset of center point in the Kernel More...
 
ossimRefPtr< ossimImageDatatheTile
 
std::vector< ossim_float64theKernel
 
bool theIsHz
 
bool theStrictNoData
 isHorizontal convolution? More...
 
std::vector< double > theNullPixValue
 strictly no NODATA values used More...
 
std::vector< double > theMinPixValue
 
std::vector< double > theMaxPixValue
 
- Protected Attributes inherited from ossimImageSourceFilter
ossimImageSourcetheInputConnection
 
- 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

class for vertical or horizontal convolution

PROPERTIES: -KernelSize : length of linear kernel (>=1) NOTE - you need to exit the property editor for the kernel to be resized -Kernel : Kernel vector (line matrix) -Horizontal : boolean, otherwise vertical kernel -CenterOffset : center pixel position in the kernel, starting at 0 -StrictNoData : controls NODATA use true : any NODATA pixel in the convolution will make the center pixel NODATA false : if center is NODATA, then output center is NODATA, other NODATA pixels are processed as if they were zero in the convolution

Definition at line 32 of file ossimConvolutionFilter1D.h.

Constructor & Destructor Documentation

◆ ossimConvolutionFilter1D()

ossimConvolutionFilter1D::ossimConvolutionFilter1D ( ossimObject owner = NULL)

own class methods

Definition at line 24 of file ossimConvolutionFilter1D.cpp.

References theKernel.

25  :ossimImageSourceFilter(owner),
26  theCenterOffset(0),
27  theTile(NULL),
28  theIsHz(true),
29  theStrictNoData(true),
30  theNullPixValue(0),
31  theMinPixValue(0),
33 {
34  //sets up an identity convolution
35  theKernel.push_back(1.0);
36 }
bool theStrictNoData
isHorizontal convolution?
ossimImageSourceFilter(ossimObject *owner=NULL)
std::vector< ossim_float64 > theKernel
std::vector< double > theNullPixValue
strictly no NODATA values used
std::vector< double > theMaxPixValue
ossim_int32 theCenterOffset
offset of center point in the Kernel
std::vector< double > theMinPixValue
ossimRefPtr< ossimImageData > theTile

◆ ~ossimConvolutionFilter1D()

ossimConvolutionFilter1D::~ossimConvolutionFilter1D ( )
protectedvirtual

Definition at line 38 of file ossimConvolutionFilter1D.cpp.

39 {
40 }

Member Function Documentation

◆ allocate()

void ossimConvolutionFilter1D::allocate ( )
protected

Allocates theTile.

Definition at line 353 of file ossimConvolutionFilter1D.cpp.

References ossimImageDataFactory::create(), ossimImageData::initialize(), ossimImageDataFactory::instance(), ossimImageSourceFilter::theInputConnection, and theTile.

Referenced by getTile().

354 {
356  {
358 
359  theTile = idf->create(this,
360  this);
361 
362  theTile->initialize();
363  }
364 }
virtual void initialize()
Initialize the data buffer.
static ossimImageDataFactory * instance()
ossimImageSource * theInputConnection
virtual ossimRefPtr< ossimImageData > create(ossimSource *owner, ossimScalarType scalar, ossim_uint32 bands=1) const
ossimRefPtr< ossimImageData > theTile

◆ clearNullMinMax()

void ossimConvolutionFilter1D::clearNullMinMax ( )
protected

Clears data members theNullPixValue, theMinPixValue, and theMaxPixValue.

Definition at line 600 of file ossimConvolutionFilter1D.cpp.

References theMaxPixValue, theMinPixValue, and theNullPixValue.

Referenced by initialize(), loadState(), setKernel(), and setProperty().

601 {
602  theNullPixValue.clear();
603  theMinPixValue.clear();
604  theMaxPixValue.clear();
605 }
std::vector< double > theNullPixValue
strictly no NODATA values used
std::vector< double > theMaxPixValue
std::vector< double > theMinPixValue

◆ computeNullMinMax()

void ossimConvolutionFilter1D::computeNullMinMax ( )
protected

Computes null, min, and max considering input connection and theKernel.

Definition at line 607 of file ossimConvolutionFilter1D.cpp.

References ossim::defaultMax(), ossim::defaultMin(), ossim::defaultNull(), ossimImageSource::getMaxPixelValue(), ossimImageSource::getMinPixelValue(), ossimImageSource::getNullPixelValue(), ossimImageSource::getNumberOfOutputBands(), ossimImageSource::getOutputScalarType(), ossimImageSourceFilter::theInputConnection, theKernel, theMaxPixValue, theMinPixValue, and theNullPixValue.

Referenced by getTile().

608 {
609  const ossim_uint32 BANDS = getNumberOfOutputBands();
610 
611  theNullPixValue.resize(BANDS);
612  theMinPixValue.resize(BANDS);
613  theMaxPixValue.resize(BANDS);
614 
618 
619  for (ossim_uint32 band = 0; band < BANDS; ++band)
620  {
622  {
626  ossim_float64 tempMin = 0.0;
627  ossim_float64 tempMax = 0.0;
628  ossim_float64 k = 0.0;
629  for(ossim_uint32 i=0;i<theKernel.size();++i)
630  {
631  k=theKernel[i];
632  tempMin += (k<0.0) ? k*inputMax : k*inputMin;
633  tempMax += (k>0.0) ? k*inputMax : k*inputMin;
634  }
635 
636  if((tempMin >= defaultMin) && (tempMin <= defaultMax))
637  {
638  theMinPixValue[band] = tempMin;
639  }
640  else
641  {
642  theMinPixValue[band] = defaultMin;
643  }
644 
645  if((tempMax >= defaultMin) && (tempMax <= defaultMax))
646  {
647  theMaxPixValue[band] = tempMax;
648  }
649  else
650  {
651  theMaxPixValue[band] = defaultMax;
652  }
653  if((inputNull < theMinPixValue[band]) ||
654  (inputNull > theMaxPixValue[band]))
655  {
656  theNullPixValue[band] = inputNull;
657  }
658  else
659  {
661  }
662 
663  }
664  else // No input connection...
665  {
667  theMinPixValue[band] = defaultMin;
668  theMaxPixValue[band] = defaultMax;
669  }
670 
671  } // End of band loop.
672 }
virtual ossim_uint32 getNumberOfOutputBands() const
Returns the number of bands in a tile returned from this TileSource.
std::vector< ossim_float64 > theKernel
std::vector< double > theNullPixValue
strictly no NODATA values used
virtual double getMinPixelValue(ossim_uint32 band=0) const
Returns the min pixel of the band.
double ossim_float64
std::vector< double > theMaxPixValue
OSSIM_DLL double defaultMin(ossimScalarType scalarType)
Definition: ossimCommon.cpp:73
OSSIM_DLL double defaultNull(ossimScalarType scalarType)
ossimImageSource * theInputConnection
unsigned int ossim_uint32
std::vector< double > theMinPixValue
OSSIM_DLL double defaultMax(ossimScalarType scalarType)
virtual ossimScalarType getOutputScalarType() const
This will be used to query the output pixel type of the tile source.
virtual double getMaxPixelValue(ossim_uint32 band=0) const
Returns the max pixel of the band.
virtual double getNullPixelValue(ossim_uint32 band=0) const
Each band has a null pixel associated with it.

◆ convolveFull()

template<class T >
void ossimConvolutionFilter1D::convolveFull ( ,
ossimRefPtr< ossimImageData inputData,
ossimRefPtr< ossimImageData outputData 
)
protected

Convolve full means that the input data is full and has no null data. We don't have to compare for nulls here

Definition at line 277 of file ossimConvolutionFilter1D.cpp.

References ossimImageData::getBuf(), ossimImageData::getHeight(), getMaxPixelValue(), getMinPixelValue(), ossimImageData::getNumberOfBands(), ossimImageData::getWidth(), theIsHz, and theKernel.

Referenced by getTile().

281 {
282  //inputData must be displaced according to the Kernel size and theCenterOffset +isHz
283  ossim_int32 inputW = static_cast<ossim_int32>(inputData->getWidth());
284  ossim_uint32 outputW = outputData->getWidth();
285  ossim_uint32 outputH = outputData->getHeight();
286  ossim_uint32 numberOfBands = inputData->getNumberOfBands();
287 
288  ossim_uint32 klength=(ossim_uint32)theKernel.size(), k;
289  ossim_int32 incrK = theIsHz ? 1 : inputW; //kernel increment in input : one col or one row
290  ossim_int32 iRow = inputW - outputW; //jump to go to next row
291 
292  double sum=0.0;
293  T* iKP; //kernel covered input pointer
294 
295  for(ossim_uint32 band = 0; band < numberOfBands; ++band)
296  {
297  T* inputBuf = static_cast<T*>(inputData->getBuf(band));
298  T* outputBuf = static_cast<T*>(outputData->getBuf(band));
299  T maxPix = static_cast<T>(getMaxPixelValue(band));
300  T minPix = static_cast<T>(getMinPixelValue(band));
301 
302  if(inputBuf&&outputBuf)
303  {
304  for(ossim_uint32 row = 0; row < outputH; ++row)
305  {
306  for(ossim_uint32 col = 0; col < outputW; ++col)
307  {
308  sum = 0.0;
309  iKP = inputBuf;
310  for(k=0;k<klength;++k)
311  {
312  sum += theKernel[k] * (double)(*iKP);
313  iKP += incrK;
314  }
315 
316  if(sum > maxPix)
317  {
318  *outputBuf = maxPix;
319  }
320  else if(sum < minPix)
321  {
322  *outputBuf = minPix;
323  }
324  else
325  {
326  *outputBuf = static_cast<T>(sum);
327  }
328  // move curent center position
329  inputBuf += 1;
330  outputBuf += 1;
331  }
332  //move current center position
333  inputBuf += iRow;
334  //outputBuf += 0;
335  }
336  }
337  }
338 }
virtual ossim_uint32 getWidth() const
virtual ossim_uint32 getNumberOfBands() const
std::vector< ossim_float64 > theKernel
virtual ossim_uint32 getHeight() const
unsigned int ossim_uint32
virtual double getMinPixelValue(ossim_uint32 band=0) const
Returns the min pixel of the band.
virtual const void * getBuf() const
virtual double getMaxPixelValue(ossim_uint32 band=0) const
Returns the max pixel of the band.
int ossim_int32

◆ convolvePartial()

template<class T >
void ossimConvolutionFilter1D::convolvePartial ( ,
ossimRefPtr< ossimImageData inputData,
ossimRefPtr< ossimImageData outputData 
)
protected

Convolve partial means that the input data is has some null data. We will have to compare nulls

Definition at line 191 of file ossimConvolutionFilter1D.cpp.

References ossimImageData::getBuf(), ossimImageData::getHeight(), getMaxPixelValue(), getMinPixelValue(), ossimImageData::getNullPix(), getNullPixelValue(), ossimImageData::getNumberOfBands(), ossimImageData::getWidth(), theCenterOffset, theIsHz, theKernel, and theStrictNoData.

Referenced by getTile().

195 {
196  // there may be NULL pixels in the input
197  ossim_int32 inputW = static_cast<ossim_int32>(inputData->getWidth());
198  ossim_uint32 outputW = outputData->getWidth();
199  ossim_uint32 outputH = outputData->getHeight();
200  ossim_uint32 numberOfBands = inputData->getNumberOfBands();
201 
202  ossim_uint32 klength=(ossim_uint32)theKernel.size(),k;
203  ossim_int32 incrK = theIsHz ? 1 : inputW; //kernel increment in input : one col or one row
204  ossim_int32 iRow = inputW - outputW; //jump to go to next row
205 
206  double sum=0.0;
207  T* iKP; //kernel covered input pointer
208 
209  ossim_int32 iCo = incrK*theCenterOffset; //center pixel offset within the input buffer
210 
211  for(ossim_uint32 band = 0; band < numberOfBands; ++band)
212  {
213  T* inputBuf = static_cast<T*>(inputData->getBuf(band));
214  T* outputBuf = static_cast<T*>(outputData->getBuf(band));
215  T maxPix = static_cast<T>(getMaxPixelValue(band));
216  T minPix = static_cast<T>(getMinPixelValue(band));
217  T nullPix = static_cast<T>(inputData->getNullPix(band));
218  T oNullPix = static_cast<T>(getNullPixelValue(band));
219 
220  if(inputBuf&&outputBuf)
221  {
222  for(ossim_uint32 row = 0; row < outputH; ++row)
223  {
224  for(ossim_uint32 col = 0; col < outputW; ++col)
225  {
226  //center pixel may not be NULL
227  if (inputBuf[iCo] != nullPix)
228  {
229  iKP = inputBuf;
230  sum = 0.0;
231  for(k=0;k<klength;++k)
232  {
233  if (*iKP != nullPix) //just sum on non-NULL pixels (potential normailzation issue)
234  {
235  sum += theKernel[k] * (double)(*iKP);
236  } else if (theStrictNoData)
237  {
238  break;
239  }
240  iKP += incrK;
241  }
242  if (k==klength)
243  {
244  if(sum > maxPix)
245  {
246  *outputBuf = maxPix;
247  }
248  else if(sum < minPix)
249  {
250  *outputBuf = minPix;
251  }
252  else
253  {
254  *outputBuf = static_cast<T>(sum);
255  }
256  } else {
257  //theStrictNoData
258  *outputBuf = oNullPix;
259  }
260  } else {
261  *outputBuf = oNullPix;
262  }
263  // move curent center position
264  inputBuf += 1;
265  outputBuf += 1;
266  }
267  //move current center position
268  inputBuf += iRow;
269  //outputBuf += 0;
270  }
271  }
272  }
273 
274 
275 }
virtual ossim_uint32 getWidth() const
bool theStrictNoData
isHorizontal convolution?
virtual ossim_uint32 getNumberOfBands() const
std::vector< ossim_float64 > theKernel
virtual ossim_uint32 getHeight() const
virtual double getNullPixelValue(ossim_uint32 band=0) const
Each band has a null pixel associated with it.
ossim_int32 theCenterOffset
offset of center point in the Kernel
unsigned int ossim_uint32
virtual const ossim_float64 * getNullPix() const
virtual double getMinPixelValue(ossim_uint32 band=0) const
Returns the min pixel of the band.
virtual const void * getBuf() const
virtual double getMaxPixelValue(ossim_uint32 band=0) const
Returns the max pixel of the band.
int ossim_int32

◆ getCenterOffset()

virtual ossim_int32 ossimConvolutionFilter1D::getCenterOffset ( ) const
inlinevirtual

Definition at line 46 of file ossimConvolutionFilter1D.h.

46 { return theCenterOffset; }
ossim_int32 theCenterOffset
offset of center point in the Kernel

◆ getKernel()

virtual const std::vector<ossim_float64>& ossimConvolutionFilter1D::getKernel ( ) const
inlinevirtual

Definition at line 40 of file ossimConvolutionFilter1D.h.

40 { return theKernel; }
std::vector< ossim_float64 > theKernel

◆ getLongName()

virtual ossimString ossimConvolutionFilter1D::getLongName ( ) const
inlinevirtual

Reimplemented from ossimObject.

Definition at line 56 of file ossimConvolutionFilter1D.h.

56 {return ossimString("Convolves the input image with a one dimensional convolution kernel");}

◆ getMaxPixelValue()

double ossimConvolutionFilter1D::getMaxPixelValue ( ossim_uint32  band = 0) const
virtual

Returns the max pixel of the band.

Reimplemented from ossimImageSource.

Definition at line 590 of file ossimConvolutionFilter1D.cpp.

References ossimImageSource::getMaxPixelValue(), ossimSource::isSourceEnabled(), and theMaxPixValue.

Referenced by convolveFull(), and convolvePartial().

591 {
592  if( isSourceEnabled() && (band < theMaxPixValue.size()) )
593  {
594  return theMaxPixValue[band];
595  }
596 
598 }
virtual bool isSourceEnabled() const
Definition: ossimSource.cpp:79
std::vector< double > theMaxPixValue
virtual double getMaxPixelValue(ossim_uint32 band=0) const
Returns the max pixel of the band.

◆ getMinPixelValue()

double ossimConvolutionFilter1D::getMinPixelValue ( ossim_uint32  band = 0) const
virtual

Returns the min pixel of the band.

Reimplemented from ossimImageSource.

Definition at line 580 of file ossimConvolutionFilter1D.cpp.

References ossimImageSource::getMinPixelValue(), ossimSource::isSourceEnabled(), and theMinPixValue.

Referenced by convolveFull(), and convolvePartial().

581 {
582  if( isSourceEnabled() && (band < theMinPixValue.size()) )
583  {
584  return theMinPixValue[band];
585  }
586 
588 }
virtual bool isSourceEnabled() const
Definition: ossimSource.cpp:79
virtual double getMinPixelValue(ossim_uint32 band=0) const
Returns the min pixel of the band.
std::vector< double > theMinPixValue

◆ getNullPixelValue()

double ossimConvolutionFilter1D::getNullPixelValue ( ossim_uint32  band = 0) const
virtual

Each band has a null pixel associated with it.

The null pixel represents an invalid value.

Reimplemented from ossimImageSource.

Definition at line 570 of file ossimConvolutionFilter1D.cpp.

References ossim::defaultNull(), ossimImageSource::getOutputScalarType(), ossimSource::isSourceEnabled(), and theNullPixValue.

Referenced by convolvePartial().

571 {
572  if( isSourceEnabled() && (band < theNullPixValue.size()) )
573  {
574  return theNullPixValue[band];
575  }
576 
578 }
virtual bool isSourceEnabled() const
Definition: ossimSource.cpp:79
std::vector< double > theNullPixValue
strictly no NODATA values used
OSSIM_DLL double defaultNull(ossimScalarType scalarType)
virtual ossimScalarType getOutputScalarType() const
This will be used to query the output pixel type of the tile source.

◆ getProperty()

ossimRefPtr< ossimProperty > ossimConvolutionFilter1D::getProperty ( const ossimString name) const
virtual

Reimplemented from ossimImageSourceFilter.

Definition at line 422 of file ossimConvolutionFilter1D.cpp.

References ossimImageSourceFilter::getProperty(), ossimNumericProperty::ossimNumericPropertyType_INT, PROPNAME_CENTEROFFSET, PROPNAME_ISHZ, PROPNAME_KERNEL, PROPNAME_KERNELSIZE, PROPNAME_STRICTNODATA, theCenterOffset, theIsHz, theKernel, theStrictNoData, and ossimString::toString().

423 {
424  if(name == PROPNAME_KERNEL)
425  {
426  ossimMatrixProperty* property = new ossimMatrixProperty(name);
427  property->resize(1,(int)theKernel.size());
428  for(ossim_uint32 i=0;i<theKernel.size();++i)
429  {
430  (*property)(0,i) = theKernel[i];
431  }
432  property->setCacheRefreshBit();
433  return property;
434  } else if (name==PROPNAME_ISHZ) {
435  ossimBooleanProperty* property = new ossimBooleanProperty(name,theIsHz);
436  property->setCacheRefreshBit();
437  return property;
438  } else if (name==PROPNAME_STRICTNODATA) {
440  property->setCacheRefreshBit();
441  return property;
442  } else if (name==PROPNAME_CENTEROFFSET) {
444  property->setNumericType(ossimNumericProperty::ossimNumericPropertyType_INT); //restrict to int type
445  property->setCacheRefreshBit();
446  return property;
447  } else if (name == PROPNAME_KERNELSIZE) {
449  property->setNumericType(ossimNumericProperty::ossimNumericPropertyType_INT); //restrict to int type
450  property->setCacheRefreshBit();
451  return property;
452  }
454 }
bool theStrictNoData
isHorizontal convolution?
static ossimString toString(bool aValue)
Numeric to string methods.
std::vector< ossim_float64 > theKernel
#define PROPNAME_KERNELSIZE
#define PROPNAME_KERNEL
ossim_int32 theCenterOffset
offset of center point in the Kernel
unsigned int ossim_uint32
#define PROPNAME_ISHZ
#define PROPNAME_STRICTNODATA
virtual ossimRefPtr< ossimProperty > getProperty(const ossimString &name) const
#define PROPNAME_CENTEROFFSET

◆ getPropertyNames()

void ossimConvolutionFilter1D::getPropertyNames ( std::vector< ossimString > &  propertyNames) const
virtual

Reimplemented from ossimImageSourceFilter.

Definition at line 456 of file ossimConvolutionFilter1D.cpp.

References ossimImageSourceFilter::getPropertyNames(), PROPNAME_CENTEROFFSET, PROPNAME_ISHZ, PROPNAME_KERNEL, PROPNAME_KERNELSIZE, and PROPNAME_STRICTNODATA.

457 {
459  propertyNames.push_back(PROPNAME_KERNELSIZE);
460  propertyNames.push_back(PROPNAME_KERNEL);
461  propertyNames.push_back(PROPNAME_CENTEROFFSET);
462  propertyNames.push_back(PROPNAME_ISHZ);
463  propertyNames.push_back(PROPNAME_STRICTNODATA);
464 }
#define PROPNAME_KERNELSIZE
#define PROPNAME_KERNEL
virtual void getPropertyNames(std::vector< ossimString > &propertyNames) const
#define PROPNAME_ISHZ
#define PROPNAME_STRICTNODATA
#define PROPNAME_CENTEROFFSET

◆ getShortName()

virtual ossimString ossimConvolutionFilter1D::getShortName ( ) const
inlinevirtual

inherited methods

Reimplemented from ossimObject.

Definition at line 55 of file ossimConvolutionFilter1D.h.

55 {return ossimString("1D Convolution");}

◆ getTile()

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

Reimplemented from ossimImageSource.

Definition at line 42 of file ossimConvolutionFilter1D.cpp.

References allocate(), computeNullMinMax(), convolveFull(), convolvePartial(), ossimImageData::getBuf(), ossimDataObject::getDataObjectStatus(), ossimRectilinearDataObject::getScalarType(), ossimImageSource::getTile(), ossimSource::isSourceEnabled(), ossimIrect::lr(), ossimImageData::makeBlank(), OSSIM_DOUBLE, OSSIM_FLOAT, OSSIM_FULL, OSSIM_NORMALIZED_DOUBLE, OSSIM_NORMALIZED_FLOAT, OSSIM_SSHORT16, OSSIM_UCHAR, OSSIM_USHORT11, OSSIM_USHORT12, OSSIM_USHORT13, OSSIM_USHORT14, OSSIM_USHORT15, OSSIM_USHORT16, ossimNotify(), ossimNotifyLevel_WARN, ossimImageData::setImageRectangle(), theCenterOffset, ossimImageSourceFilter::theInputConnection, theIsHz, theKernel, theNullPixValue, theTile, ossimIrect::ul(), ossimRefPtr< T >::valid(), ossimImageData::validate(), ossimIpt::x, and ossimIpt::y.

Referenced by ossimImageGaussianFilter::getTile().

45 {
47  {
48  return theTile;
49  }
50 
51  if(!isSourceEnabled())
52  {
53  return theInputConnection->getTile(tileRect, resLevel);
54  }
55 
56  //---
57  // We have a 1xn or nx1 matrix, + a center offset
58  // so stretch the input rect out to cover the required pixels
59  //---
60  ossimIrect newRect;
61  ossim_uint32 kl = (ossim_uint32)theKernel.size(); //kernel length
62  if (theIsHz)
63  {
64  //horizontal kernel (row kernel)
65  newRect = ossimIrect(ossimIpt(tileRect.ul().x - theCenterOffset,
66  tileRect.ul().y),
67  ossimIpt(tileRect.lr().x - theCenterOffset + kl -1,
68  tileRect.lr().y));
69  } else {
70  //vertical kernel
71  newRect = ossimIrect(ossimIpt(tileRect.ul().x,
72  tileRect.ul().y - theCenterOffset),
73  ossimIpt(tileRect.lr().x,
74  tileRect.lr().y - theCenterOffset + kl -1));
75  }
77  resLevel);
78 
79  if(!data.valid() || !data->getBuf())
80  {
81  return data;
82  }
83 
84  // First time through or after an initialize()...
85  if (!theTile.valid())
86  {
87  allocate();
88  if (!theTile.valid()) // Should never happen!
89  {
90  return data;
91  }
92  }
93 
94  // First time through, after an initialize() or a setKernel()...
95  if (!theNullPixValue.size())
96  {
98  if (!theNullPixValue.size()) // Should never happen!
99  {
100  return data;
101  }
102  }
103 
104  theTile->setImageRectangle(tileRect);
105  theTile->makeBlank();
106 
107  switch(data->getScalarType())
108  {
109  case OSSIM_UCHAR:
110  {
111  if(data->getDataObjectStatus() == OSSIM_FULL)
112  {
113  convolveFull(static_cast<ossim_uint8>(0), data, theTile);
114  }
115  else
116  {
117  convolvePartial(static_cast<ossim_uint8>(0), data, theTile);
118  }
119  break;
120  }
121  case OSSIM_FLOAT:
123  {
124  if(data->getDataObjectStatus() == OSSIM_FULL)
125  {
126  convolveFull(static_cast<float>(0), data, theTile);
127  }
128  else
129  {
130  convolvePartial(static_cast<float>(0), data, theTile);
131  }
132  break;
133  }
134  case OSSIM_USHORT16:
135  case OSSIM_USHORT11:
136  case OSSIM_USHORT12:
137  case OSSIM_USHORT13:
138  case OSSIM_USHORT14:
139  case OSSIM_USHORT15:
140  {
141  if(data->getDataObjectStatus() == OSSIM_FULL)
142  {
143  convolveFull(static_cast<ossim_uint16>(0), data, theTile);
144  }
145  else
146  {
147  convolvePartial(static_cast<ossim_uint16>(0), data, theTile);
148  }
149  break;
150  }
151  case OSSIM_SSHORT16:
152  {
153  if(data->getDataObjectStatus() == OSSIM_FULL)
154  {
155  convolveFull(static_cast<ossim_sint16>(0), data, theTile);
156  }
157  else
158  {
159  convolvePartial(static_cast<ossim_sint16>(0), data, theTile);
160  }
161  break;
162  }
163  case OSSIM_DOUBLE:
165  {
166  if(data->getDataObjectStatus() == OSSIM_FULL)
167  {
168  convolveFull(static_cast<double>(0), data, theTile);
169  }
170  else
171  {
172  convolvePartial(static_cast<double>(0), data, theTile);
173  }
174  break;
175  }
176  default:
177  {
179  << "ossimConvolutionFilter1D::getTile WARNING:\n"
180  << "Scalar type = " << theTile->getScalarType()
181  << " Not supported by ossimConvolutionFilter1D" << endl;
182  break;
183  }
184  }
185  theTile->validate();
186 
187  return theTile;
188 }
16 bit unsigned integer (15 bits used)
virtual bool isSourceEnabled() const
Definition: ossimSource.cpp:79
virtual void setImageRectangle(const ossimIrect &rect)
bool valid() const
Definition: ossimRefPtr.h:75
void allocate()
Allocates theTile.
std::vector< ossim_float64 > theKernel
virtual ossimDataObjectStatus getDataObjectStatus() const
16 bit unsigned integer (14 bits used)
16 bit unsigned integer (13 bits used)
std::vector< double > theNullPixValue
strictly no NODATA values used
ossim_int32 theCenterOffset
offset of center point in the Kernel
virtual ossimDataObjectStatus validate() const
ossimImageSource * theInputConnection
unsigned int ossim_uint32
32 bit normalized floating point
void computeNullMinMax()
Computes null, min, and max considering input connection and theKernel.
void convolvePartial(T, ossimRefPtr< ossimImageData > inputData, ossimRefPtr< ossimImageData > outputData)
virtual ossimScalarType getScalarType() const
virtual void makeBlank()
Initializes data to null pixel values.
ossimRefPtr< ossimImageData > theTile
64 bit normalized floating point
16 bit unsigned integer (11 bits used)
void convolveFull(T, ossimRefPtr< ossimImageData > inputData, ossimRefPtr< ossimImageData > outputData)
virtual const void * getBuf() const
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
virtual ossimRefPtr< ossimImageData > getTile(const ossimIpt &origin, ossim_uint32 resLevel=0)
16 bit unsigned integer (12 bits used)

◆ initialize()

void ossimConvolutionFilter1D::initialize ( )
virtual

Reimplemented from ossimImageSourceFilter.

Definition at line 340 of file ossimConvolutionFilter1D.cpp.

References clearNullMinMax(), and theTile.

Referenced by ossimImageGaussianFilter::initializeProcesses().

341 {
342  //---
343  // NOTE:
344  // Since initialize get called often sequentially we will wipe things slick
345  // but not reallocate to avoid multiple delete/allocates.
346  //
347  // On the first getTile call things will be reallocated/computed.
348  //---
349  theTile = NULL;
350  clearNullMinMax();
351 }
void clearNullMinMax()
Clears data members theNullPixValue, theMinPixValue, and theMaxPixValue.
ossimRefPtr< ossimImageData > theTile

◆ isHorizontal()

virtual bool ossimConvolutionFilter1D::isHorizontal ( ) const
inlinevirtual

Definition at line 43 of file ossimConvolutionFilter1D.h.

◆ isStrictNoData()

virtual bool ossimConvolutionFilter1D::isStrictNoData ( ) const
inlinevirtual

Definition at line 49 of file ossimConvolutionFilter1D.h.

49 { return theStrictNoData; }
bool theStrictNoData
isHorizontal convolution?

◆ loadState()

bool ossimConvolutionFilter1D::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 ossimImageSourceFilter.

Definition at line 499 of file ossimConvolutionFilter1D.cpp.

References ossimString::c_str(), clearNullMinMax(), ossimKeywordlist::find(), ossimImageSourceFilter::loadState(), PROPNAME_CENTEROFFSET, PROPNAME_ISHZ, PROPNAME_KERNELSIZE, PROPNAME_STRICTNODATA, setCenterOffset(), setIsHorizontal(), setStrictNoData(), theKernel, ossimString::toDouble(), ossimString::toString(), and ossimString::toUInt32().

501 {
502  //find kernel size
503  ossim_uint32 iks=0;
504  const char* ks = kwl.find(prefix, PROPNAME_KERNELSIZE);
505  if(ks)
506  {
507  iks = ossimString(ks).toUInt32();
508  if (iks<1)
509  {
510  cerr<<"ossimConvolutionFilter1D : warning bad "<< PROPNAME_KERNELSIZE <<" in state"<<endl;
511  iks=0;
512  }
513  } else {
514  iks=0;
515  cerr<<"ossimConvolutionFilter1D : warning no "<< PROPNAME_KERNELSIZE <<" in state"<<endl;
516  }
517 
518  //load other props
519  const char* co = kwl.find(prefix, PROPNAME_CENTEROFFSET);
520  if(co)
521  {
522  setCenterOffset(ossimString(co).toUInt32());
523  } else {
524  cerr<<"ossimConvolutionFilter1D : warning no "<< PROPNAME_CENTEROFFSET<<" in state"<<endl;
525  }
526  const char* ih = kwl.find(prefix, PROPNAME_ISHZ);
527  if(ih)
528  {
529  setIsHorizontal(ossimString(ih).toBool());
530  } else {
531  cerr<<"ossimConvolutionFilter1D : warning no "<<PROPNAME_ISHZ<<" in state"<<endl;
532  }
533  const char* sn = kwl.find(prefix, PROPNAME_STRICTNODATA);
534  if(sn)
535  {
536  setStrictNoData(ossimString(sn).toBool());
537  } else {
538  cerr<<"ossimConvolutionFilter1D : warning no "<<PROPNAME_STRICTNODATA<<" in state"<<endl;
539  }
540  //load kernel values
541  ossimString newPrefix = prefix;
542  newPrefix += ossimString("k");
543  theKernel.resize(iks);
544  for(ossim_uint32 r=0; r<iks; ++r)
545  {
547 
548  const char* v = kwl.find(newPrefix.c_str(),
549  value.c_str());
550  if(v)
551  {
552  theKernel[r] = ossimString(v).toDouble();
553  } else {
554  cerr<<"ossimConvolutionFilter1D : warning no value for "<<newPrefix<<" in state"<<endl;
555  theKernel[r] = 0.0;
556  }
557  }
558  clearNullMinMax();
559 
560  return ossimImageSourceFilter::loadState(kwl, prefix);
561 }
void clearNullMinMax()
Clears data members theNullPixValue, theMinPixValue, and theMaxPixValue.
const char * find(const char *key) const
static ossimString toString(bool aValue)
Numeric to string methods.
std::vector< ossim_float64 > theKernel
ossim_uint32 toUInt32() const
#define PROPNAME_KERNELSIZE
virtual void setStrictNoData(bool aStrict)
unsigned int ossim_uint32
double toDouble() const
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
#define PROPNAME_ISHZ
#define PROPNAME_STRICTNODATA
virtual void setIsHorizontal(bool aIsHz)
#define PROPNAME_CENTEROFFSET
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string&#39;s contents...
Definition: ossimString.h:396
virtual void setCenterOffset(ossim_int32 aCenterOffset)

◆ saveState()

bool ossimConvolutionFilter1D::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 ossimImageSourceFilter.

Definition at line 466 of file ossimConvolutionFilter1D.cpp.

References ossimKeywordlist::add(), PROPNAME_CENTEROFFSET, PROPNAME_ISHZ, PROPNAME_KERNELSIZE, PROPNAME_STRICTNODATA, ossimImageSourceFilter::saveState(), theCenterOffset, theIsHz, theKernel, theStrictNoData, and ossimString::toString().

468 {
469  kwl.add(prefix,
471  static_cast<ossim_uint32>(theKernel.size()),
472  true);
473  kwl.add(prefix,
476  true);
477  kwl.add(prefix,
479  theIsHz?"true":"false", //use string instead of boolean
480  true);
481  kwl.add(prefix,
483  theStrictNoData?"true":"false", //use string instead of boolean
484  true);
485 
486  for(ossim_uint32 row = 0; row < theKernel.size(); ++row)
487  {
488  ossimString newPrefix = "k" + ossimString::toString(row);
489  kwl.add(prefix,
490  newPrefix,
491  theKernel[row],
492  true);
493  }
494 
495  return ossimImageSourceFilter::saveState(kwl, prefix);
496 }
bool theStrictNoData
isHorizontal convolution?
static ossimString toString(bool aValue)
Numeric to string methods.
std::vector< ossim_float64 > theKernel
#define PROPNAME_KERNELSIZE
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
ossim_int32 theCenterOffset
offset of center point in the Kernel
unsigned int ossim_uint32
#define PROPNAME_ISHZ
#define PROPNAME_STRICTNODATA
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.
#define PROPNAME_CENTEROFFSET

◆ setCenterOffset()

virtual void ossimConvolutionFilter1D::setCenterOffset ( ossim_int32  aCenterOffset)
inlinevirtual

Definition at line 47 of file ossimConvolutionFilter1D.h.

Referenced by loadState(), and ossimImageGaussianFilter::updateKernels().

47 { theCenterOffset = aCenterOffset; }
ossim_int32 theCenterOffset
offset of center point in the Kernel

◆ setIsHorizontal()

virtual void ossimConvolutionFilter1D::setIsHorizontal ( bool  aIsHz)
inlinevirtual

◆ setKernel()

void ossimConvolutionFilter1D::setKernel ( const std::vector< ossim_float64 > &  aKernel)
virtual

Definition at line 563 of file ossimConvolutionFilter1D.cpp.

References clearNullMinMax(), and theKernel.

Referenced by ossimImageGaussianFilter::updateKernels().

564 {
565  theKernel = aKernel;
566  // Will be recomputed first getTile call.
567  clearNullMinMax();
568 }
void clearNullMinMax()
Clears data members theNullPixValue, theMinPixValue, and theMaxPixValue.
std::vector< ossim_float64 > theKernel

◆ setProperty()

void ossimConvolutionFilter1D::setProperty ( ossimRefPtr< ossimProperty property)
virtual

Reimplemented from ossimImageSourceFilter.

Definition at line 366 of file ossimConvolutionFilter1D.cpp.

References ossimNumericProperty::asInt32(), ossimNumericProperty::asUInt32(), clearNullMinMax(), ossimRefPtr< T >::get(), ossimBooleanProperty::getBoolean(), ossimProperty::getName(), ossimMatrixProperty::getNumberOfCols(), PROPNAME_CENTEROFFSET, PROPNAME_ISHZ, PROPNAME_KERNEL, PROPNAME_KERNELSIZE, PROPNAME_STRICTNODATA, PTR_CAST, ossimImageSourceFilter::setProperty(), theCenterOffset, theIsHz, theKernel, and theStrictNoData.

367 {
368  if(!property) return;
369 
370  if(property->getName() == PROPNAME_KERNEL)
371  {
373  property.get());
374  if(matrixProperty)
375  {
376  ossim_uint32 nc=matrixProperty->getNumberOfCols();
377  theKernel.resize(nc);
378  for(ossim_uint32 i=0;i<nc;++i)
379  {
380  theKernel[i] = (*matrixProperty)(0,i);
381  }
382  clearNullMinMax();
383  }
384  else
385  {
387  }
388  } else if (property->getName() == PROPNAME_ISHZ) {
390  property.get());
391  if(booleanProperty)
392  {
393  theIsHz = booleanProperty->getBoolean();
394  }
395  } else if (property->getName() == PROPNAME_STRICTNODATA) {
397  property.get());
398  if(booleanProperty)
399  {
400  theStrictNoData = booleanProperty->getBoolean();
401  }
402  } else if (property->getName() == PROPNAME_CENTEROFFSET) {
404  property.get());
405  if(numProperty)
406  {
407  theCenterOffset = numProperty->asInt32();
408  }
409  } else if (property->getName() == PROPNAME_KERNELSIZE) {
411  property.get());
412  if(numProperty)
413  {
414  theKernel.resize(numProperty->asUInt32());
415  clearNullMinMax();
416  }
417  } else {
419  }
420 }
void clearNullMinMax()
Clears data members theNullPixValue, theMinPixValue, and theMaxPixValue.
bool theStrictNoData
isHorizontal convolution?
virtual void setProperty(ossimRefPtr< ossimProperty > property)
std::vector< ossim_float64 > theKernel
#define PROPNAME_KERNELSIZE
#define PROPNAME_KERNEL
ossim_int32 theCenterOffset
offset of center point in the Kernel
unsigned int ossim_uint32
#define PTR_CAST(T, p)
Definition: ossimRtti.h:321
virtual ossim_uint32 asUInt32() const
#define PROPNAME_ISHZ
virtual ossim_sint32 asInt32() const
#define PROPNAME_STRICTNODATA
#define PROPNAME_CENTEROFFSET
const ossimString & getName() const

◆ setStrictNoData()

virtual void ossimConvolutionFilter1D::setStrictNoData ( bool  aStrict)
inlinevirtual

Member Data Documentation

◆ theCenterOffset

ossim_int32 ossimConvolutionFilter1D::theCenterOffset
protected

offset of center point in the Kernel

Definition at line 111 of file ossimConvolutionFilter1D.h.

Referenced by convolvePartial(), getProperty(), getTile(), saveState(), and setProperty().

◆ theIsHz

bool ossimConvolutionFilter1D::theIsHz
protected

◆ theKernel

std::vector<ossim_float64> ossimConvolutionFilter1D::theKernel
protected

◆ theMaxPixValue

std::vector<double> ossimConvolutionFilter1D::theMaxPixValue
protected

◆ theMinPixValue

std::vector<double> ossimConvolutionFilter1D::theMinPixValue
protected

◆ theNullPixValue

std::vector<double> ossimConvolutionFilter1D::theNullPixValue
protected

strictly no NODATA values used

Definition at line 117 of file ossimConvolutionFilter1D.h.

Referenced by clearNullMinMax(), computeNullMinMax(), getNullPixelValue(), and getTile().

◆ theStrictNoData

bool ossimConvolutionFilter1D::theStrictNoData
protected

isHorizontal convolution?

Definition at line 115 of file ossimConvolutionFilter1D.h.

Referenced by convolvePartial(), getProperty(), saveState(), and setProperty().

◆ theTile

ossimRefPtr<ossimImageData> ossimConvolutionFilter1D::theTile
protected

Definition at line 112 of file ossimConvolutionFilter1D.h.

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


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