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

#include <ossimBandClipFilter.h>

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

Public Types

enum  ossimBandClipType {
  ossimBandClipType_NONE = 0, ossimBandClipType_CLIP = 1, ossimBandClipType_CLAMP = 2, ossimBandClipType_LINEAR_STRETCH = 3,
  ossimBandClipType_MEDIAN_STRETCH = 4
}
 
- 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
 

Public Member Functions

 ossimBandClipFilter ()
 
 ossimBandClipFilter (ossimImageSource *, const vector< double > &minPix, const vector< double > &maxPix, ossimBandClipType clipType=ossimBandClipType_NONE)
 
 ossimBandClipFilter (ossimImageSource *, double minPix, double maxPix, ossimBandClipType clipType=ossimBandClipType_NONE)
 
void setClipType (ossimBandClipType clipType)
 
ossimBandClipType getClipType () const
 
virtual ossim_uint32 getNumberOfValues () const
 
void setNumberOfValues (ossim_uint32 size)
 
void setMinMaxPix (const vector< double > &minPix, const vector< double > &maxPix)
 
const std::vector< double > & getMinPixList () const
 
const std::vector< double > getMaxPixList () const
 
double getMinPix (ossim_uint32 index) const
 
double getMaxPix (ossim_uint32 index) const
 
ossimRefPtr< ossimImageDatagetTile (const ossimIrect &rect, ossim_uint32 resLevel=0)
 
virtual void initialize ()
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=NULL)
 Method to the load (recreate) the state of an object from a keyword list. More...
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=NULL) 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)
 
virtual void setProperty (ossimRefPtr< ossimProperty > property)
 
virtual ossimRefPtr< ossimPropertygetProperty (const ossimString &name) const
 
virtual void getPropertyNames (std::vector< ossimString > &propertyNames) 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 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 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 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 ~ossimBandClipFilter ()
 
void runClip ()
 
void runClamp ()
 
void runLinearStretch ()
 
void runMedianStretch ()
 
- 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

std::vector< double > theMinPix
 
std::vector< double > theMaxPix
 
std::vector< double > theMedian
 
ossimBandClipType theClipType
 
ossimRefPtr< ossimImageDatatheTile
 
- 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
 

Detailed Description

Definition at line 19 of file ossimBandClipFilter.h.

Member Enumeration Documentation

◆ ossimBandClipType

Specifies the type of clipping. The first will just clip and

Enumerator
ossimBandClipType_NONE 
ossimBandClipType_CLIP 
ossimBandClipType_CLAMP 
ossimBandClipType_LINEAR_STRETCH 
ossimBandClipType_MEDIAN_STRETCH 

Definition at line 26 of file ossimBandClipFilter.h.

Constructor & Destructor Documentation

◆ ossimBandClipFilter() [1/3]

ossimBandClipFilter::ossimBandClipFilter ( )

Definition at line 19 of file ossimBandClipFilter.cpp.

References ossimImageData::initialize(), OSSIM_NORMALIZED_FLOAT, and theTile.

22  theTile(NULL)
23 {
24  theTile = new ossimImageData(this, // I am the owner,
26  1);
28 }
ossimRefPtr< ossimImageData > theTile
ossimImageSourceFilter(ossimObject *owner=NULL)
virtual void initialize()
Initialize the data buffer.
32 bit normalized floating point
ossimBandClipType theClipType

◆ ossimBandClipFilter() [2/3]

ossimBandClipFilter::ossimBandClipFilter ( ossimImageSource inputSource,
const vector< double > &  minPix,
const vector< double > &  maxPix,
ossimBandClipType  clipType = ossimBandClipType_NONE 
)

Definition at line 30 of file ossimBandClipFilter.cpp.

References ossimImageData::initialize(), OSSIM_NORMALIZED_FLOAT, setMinMaxPix(), and theTile.

34  :ossimImageSourceFilter(inputSource),
35  theClipType(clipType),
36  theTile(NULL)
37 {
38  theTile = new ossimImageData(this, // I am the owner,
40  1);
42  setMinMaxPix(minPix, maxPix);
43 }
void setMinMaxPix(const vector< double > &minPix, const vector< double > &maxPix)
ossimRefPtr< ossimImageData > theTile
ossimImageSourceFilter(ossimObject *owner=NULL)
virtual void initialize()
Initialize the data buffer.
32 bit normalized floating point
ossimBandClipType theClipType

◆ ossimBandClipFilter() [3/3]

ossimBandClipFilter::ossimBandClipFilter ( ossimImageSource inputSource,
double  minPix,
double  maxPix,
ossimBandClipType  clipType = ossimBandClipType_NONE 
)

Definition at line 45 of file ossimBandClipFilter.cpp.

References ossimImageData::initialize(), OSSIM_NORMALIZED_FLOAT, theMaxPix, theMinPix, and theTile.

49  :ossimImageSourceFilter(inputSource),
50  theClipType(clipType),
51  theTile(NULL)
52 {
53  theTile = new ossimImageData(this, // I am the owner,
55  1);
57 
58  theMinPix.push_back(minPix);
59  theMaxPix.push_back(maxPix);
60 }
ossimRefPtr< ossimImageData > theTile
std::vector< double > theMaxPix
ossimImageSourceFilter(ossimObject *owner=NULL)
virtual void initialize()
Initialize the data buffer.
std::vector< double > theMinPix
32 bit normalized floating point
ossimBandClipType theClipType

◆ ~ossimBandClipFilter()

ossimBandClipFilter::~ossimBandClipFilter ( )
protectedvirtual

Definition at line 62 of file ossimBandClipFilter.cpp.

63 {
64 }

Member Function Documentation

◆ getClipType()

ossimBandClipFilter::ossimBandClipType ossimBandClipFilter::getClipType ( ) const

Definition at line 71 of file ossimBandClipFilter.cpp.

References theClipType.

72 {
73  return theClipType;
74 }
ossimBandClipType theClipType

◆ getMaxPix()

double ossimBandClipFilter::getMaxPix ( ossim_uint32  index) const

Definition at line 156 of file ossimBandClipFilter.cpp.

References theMaxPix.

157 {
158  return index<theMaxPix.size()?theMaxPix[index]:0;
159 }
std::vector< double > theMaxPix

◆ getMaxPixList()

const std::vector< double > ossimBandClipFilter::getMaxPixList ( ) const

Definition at line 146 of file ossimBandClipFilter.cpp.

References theMaxPix.

147 {
148  return theMaxPix;
149 }
std::vector< double > theMaxPix

◆ getMinPix()

double ossimBandClipFilter::getMinPix ( ossim_uint32  index) const

Definition at line 151 of file ossimBandClipFilter.cpp.

References theMinPix.

152 {
153  return index<theMinPix.size()?theMinPix[index]:0;
154 }
std::vector< double > theMinPix

◆ getMinPixList()

const std::vector< double > & ossimBandClipFilter::getMinPixList ( ) const

Definition at line 141 of file ossimBandClipFilter.cpp.

References theMinPix.

142 {
143  return theMinPix;
144 }
std::vector< double > theMinPix

◆ getNumberOfValues()

ossim_uint32 ossimBandClipFilter::getNumberOfValues ( ) const
virtual

Definition at line 76 of file ossimBandClipFilter.cpp.

References theMinPix.

Referenced by getTile(), and saveState().

77 {
78  // We make sure that all arrays have the same number
79  // of elements so we can use the size of any of them.
80  return (ossim_uint32)theMinPix.size();
81 }
std::vector< double > theMinPix
unsigned int ossim_uint32

◆ getTile()

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

Reimplemented from ossimImageSource.

Definition at line 161 of file ossimBandClipFilter.cpp.

References ossimImageData::copyNormalizedBufferToTile(), ossimImageData::copyTileToNormalizedBuffer(), ossimRefPtr< T >::get(), ossimImageData::getBuf(), ossimDataObject::getDataObjectStatus(), ossimImageData::getHeight(), ossimImageData::getNumberOfBands(), getNumberOfValues(), ossimImageSource::getTile(), ossimImageData::getWidth(), ossimImageData::initialize(), OSSIM_EMPTY, OSSIM_NORMALIZED_FLOAT, OSSIM_NULL, ossimBandClipType_CLAMP, ossimBandClipType_CLIP, ossimBandClipType_LINEAR_STRETCH, ossimBandClipType_MEDIAN_STRETCH, ossimNotify(), ossimNotifyLevel_WARN, runClamp(), runClip(), runLinearStretch(), runMedianStretch(), ossimDataObject::setDataObjectStatus(), status, theClipType, ossimImageSourceFilter::theInputConnection, and theTile.

164 {
165  if(!theInputConnection)
166  {
167  return NULL;
168  }
169 
171  theInputConnection->getTile(rect, resLevel);
172  if(!data.get())
173  {
174  return data;
175  }
177  if((status != OSSIM_NULL) &&
178  (status != OSSIM_EMPTY))
179  {
180  ossim_uint32 dw = data->getWidth();
181  ossim_uint32 dh = data->getHeight();
182  ossim_uint32 db = data->getNumberOfBands();
183 
184  ossim_uint32 tw = theTile->getWidth();
187 
188  if(((tw*th)!=(dw*dh))||
189  (tb != db))
190  {
191  theTile = new ossimImageData(this,
193  db,
194  dw,
195  dh);
196  theTile->initialize();
197  }
198 
200  {
201  // Should this go on??? (drb)
203  << "ossimBandClipFilter::getTile\n"
204  << "getNumberOfValues() != theTile->getNumberOfBands"
205  << endl;
206  }
207 
208  data->copyTileToNormalizedBuffer(static_cast<float*>(theTile->getBuf()));
210 
211  switch(theClipType)
212  {
214  {
215  runClip();
216  break;
217  }
219  {
220  runClamp();
221  break;
222  }
224  {
226  break;
227  }
229  {
231  break;
232  }
233  default:
234  break;
235  }
236  data->copyNormalizedBufferToTile(static_cast<float*>(theTile->getBuf()));
237  }
238 
239  return data;
240 }
virtual ossim_uint32 getWidth() const
virtual ossim_uint32 getNumberOfBands() const
ossimRefPtr< ossimImageData > theTile
virtual ossimDataObjectStatus getDataObjectStatus() const
virtual ossim_uint32 getHeight() const
virtual void initialize()
Initialize the data buffer.
virtual ossim_uint32 getNumberOfValues() const
ossimImageSource * theInputConnection
unsigned int ossim_uint32
32 bit normalized floating point
virtual void copyTileToNormalizedBuffer(ossim_float64 *buf) const
Copies entire tile to buf passed in.
virtual void copyNormalizedBufferToTile(ossim_float64 *buf)
Copies buf passed in to tile.
return status
virtual const void * getBuf() const
virtual void setDataObjectStatus(ossimDataObjectStatus status) const
Full list found in ossimConstants.h.
ossimDataObjectStatus
Definitions for data object status.
ossimBandClipType theClipType
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
virtual ossimRefPtr< ossimImageData > getTile(const ossimIpt &origin, ossim_uint32 resLevel=0)

◆ initialize()

void ossimBandClipFilter::initialize ( )
virtual

Reimplemented from ossimImageSourceFilter.

Definition at line 500 of file ossimBandClipFilter.cpp.

References ossimImageSource::getNumberOfOutputBands(), ossimImageSourceFilter::initialize(), setNumberOfValues(), ossimImageSourceFilter::theInputConnection, and theMinPix.

501 {
503 
505  {
507 
508  if(bands)
509  {
510  if(theMinPix.size() != bands)
511  {
512  setNumberOfValues(bands);
513  }
514  }
515  }
516 }
virtual ossim_uint32 getNumberOfOutputBands() const
Returns the number of bands in a tile returned from this TileSource.
std::vector< double > theMinPix
ossimImageSource * theInputConnection
unsigned int ossim_uint32
void setNumberOfValues(ossim_uint32 size)

◆ loadState()

bool ossimBandClipFilter::loadState ( const ossimKeywordlist kwl,
const char *  prefix = NULL 
)
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 518 of file ossimBandClipFilter.cpp.

References ossimString::c_str(), ossimKeywordlist::find(), ossimKeywordlist::getNumberOfSubstringKeys(), ossimImageSourceFilter::loadState(), min, ossimBandClipType_CLIP, ossimBandClipType_LINEAR_STRETCH, ossimBandClipType_MEDIAN_STRETCH, ossimBandClipType_NONE, ossimNotify(), ossimNotifyLevel_NOTICE, theClipType, theMaxPix, theMedian, theMinPix, ossimString::toString(), ossimString::trim(), and ossimString::upcase().

520 {
521  bool result = ossimImageSourceFilter::loadState(kwl, prefix);
522 
523  if(result)
524  {
525  ossimString minRegExpression = ossimString("^(") +
526  ossimString(prefix) +
527  "min[0-9]+)";
528  ossimString maxRegExpression = ossimString("^(") +
529  ossimString(prefix) +
530  "max[0-9]+)";
531  ossimString medianRegExpression = ossimString("^(") +
532  ossimString(prefix) +
533  "median[0-9]+)";
534 
535  ossim_uint32 numberOfMins = kwl.getNumberOfSubstringKeys(minRegExpression);
536  ossim_uint32 numberOfMaxs = kwl.getNumberOfSubstringKeys(maxRegExpression);
537  ossim_uint32 numberOfMedians = kwl.getNumberOfSubstringKeys(medianRegExpression);
538  theMinPix.clear();
539  theMaxPix.clear();
540  theMedian.clear();
541 
542  if(numberOfMins != numberOfMaxs)
543  {
544  ossim_int32 temp = (ossim_int32)min(numberOfMins, numberOfMaxs);
545  numberOfMins = temp;
546  numberOfMaxs = temp;
547  }
548  if(numberOfMins> 0)
549  {
550  ossimString prefixMin = ossimString(prefix) + "min";
551  ossimString prefixMax = ossimString(prefix) + "max";
552  ossimString prefixMedian = ossimString(prefix) + "median";
553 
554  ossim_uint32 numberOfMatches = 0;
555  ossim_uint32 index = 0;
556  const char* value=(const char*)NULL;
557 
558  while(numberOfMatches < numberOfMins)
559  {
560  value = kwl.find(prefixMin.c_str(),
561  ossimString::toString(index).c_str());
562  if(value)
563  {
564  theMinPix.push_back(ossimString(value).toDouble());
565  ++numberOfMatches;
566  }
567  ++index;
568  }
569  index = 0;
570  numberOfMatches = 0;
571  while(numberOfMatches < numberOfMaxs)
572  {
573  value = kwl.find(prefixMax.c_str(),
574  ossimString::toString(index).c_str());
575  if(value)
576  {
577  theMaxPix.push_back(ossimString(value).toDouble());
578  ++numberOfMatches;
579  }
580  ++index;
581  }
582  if(numberOfMedians != numberOfMins)
583  {
584  for(index = 0; index < theMaxPix.size(); ++index)
585  {
586  theMedian.push_back((theMinPix[index]+theMaxPix[index])/2.0);
587  }
588  }
589  else
590  {
591  index = 0;
592  numberOfMatches = 0;
593  while(numberOfMatches < numberOfMedians)
594  {
595  value = kwl.find(prefixMedian.c_str(),
596  ossimString::toString(index).c_str());
597  if(value)
598  {
599  theMedian.push_back(ossimString(value).toDouble());
600  ++numberOfMatches;
601  }
602  ++index;
603  }
604  }
605  }
606  }
607  const char* clip_type = kwl.find(prefix, "clip_type");
608  if(clip_type)
609  {
610  ossimString clipType = clip_type;
611  clipType = clipType.upcase().trim();
612 
613  if(clipType == "NONE")
614  {
616  }
617  else if(clipType == "CLIP")
618  {
620  }
621  else if(clipType == "LINEAR_STRETCH")
622  {
624  }
625  else if(clipType == "MEDIAN_STRETCH")
626  {
628  }
629  }
630  else
631  {
633  << "ossimBandClipFilter::loadState NOTICE:\n"
634  << "Clip type not given defaulting to NONE" << endl;
636  }
637 
638  return result;
639 }
static ossimString upcase(const ossimString &aString)
Definition: ossimString.cpp:34
ossim_uint32 getNumberOfSubstringKeys(const ossimString &regularExpression) const
std::vector< double > theMaxPix
const char * find(const char *key) const
static ossimString toString(bool aValue)
Numeric to string methods.
std::vector< double > theMedian
std::vector< double > theMinPix
unsigned int ossim_uint32
ossimString trim(const ossimString &valueToTrim=ossimString(" \\)) const
this will strip lead and trailing character passed in.
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
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
ossimBandClipType theClipType
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
#define min(a, b)
Definition: auxiliary.h:75
int ossim_int32

◆ runClamp()

void ossimBandClipFilter::runClamp ( )
protected

Definition at line 269 of file ossimBandClipFilter.cpp.

References ossimImageData::getBuf(), ossimDataObject::getDataObjectStatus(), ossimImageData::getHeight(), ossimImageData::getNullPix(), ossimImageData::getNumberOfBands(), ossimImageData::getWidth(), OSSIM_PARTIAL, theMaxPix, theMinPix, and theTile.

Referenced by getTile().

270 {
271  ossim_uint32 offset = 0;
272  ossim_uint32 upperBound = theTile->getWidth()*theTile->getHeight();
273  for(ossim_uint32 band =0; band < theTile->getNumberOfBands(); ++band)
274  {
275  float *buf = static_cast<float*>(theTile->getBuf(band));
276  float minPix = theMinPix[band];
277  float maxPix = theMaxPix[band];
278  float nullPix = theTile->getNullPix(band);
279 
280  if(buf)
281  {
283  {
284  for(offset = 0; offset < upperBound; ++offset)
285  {
286  if(*buf != nullPix)
287  {
288  if(*buf < minPix)
289  {
290  *buf = minPix;
291  }
292  else if(*buf > maxPix)
293  {
294  *buf = maxPix;
295  }
296  }
297  ++buf;
298  }
299  }
300  else
301  {
302  for(offset = 0; offset < upperBound; ++offset)
303  {
304  if(*buf < minPix)
305  {
306  *buf = minPix;
307  }
308  else if(*buf > maxPix)
309  {
310  *buf = maxPix;
311  }
312  ++buf;
313  }
314  }
315  }
316  }
317 }
virtual ossim_uint32 getWidth() const
virtual ossim_uint32 getNumberOfBands() const
ossimRefPtr< ossimImageData > theTile
std::vector< double > theMaxPix
virtual ossimDataObjectStatus getDataObjectStatus() const
virtual ossim_uint32 getHeight() const
std::vector< double > theMinPix
unsigned int ossim_uint32
virtual const ossim_float64 * getNullPix() const
virtual const void * getBuf() const

◆ runClip()

void ossimBandClipFilter::runClip ( )
protected

Definition at line 242 of file ossimBandClipFilter.cpp.

References ossimImageData::getBuf(), ossimImageData::getHeight(), ossimImageData::getNullPix(), ossimImageData::getNumberOfBands(), ossimImageData::getWidth(), theMaxPix, theMinPix, theTile, and ossimImageData::validate().

Referenced by getTile().

243 {
244  ossim_uint32 offset = 0;
245  ossim_uint32 upperBound = theTile->getWidth()*theTile->getHeight();
246  for(ossim_uint32 band =0; band < theTile->getNumberOfBands(); ++band)
247  {
248  float *buf = static_cast<float*>(theTile->getBuf(band));
249  float minPix = theMinPix[band];
250  float maxPix = theMaxPix[band];
251  float nullPix = theTile->getNullPix(band);
252 
253  if(buf)
254  {
255  for(offset = 0; offset < upperBound; ++offset)
256  {
257  if((*buf < minPix)||
258  (*buf > maxPix))
259  {
260  *buf = nullPix;
261  }
262  ++buf;
263  }
264  }
265  }
266  theTile->validate();
267 }
virtual ossim_uint32 getWidth() const
virtual ossim_uint32 getNumberOfBands() const
ossimRefPtr< ossimImageData > theTile
std::vector< double > theMaxPix
virtual ossim_uint32 getHeight() const
std::vector< double > theMinPix
virtual ossimDataObjectStatus validate() const
unsigned int ossim_uint32
virtual const ossim_float64 * getNullPix() const
virtual const void * getBuf() const

◆ runLinearStretch()

void ossimBandClipFilter::runLinearStretch ( )
protected

Definition at line 319 of file ossimBandClipFilter.cpp.

References ossimImageData::getBuf(), ossimDataObject::getDataObjectStatus(), ossimImageData::getHeight(), ossimImageData::getMaxPix(), ossimImageData::getMinPix(), ossimImageData::getNumberOfBands(), ossimImageData::getWidth(), ossimImageData::isNull(), min, OSSIM_FULL, OSSIM_PARTIAL, theMaxPix, theMinPix, and theTile.

Referenced by getTile().

320 {
324  ossim_uint32 upperBound = w*h;
325  const double* minPixArray = theTile->getMinPix();
326  const double* maxPixArray = theTile->getMaxPix();
327 
328  float* *bandArray = new float*[bands];
329  ossim_uint32 band = 0;
330  for(band = 0; band < bands; ++band)
331  {
332  bandArray[band] = static_cast<float*>(theTile->getBuf(band));
333  }
334 
336  {
337  for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
338  {
339  if(!theTile->isNull(offset))
340  {
341  for(band = 0; band < bands; ++band)
342  {
343  double delta = theMaxPix[band] - theMinPix[band];
344  double t = (bandArray[band][offset] - theMinPix[band])/delta;
345  if(t < 0)
346  {
347  bandArray[band][offset] = minPixArray[band];
348  }
349  else if(t > 1)
350  {
351  bandArray[band][offset] = maxPixArray[band];
352  }
353  else
354  {
355  bandArray[band][offset] = t;
356  }
357  }
358  }
359  }
360  }
361  else if(theTile->getDataObjectStatus() == OSSIM_FULL)
362  {
363  for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
364  {
365  for(band = 0; band < bands; ++band)
366  {
367  double delta = theMaxPix[band] - theMinPix[band];
368  double t = (bandArray[band][offset] - theMinPix[band])/delta;
369 
370  if(t < 0)
371  {
372  bandArray[band][offset] = minPixArray[band];
373  }
374  else if(t > 1)
375  {
376  bandArray[band][offset] = maxPixArray[band];
377  }
378  else
379  {
380  bandArray[band][offset] = t;
381  }
382  }
383  }
384  }
385  delete [] bandArray;
386 
387 }
virtual ossim_uint32 getWidth() const
virtual const ossim_float64 * getMaxPix() const
virtual ossim_uint32 getNumberOfBands() const
ossimRefPtr< ossimImageData > theTile
std::vector< double > theMaxPix
virtual ossimDataObjectStatus getDataObjectStatus() const
virtual ossim_uint32 getHeight() const
bool isNull(ossim_uint32 offset) const
std::vector< double > theMinPix
unsigned int ossim_uint32
virtual const ossim_float64 * getMinPix() const
virtual const void * getBuf() const
#define min(a, b)
Definition: auxiliary.h:75

◆ runMedianStretch()

void ossimBandClipFilter::runMedianStretch ( )
protected

Definition at line 389 of file ossimBandClipFilter.cpp.

References ossimImageData::getBuf(), ossimDataObject::getDataObjectStatus(), ossimImageData::getHeight(), ossimImageData::getNumberOfBands(), ossimImageData::getWidth(), ossimImageData::isNull(), OSSIM_DEFAULT_MAX_PIX_NORM_FLOAT, OSSIM_DEFAULT_MIN_PIX_NORM_FLOAT, OSSIM_FULL, OSSIM_PARTIAL, theMaxPix, theMedian, theMinPix, and theTile.

Referenced by getTile().

390 {
392  float* *bandArray = new float*[bands];
393  ossim_uint32 band = 0;
394 
395  for(band = 0; band < bands; ++band)
396  {
397  bandArray[band] = static_cast<float*>(theTile->getBuf(band));
398  }
399  ossim_uint32 upperBound = theTile->getWidth()*theTile->getHeight();
400 
402  {
403  for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
404  {
405  if(!theTile->isNull(offset))
406  {
407  for(band = 0; band < bands; ++band)
408  {
409  double side = (theMedian[band] - (double)bandArray[band][offset]);
410 
411  if(side > 0) // on the left
412  {
413  double delta = fabs(theMedian[band] - theMinPix[band]);
414  double t = ((double)bandArray[band][offset] - theMinPix[band])/delta;
415  if(t < 0)
416  {
417  bandArray[band][offset] = OSSIM_DEFAULT_MIN_PIX_NORM_FLOAT;
418  }
419  else if(t > 1)
420  {
421  bandArray[band][offset] = theMedian[band];
422  }
423  else
424  {
425  bandArray[band][offset] = theMedian[band]*t;
426  }
427  }
428  else // on the right
429  {
430  double delta = theMaxPix[band] - theMedian[band];
431  double t = ((double)bandArray[band][offset] - theMedian[band])/delta;
432 
433  if(t < 0)
434  {
435  bandArray[band][offset] = theMedian[band];
436  }
437  else if(t > 1)
438  {
439  bandArray[band][offset] = OSSIM_DEFAULT_MAX_PIX_NORM_FLOAT;
440  }
441  else
442  {
443  bandArray[band][offset] = theMedian[band]+delta*t;
444  }
445  }
446  }
447  }
448  }
449  }
450  else if(theTile->getDataObjectStatus() == OSSIM_FULL)
451  {
452  for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
453  {
454  for(band = 0; band < bands; ++band)
455  {
456  double side = (theMedian[band] - (double)bandArray[band][offset]);
457 
458  if(side > 0) // on the left
459  {
460  double delta = fabs(theMedian[band] - theMinPix[band]);
461  double t = ((double)bandArray[band][offset] - theMinPix[band])/delta;
462  if(t < 0)
463  {
464  bandArray[band][offset] = OSSIM_DEFAULT_MIN_PIX_NORM_FLOAT;
465  }
466  else if(t > 1)
467  {
468  bandArray[band][offset] = theMedian[band];
469  }
470  else
471  {
472  bandArray[band][offset] = theMedian[band]*t;
473  }
474  }
475  else // on the right
476  {
477  double delta = theMaxPix[band] - theMedian[band];
478  double t = ((double)bandArray[band][offset] - theMedian[band])/delta;
479 
480  if(t < 0)
481  {
482  bandArray[band][offset] = theMedian[band];
483  }
484  else if(t > 1)
485  {
486  bandArray[band][offset] = OSSIM_DEFAULT_MAX_PIX_NORM_FLOAT;
487  }
488  else
489  {
490  bandArray[band][offset] = theMedian[band]+delta*t;
491  }
492  }
493  }
494  }
495  }
496 
497  delete [] bandArray;
498 }
virtual ossim_uint32 getWidth() const
virtual ossim_uint32 getNumberOfBands() const
ossimRefPtr< ossimImageData > theTile
std::vector< double > theMaxPix
virtual ossimDataObjectStatus getDataObjectStatus() const
virtual ossim_uint32 getHeight() const
std::vector< double > theMedian
bool isNull(ossim_uint32 offset) const
std::vector< double > theMinPix
unsigned int ossim_uint32
virtual const void * getBuf() const
#define OSSIM_DEFAULT_MIN_PIX_NORM_FLOAT
#define OSSIM_DEFAULT_MAX_PIX_NORM_FLOAT

◆ saveState()

bool ossimBandClipFilter::saveState ( ossimKeywordlist kwl,
const char *  prefix = NULL 
) 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 641 of file ossimBandClipFilter.cpp.

References ossimKeywordlist::add(), ossimString::c_str(), getNumberOfValues(), ossimBandClipType_CLIP, ossimBandClipType_LINEAR_STRETCH, ossimBandClipType_MEDIAN_STRETCH, ossimBandClipType_NONE, ossimImageSourceFilter::saveState(), theClipType, theMaxPix, theMedian, theMinPix, and ossimString::toString().

643 {
644  ossimString minPrefix = ossimString("min");
645  ossimString maxPrefix = ossimString("max");
646  ossimString medianPrefix = ossimString("median");
647 
648  for(ossim_uint32 index = 1; index <= getNumberOfValues(); ++index)
649  {
650  ossimString value = (minPrefix+ossimString::toString(index));
651  kwl.add(prefix,
652  value.c_str(),
653  theMinPix[index-1],
654  true);
655  value = (maxPrefix+ossimString::toString(index));
656  kwl.add(prefix,
657  value.c_str(),
658  theMaxPix[index-1],
659  true);
660  value = (medianPrefix+ossimString::toString(index));
661  kwl.add(prefix,
662  value.c_str(),
663  theMedian[index-1],
664  true);
665  }
666  ossimString clipType;
667  switch(theClipType)
668  {
670  {
671  clipType = "NONE";
672  break;
673  }
675  {
676  clipType = "CLIP";
677  break;
678  }
680  {
681  clipType = "LINEAR_STRETCH";
682  break;
683  }
685  {
686  clipType = "MEDIAN_STRETCH";
687  break;
688  }
689  default:
690  break;
691  }
692  kwl.add(prefix,
693  "clip_type",
694  clipType.c_str(),
695  true);
696 
697  return ossimImageSourceFilter::saveState(kwl, prefix);
698 }
std::vector< double > theMaxPix
static ossimString toString(bool aValue)
Numeric to string methods.
std::vector< double > theMedian
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
std::vector< double > theMinPix
virtual ossim_uint32 getNumberOfValues() const
unsigned int ossim_uint32
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.
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
ossimBandClipType theClipType

◆ setClipType()

void ossimBandClipFilter::setClipType ( ossimBandClipType  clipType)

Definition at line 66 of file ossimBandClipFilter.cpp.

References theClipType.

67 {
68  theClipType = clipType;
69 }
ossimBandClipType theClipType

◆ setMinMaxPix()

void ossimBandClipFilter::setMinMaxPix ( const vector< double > &  minPix,
const vector< double > &  maxPix 
)

Definition at line 132 of file ossimBandClipFilter.cpp.

References max, setNumberOfValues(), theMaxPix, and theMinPix.

Referenced by ossimBandClipFilter().

134 {
135  theMinPix = minPix;
136  theMaxPix = maxPix;
137 
139 }
std::vector< double > theMaxPix
std::vector< double > theMinPix
unsigned int ossim_uint32
#define max(a, b)
Definition: auxiliary.h:76
void setNumberOfValues(ossim_uint32 size)

◆ setNumberOfValues()

void ossimBandClipFilter::setNumberOfValues ( ossim_uint32  size)

Definition at line 83 of file ossimBandClipFilter.cpp.

References min, OSSIM_DEFAULT_MAX_PIX_NORM_FLOAT, OSSIM_DEFAULT_MIN_PIX_NORM_FLOAT, size, theMaxPix, theMedian, and theMinPix.

Referenced by initialize(), and setMinMaxPix().

84 {
85 
86  // lets do a non destructive set. That way we can
87  // grow or shrink the list without destroying
88  // the original values.
89  //
90  if(!size)
91  {
92  theMinPix.clear();
93  theMaxPix.clear();
94  theMedian.clear();
95  return;
96  }
97 
98 
99  vector<double> tempMin = theMinPix;
100  vector<double> tempMax = theMaxPix;
101 
102  theMinPix.resize(size);
103  theMaxPix.resize(size);
104  theMedian.resize(size);
105 
106  ossim_uint32 upperBound = (ossim_uint32)min(theMinPix.size(), tempMin.size());
107  ossim_uint32 index = 0;
108 
109  for(index = 0; index < upperBound; ++index)
110  {
111  theMinPix[index] = tempMin[index];
112  theMaxPix[index] = tempMax[index];
113 
114  theMinPix[index] = theMinPix[index]>1?1:theMinPix[index];
115  theMinPix[index] = theMinPix[index]<0?0:theMinPix[index];
116  theMaxPix[index] = theMaxPix[index]>1?1:theMaxPix[index];
117  theMaxPix[index] = theMaxPix[index]<0?0:theMaxPix[index];
118 
119  theMedian[index] = (theMaxPix[index] + theMinPix[index])/2.0;
120  }
121 
122  for(;index < theMinPix.size();++index)
123  {
126  theMedian[index] = (theMaxPix[index] + theMinPix[index])/2.0;
127 
128  theMedian[index] = (theMaxPix[index] + theMinPix[index])/2.0;
129  }
130 }
std::vector< double > theMaxPix
std::vector< double > theMedian
std::vector< double > theMinPix
yy_size_t size
unsigned int ossim_uint32
#define OSSIM_DEFAULT_MIN_PIX_NORM_FLOAT
#define OSSIM_DEFAULT_MAX_PIX_NORM_FLOAT
#define min(a, b)
Definition: auxiliary.h:75

Member Data Documentation

◆ theClipType

ossimBandClipType ossimBandClipFilter::theClipType
protected

Definition at line 86 of file ossimBandClipFilter.h.

Referenced by getClipType(), getTile(), loadState(), saveState(), and setClipType().

◆ theMaxPix

std::vector<double> ossimBandClipFilter::theMaxPix
protected

◆ theMedian

std::vector<double> ossimBandClipFilter::theMedian
protected

Definition at line 84 of file ossimBandClipFilter.h.

Referenced by loadState(), runMedianStretch(), saveState(), and setNumberOfValues().

◆ theMinPix

std::vector<double> ossimBandClipFilter::theMinPix
protected

◆ theTile

ossimRefPtr<ossimImageData> ossimBandClipFilter::theTile
protected

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