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

#include <ossimAtCorrRemapper.h>

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

Public Member Functions

 ossimAtCorrRemapper (ossimObject *owner=NULL, ossimImageSource *inputSource=NULL, const ossimString &sensorType="")
 
virtual ossimString getShortName () const
 
virtual void initialize ()
 
virtual ossimRefPtr< ossimImageDatagetTile (const ossimIrect &tile_rect, ossim_uint32 resLevel=0)
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 
virtual ostream & print (ostream &os) const
 Outputs theErrorStatus as an ossimErrorCode and an ossimString. More...
 
vector< double > getNormMinPixelValues () const
 
vector< double > getNormMaxPixelValues () const
 
void getNormMinPixelValues (vector< double > &v) const
 
void getNormMaxPixelValues (vector< double > &v) const
 
const ossimStringgetSensorType () const
 
void setSensorType (const ossimString &sensorType)
 
- 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
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 Method to save the state of an object to a keyword list. More...
 
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)
 
- 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 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 ~ossimAtCorrRemapper ()
 
void verifyEnabled ()
 
virtual void interpolate (const ossimDpt &pt, int band, double &a, double &b, double &c) const
 
- 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

ossimRefPtr< ossimImageDatatheTile
 
double * theSurfaceReflectance
 
bool theUseInterpolationFlag
 
vector< double > theMinPixelValue
 
vector< double > theMaxPixelValue
 
vector< double > theXaArray
 
vector< double > theXbArray
 
vector< double > theXcArray
 
vector< double > theBiasArray
 
vector< double > theGainArray
 
vector< double > theCalCoefArray
 
vector< double > theBandWidthArray
 
ossimString theSensorType
 
- 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
 

Friends

ostream & operator<< (ostream &os, const ossimAtCorrRemapper &hr)
 

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

Definition at line 22 of file ossimAtCorrRemapper.h.

Constructor & Destructor Documentation

◆ ossimAtCorrRemapper()

ossimAtCorrRemapper::ossimAtCorrRemapper ( ossimObject owner = NULL,
ossimImageSource inputSource = NULL,
const ossimString sensorType = "" 
)

Definition at line 31 of file ossimAtCorrRemapper.cpp.

References ossimSource::disableSource(), and initialize().

34  :
35  ossimImageSourceFilter (owner, inputSource), // base class
36  theTile (NULL),
37  theSurfaceReflectance (NULL),
39  theMinPixelValue (0),
40  theMaxPixelValue (0),
41  theXaArray (0),
42  theXbArray (0),
43  theXcArray (0),
44  theBiasArray (0),
45  theGainArray (0),
46  theCalCoefArray (0),
48  theSensorType(sensorType)
49 {
50  //***
51  // Set the base class "theEnableFlag" to off since no adjustments have been
52  // made yet.
53  //***
54  disableSource();
55 
56  initialize();
57 }
vector< double > theXcArray
ossimImageSourceFilter(ossimObject *owner=NULL)
virtual void disableSource()
Definition: ossimSource.cpp:89
vector< double > theGainArray
vector< double > theMinPixelValue
vector< double > theBandWidthArray
vector< double > theXaArray
vector< double > theXbArray
ossimRefPtr< ossimImageData > theTile
vector< double > theCalCoefArray
vector< double > theBiasArray
vector< double > theMaxPixelValue

◆ ~ossimAtCorrRemapper()

ossimAtCorrRemapper::~ossimAtCorrRemapper ( )
protectedvirtual

Definition at line 59 of file ossimAtCorrRemapper.cpp.

References theSurfaceReflectance.

60 {
62  {
63  delete [] theSurfaceReflectance;
64  theSurfaceReflectance = NULL;
65  }
66 }

Member Function Documentation

◆ getNormMaxPixelValues() [1/2]

vector< double > ossimAtCorrRemapper::getNormMaxPixelValues ( ) const

Definition at line 581 of file ossimAtCorrRemapper.cpp.

References theMaxPixelValue.

582 {
583  return theMaxPixelValue;
584 }
vector< double > theMaxPixelValue

◆ getNormMaxPixelValues() [2/2]

void ossimAtCorrRemapper::getNormMaxPixelValues ( vector< double > &  v) const

Definition at line 591 of file ossimAtCorrRemapper.cpp.

References theMaxPixelValue.

592 {
593  v = theMaxPixelValue;
594 }
vector< double > theMaxPixelValue

◆ getNormMinPixelValues() [1/2]

vector< double > ossimAtCorrRemapper::getNormMinPixelValues ( ) const

Definition at line 576 of file ossimAtCorrRemapper.cpp.

References theMinPixelValue.

577 {
578  return theMinPixelValue;
579 }
vector< double > theMinPixelValue

◆ getNormMinPixelValues() [2/2]

void ossimAtCorrRemapper::getNormMinPixelValues ( vector< double > &  v) const

Definition at line 586 of file ossimAtCorrRemapper.cpp.

References theMinPixelValue.

587 {
588  v = theMinPixelValue;
589 }
vector< double > theMinPixelValue

◆ getSensorType()

const ossimString & ossimAtCorrRemapper::getSensorType ( ) const

Definition at line 596 of file ossimAtCorrRemapper.cpp.

References theSensorType.

597 {
598  return theSensorType;
599 }

◆ getShortName()

ossimString ossimAtCorrRemapper::getShortName ( ) const
virtual

Reimplemented from ossimObject.

Definition at line 571 of file ossimAtCorrRemapper.cpp.

572 {
573  return ossimString("Atmospheric Correction Remapper");
574 }

◆ getTile()

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

Reimplemented from ossimImageSource.

Definition at line 68 of file ossimAtCorrRemapper.cpp.

71 {
72 #if 0
73  if (traceDebug())
74  {
75  cout << "ossimAtCorrRemapper::getTile DEBUG:"
76  << "\ntile_rect: " << tile_rect << endl;
77  }
78 #endif
79 
81  {
82  cerr << "ossimAtCorrRemapper::getTile ERROR:"
83  << "\nNot initialized!"
84  << endl;
86  }
87 
88  if(!theTile.valid())
89  {
90  initialize();
91  if(!theTile)
92  {
94  }
95  }
96 
97  // Fetch tile from pointer from the input source.
99  resLevel);
100 
101  if (!inputTile.valid()) // Just in case...
102  {
104  }
105 
106  // Check for remap bypass or empty / null input tile.
107  ossimDataObjectStatus tile_status = inputTile->getDataObjectStatus();
108  if (!theEnableFlag || tile_status == OSSIM_NULL ||
109  tile_status == OSSIM_EMPTY)
110  {
111  return inputTile;
112  }
113 
114  ossim_uint32 w = tile_rect.width();
115  ossim_uint32 h = tile_rect.height();
116  ossim_uint32 tw = theTile->getWidth();
119 
120  // Set the origin of the output tile.
121  theTile->setOrigin(tile_rect.ul());
122 
123  if(w*h != tw*th)
124  {
125  theTile->setWidthHeight(w, h);
126  theTile->initialize();
128  {
129  delete [] theSurfaceReflectance;
130  theSurfaceReflectance = NULL;
131  }
132  }
133 
135  {
136  ossim_uint32 size = tw*th*bands;
137 #if 0
138  if (traceDebug())
139  {
140  cout << "ossimAtCorrRemapper::getTile DEBUG:"
141  << "\ntile_rect: " << tile_rect
142  << "\ntile width: " << tw
143  << "\ntile height: " << th
144  << "\nbands: " << bands
145  << "\nBuffer size: " << size << endl;
146  }
147 #endif
148 
149  theSurfaceReflectance = new double[size];
150  }
151 
152  ossim_uint32 buffer_index = 0;
153  ossimIpt ul = tile_rect.ul();
154  ossimIpt lr = tile_rect.lr();
155  const double MP = theTile->getMinNormalizedPix(); // Minimum normalized pix.
156  double a, b, c;
157  buffer_index = 0;
158 
159  cout << setprecision(6);
160  for (ossim_uint32 band=0; band < bands; ++band)
161  {
162  for(ossim_sint32 idxy = ul.y; idxy <= lr.y; ++idxy)
163  {
164  for(ossim_sint32 idxx = ul.x; idxx <= lr.x; ++idxx)
165  {
166  double p = inputTile->getPix(buffer_index);
167 
168  if (p>0.0)
169  {
171  {
172  a = theXaArray[band];
173  b = theXbArray[band];
174  c = theXcArray[band];
175  }
176  else
177  {
178  interpolate(ossimDpt(idxx, idxy),
179  band,
180  a,
181  b,
182  c);
183  }
184  if(theSensorType == "ls7ms")
185  {
186  double radiance_at_satellite
187  = (theGainArray[band] * p) + theBiasArray[band];
188 
189  double y = (radiance_at_satellite * a) - b;
190 
191  p = (y / (1.0 + (c * y)) );
192  }
193  else if(theSensorType == "qbms")
194  {
195  double radiance_at_satellite
196  = theCalCoefArray[band] * p / theBandWidthArray[band];
197 
198  double y = (radiance_at_satellite * a) - b;
199 
200  p = (y / (1.0 + (c * y)) );
201  }
202  else if(theSensorType == "ikms")
203  {
204 
205 
206  double radiance_at_satellite
207  = p /((theCalCoefArray[band]/1.0)/ theBandWidthArray[band]);
208  double y = (radiance_at_satellite * a) - b;
209 
210  p = (y / (1.0 + (c * y)) );
211 
212  }
213 
214  // Note that "p" should now be normalized between 0.0 and 1.0;
215 
216  // ***
217  // Since it wasn't null to start with clip / clamp between minimum
218  // normalized pixel and one(max).
219  // ***
220  p = ( p > MP ? ( p < 1.0 ? p : 1.0) : MP );
221 
222  // Scan the new tile and set the min / max.
223  if (p < theMinPixelValue[band])
224  {
225  theMinPixelValue[band] = p;
226  }
227  else if (p > theMaxPixelValue[band])
228  {
229  theMaxPixelValue[band] = p;
230  }
231 
232  theSurfaceReflectance[buffer_index] = p;
233  }
234  else
235  {
236  theSurfaceReflectance[buffer_index] = 0.0; // pixel was null...
237  }
238 
239  ++buffer_index;
240 
241  } // End of sample loop...
242 
243  } // End of line loop...
244 
245  } // End of band loop...
246 
247  // Copy the buffer to the output tile at the same time unnormalizing it.
249 
250  // Validate the output to set the tile status.
251  theTile->validate();
252 
253  return theTile;
254 }
virtual ossim_uint32 getWidth() const
virtual bool isInitialized() const
virtual ossim_uint32 getNumberOfBands() const
vector< double > theXcArray
virtual ossim_float64 getMinNormalizedPix() const
returns normalized minimum pixel value of band zero.
virtual void setWidthHeight(ossim_uint32 w, ossim_uint32 h)
bool theEnableFlag
Definition: ossimSource.h:62
ossim_uint32 y
bool valid() const
Definition: ossimRefPtr.h:75
virtual ossimDataObjectStatus getDataObjectStatus() const
virtual ossim_uint32 getHeight() const
virtual ossim_float64 getPix(const ossimIpt &position, ossim_uint32 band=0) const
Will return the pixel at location position.
vector< double > theGainArray
virtual void initialize()
Initialize the data buffer.
yy_size_t size
vector< double > theMinPixelValue
virtual ossimDataObjectStatus validate() const
ossimImageSource * theInputConnection
unsigned int ossim_uint32
virtual void interpolate(const ossimDpt &pt, int band, double &a, double &b, double &c) const
signed int ossim_sint32
vector< double > theBandWidthArray
vector< double > theXaArray
virtual void copyNormalizedBufferToTile(ossim_float64 *buf)
Copies buf passed in to tile.
vector< double > theXbArray
virtual void setOrigin(const ossimIpt &origin)
ossimRefPtr< ossimImageData > theTile
ossim_int32 y
Definition: ossimIpt.h:142
vector< double > theCalCoefArray
vector< double > theBiasArray
ossim_int32 x
Definition: ossimIpt.h:141
ossimDataObjectStatus
Definitions for data object status.
virtual ossimRefPtr< ossimImageData > getTile(const ossimIpt &origin, ossim_uint32 resLevel=0)
vector< double > theMaxPixelValue

◆ initialize()

void ossimAtCorrRemapper::initialize ( )
virtual

Reimplemented from ossimImageSourceFilter.

Reimplemented in ossimAtCorrGridRemapper.

Definition at line 256 of file ossimAtCorrRemapper.cpp.

References ossimImageDataFactory::create(), ossimImageData::getHeight(), ossimImageData::getNumberOfBands(), ossimImageData::getWidth(), ossimImageData::initialize(), ossimImageDataFactory::instance(), size, ossimImageSourceFilter::theInputConnection, theSurfaceReflectance, and theTile.

Referenced by ossimAtCorrGridRemapper::initialize(), and ossimAtCorrRemapper().

257 {
259  {
262  theTile->initialize();
263 
265  {
266  delete []theSurfaceReflectance;
267  theSurfaceReflectance = NULL;
268  }
269 
270  ossim_uint32 tw = theTile->getWidth();
273  ossim_uint32 size = tw*th*bands;
274  if (traceDebug())
275  {
276  cout << "ossimAtCorrRemapper::initialize DEBUG:"
277  << "\ntile width: " << tw
278  << "\ntile height: " << th
279  << "\nbands: " << bands
280  << "\nBuffer size: " << size << endl;
281  }
282 
283  theSurfaceReflectance = new double[size];
284 
285  setInitializedFlag(true);
287  }
288  else
289  {
290  setInitializedFlag(false);
291  setErrorStatus();
292  };
293 
294  verifyEnabled();
295 
296  if (traceDebug())
297  {
298  cout << "ossimAtCorrRemapper::initialize DEBUG:"
299  << *this
300  << endl;
301  }
302 
303 }
virtual ossim_uint32 getWidth() const
virtual ossim_uint32 getNumberOfBands() const
virtual ossim_uint32 getHeight() const
virtual void setInitializedFlag(bool flag)
virtual void initialize()
Initialize the data buffer.
static ossimImageDataFactory * instance()
yy_size_t size
ossimImageSource * theInputConnection
unsigned int ossim_uint32
virtual ossimRefPtr< ossimImageData > create(ossimSource *owner, ossimScalarType scalar, ossim_uint32 bands=1) const
ossimRefPtr< ossimImageData > theTile

◆ interpolate()

void ossimAtCorrRemapper::interpolate ( const ossimDpt pt,
int  band,
double &  a,
double &  b,
double &  c 
) const
protectedvirtual

Reimplemented in ossimAtCorrGridRemapper.

Definition at line 606 of file ossimAtCorrRemapper.cpp.

References theXaArray, theXbArray, and theXcArray.

Referenced by ossimAtCorrGridRemapper::interpolate().

611 {
612  a = theXaArray[band];
613  b = theXbArray[band];
614  c = theXcArray[band];
615 }
vector< double > theXcArray
vector< double > theXaArray
vector< double > theXbArray

◆ loadState()

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

Reimplemented in ossimAtCorrGridRemapper.

Definition at line 305 of file ossimAtCorrRemapper.cpp.

307 {
308  static const char MODULE[] = "ossimAtCorrRemapper::loadState()";
309 
310  if (traceDebug()) CLOG << "entering..." << endl;
311 
313  {
314  cerr << MODULE << " ERROR:"
315  << "Not initialized..." << endl;
316  return false;
317  }
318 
320 
321  // Clear out the old values.
322  theMinPixelValue.clear();
323  theMaxPixelValue.clear();
324  theXaArray.clear();
325  theXbArray.clear();
326  theXcArray.clear();
327  theBiasArray.clear();
328  theGainArray.clear();
329  theCalCoefArray.clear();
330  theBandWidthArray.clear();
331 
332 
333  // Now resize them.
334 
335  // Start with arbitrary big number.
336  theMinPixelValue.resize(bands, 1.0);
337 
338  // Start with arbitrary small number.
339  theMaxPixelValue.resize(bands, 0.0);
340 
341 
342  theXaArray.resize(bands, 1.0);
343  theXbArray.resize(bands, 1.0);
344  theXcArray.resize(bands, 1.0);
345 
346  theBiasArray.resize(bands, 0.0);
347  theGainArray.resize(bands, 1.0);
348  theCalCoefArray.resize(bands);
349  theBandWidthArray.resize(bands);
350 
351  for(ossim_uint32 band = 0; band < bands; ++band)
352  {
353  const char* lookup = NULL;
354  ossimString band_string = ".band";
355  band_string += ossimString::toString(band+1);
356 
357  ossimString kw = AT_CORR_XA_KW;
358  kw += band_string;
359  lookup = kwl.find(prefix, kw.c_str());
360  if (lookup)
361  {
362  theXaArray[band] = atof(lookup);
363  }
364  else
365  {
366  if (traceDebug())
367  {
368  CLOG << "DEBUG:"
369  << "\nlookup failed for keyword: " << kw.c_str() << endl;
370  }
371  }
372 
373  kw = AT_CORR_XB_KW;
374  kw += band_string;
375  lookup = kwl.find(prefix, kw.c_str());
376  if (lookup)
377  {
378  theXbArray[band] = atof(lookup);
379  }
380  else
381  {
382  if (traceDebug())
383  {
384  CLOG << "DEBUG:"
385  << "\nlookup failed for keyword: " << kw.c_str()
386  << endl;
387  }
388  }
389 
390  kw = AT_CORR_XC_KW;
391  kw += band_string;
392  lookup = kwl.find(prefix, kw.c_str());
393  if (lookup)
394  {
395  theXcArray[band] = atof(lookup);
396  }
397  else
398  {
399  if (traceDebug())
400  {
401  CLOG << "DEBUG:"
402  << "\nlookup failed for keyword: " << kw.c_str()
403  << endl;
404  }
405  }
406 
407  if(theSensorType == "ls7ms")
408  {
409  kw = AT_CORR_BIAS_KW;
410  kw += band_string;
411  lookup = kwl.find(prefix, kw.c_str());
412  if (lookup)
413  {
414  theBiasArray[band] = atof(lookup);
415  }
416  else
417  {
418  if (traceDebug())
419  {
420  CLOG << "DEBUG:"
421  << "\nlookup failed for keyword: " << kw.c_str()
422  << endl;
423  }
424  }
425 
426  kw = AT_CORR_GAIN_KW;
427  kw += band_string;
428  lookup = kwl.find(prefix, kw.c_str());
429  if (lookup)
430  {
431  theGainArray[band] = atof(lookup);
432  }
433  else
434  {
435  if (traceDebug())
436  {
437  CLOG << "DEBUG:"
438  << "\nlookup failed for keyword: " << kw.c_str()
439  << endl;
440  }
441  }
442  }
443 
444  if(theSensorType == "qbms")
445  {
446  kw = AT_CORR_CALCOEF_KW;
447  kw += band_string;
448  lookup = kwl.find(prefix, kw.c_str());
449  if (lookup)
450  {
451  theCalCoefArray[band] = atof(lookup);
452  }
453  else
454  {
455  if (traceDebug())
456  {
457  CLOG << "DEBUG:"
458  << "\nlookup failed for keyword: " << kw.c_str()
459  << endl;
460  }
461  }
462 
463  kw = AT_CORR_BANDWIDTH_KW;
464  kw += band_string;
465  lookup = kwl.find(prefix, kw.c_str());
466  if (lookup)
467  {
468  theBandWidthArray[band] = atof(lookup);
469  }
470  else
471  {
472  if (traceDebug())
473  {
474  CLOG << "DEBUG:"
475  << "\nlookup failed for keyword: " << kw.c_str()
476  << endl;
477  }
478  }
479  }
480  if(theSensorType == "ikms")
481  {
482  kw = AT_CORR_CALCOEF_KW;
483  kw += band_string;
484  lookup = kwl.find(prefix, kw.c_str());
485  if (lookup)
486  {
487  theCalCoefArray[band] = atof(lookup);
488  }
489  else
490  {
491  if (traceDebug())
492  {
493  CLOG << "DEBUG:"
494  << "\nlookup failed for keyword: " << kw.c_str()
495  << endl;
496  }
497  }
498 
499  kw = AT_CORR_BANDWIDTH_KW;
500  kw += band_string;
501  lookup = kwl.find(prefix, kw.c_str());
502  if (lookup)
503  {
504  theBandWidthArray[band] = atof(lookup);
505  }
506  else
507  {
508  if (traceDebug())
509  {
510  CLOG << "DEBUG:"
511  << "\nlookup failed for keyword: " << kw.c_str()
512  << endl;
513  }
514  }
515  }
516  }
517 
518  verifyEnabled();
519 
520  if (theEnableFlag)
521  {
522  //***
523  // Call the base class to pick up the enable flag. Note that this
524  // can override the state set from verifyEnabled() method.
525  //***
526  ossimString pref;
527  if (prefix) pref += prefix;
528  pref += "atmospheric_correction.";
529 
530  }
531 
532  if (traceDebug())
533  {
534  CLOG << "DEBUG:"
535  << *this
536  << "returning..."
537  << endl;
538  }
539 
540  return true;
541 }
virtual ossim_uint32 getNumberOfBands() const
#define CLOG
Definition: ossimTrace.h:23
vector< double > theXcArray
bool theEnableFlag
Definition: ossimSource.h:62
const char * find(const char *key) const
static ossimString toString(bool aValue)
Numeric to string methods.
vector< double > theGainArray
vector< double > theMinPixelValue
unsigned int ossim_uint32
vector< double > theBandWidthArray
vector< double > theXaArray
vector< double > theXbArray
ossimRefPtr< ossimImageData > theTile
vector< double > theCalCoefArray
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
vector< double > theBiasArray
vector< double > theMaxPixelValue

◆ print()

ostream & ossimAtCorrRemapper::print ( ostream &  out) const
virtual

Outputs theErrorStatus as an ossimErrorCode and an ossimString.

Returns
std::ostream&
Note
Derived classes should only have to implement a virtual print, not an operator<< funtion as it's implemented here.

Reimplemented from ossimSource.

Definition at line 617 of file ossimAtCorrRemapper.cpp.

References theBandWidthArray, theBiasArray, theCalCoefArray, ossimSource::theEnableFlag, theGainArray, theMaxPixelValue, theMinPixelValue, theSensorType, theXaArray, theXbArray, and theXcArray.

Referenced by operator<<().

618 {
619  os << "ossimAtCorrRemapper:"
620  << "\ntheEnableFlag: " << (theEnableFlag?"enabled":"disabled")
621  << endl;
622 
623  os << setprecision(15) << setiosflags(ios::fixed);
624 
625  ossim_uint32 band = 1;
626  vector<double>::const_iterator i = theMinPixelValue.begin();
627  while (i != theMinPixelValue.end())
628  {
629  os << "band[" << band << "] min: " << (*i) << endl;
630  ++i;
631  ++band;
632  }
633 
634  band = 1;
635  i = theMaxPixelValue.begin();
636  while (i != theMaxPixelValue.end())
637  {
638  os << "band[" << band << "] max: " << (*i) << endl;
639  ++i;
640  ++band;
641  }
642 
643  band = 1;
644  i = theXaArray.begin();
645  while (i != theXaArray.end())
646  {
647  os << "band[" << band << "] xa: " << (*i) << endl;
648  ++i;
649  ++band;
650  }
651 
652  band = 1;
653  i = theXbArray.begin();
654  while (i != theXbArray.end())
655  {
656  os << "band[" << band << "] xb: " << (*i) << endl;
657  ++i;
658  ++band;
659  }
660 
661  band = 1;
662  i = theXcArray.begin();
663  while (i != theXcArray.end())
664  {
665  os << "band[" << band << "] xc: " << (*i) << endl;
666  ++i;
667  ++band;
668  }
669 
670  if(theSensorType == "ls7ms")
671  {
672  band = 1;
673  i = theBiasArray.begin();
674  while (i != theBiasArray.end())
675  {
676  os << "band[" << band << "] bias: " << (*i) << endl;
677  ++i;
678  ++band;
679  }
680 
681  band = 1;
682  i = theGainArray.begin();
683  while (i != theGainArray.end())
684  {
685  os << "band[" << band << "] gain: " << (*i) << endl;
686  ++i;
687  ++band;
688  }
689  }
690  if(theSensorType == "qbms")
691  {
692  band = 1;
693  i = theCalCoefArray.begin();
694  while (i != theCalCoefArray.end())
695  {
696  os << "band[" << band << "] calcoef: " << (*i) << endl;
697  ++i;
698  ++band;
699  }
700 
701  band = 1;
702  i = theBandWidthArray.begin();
703  while (i != theBandWidthArray.end())
704  {
705  os << "band[" << band << "] bandwidth: " << (*i) << endl;
706  ++i;
707  ++band;
708  }
709  }
710  if(theSensorType == "ikms")
711  {
712  band = 1;
713  i = theCalCoefArray.begin();
714  while (i != theCalCoefArray.end())
715  {
716  os << "band[" << band << "] calcoef: " << (*i) << endl;
717  ++i;
718  ++band;
719  }
720 
721  }
722  return os;
723 }
vector< double > theXcArray
bool theEnableFlag
Definition: ossimSource.h:62
vector< double > theGainArray
vector< double > theMinPixelValue
unsigned int ossim_uint32
vector< double > theBandWidthArray
vector< double > theXaArray
vector< double > theXbArray
vector< double > theCalCoefArray
vector< double > theBiasArray
vector< double > theMaxPixelValue

◆ setSensorType()

void ossimAtCorrRemapper::setSensorType ( const ossimString sensorType)

Definition at line 601 of file ossimAtCorrRemapper.cpp.

References theSensorType.

602 {
603  theSensorType = sensorType;
604 }

◆ verifyEnabled()

void ossimAtCorrRemapper::verifyEnabled ( )
protected

Method to set unset the enable flag.

Definition at line 543 of file ossimAtCorrRemapper.cpp.

References ossimSource::disableSource(), ossimSource::enableSource(), ossimImageData::getNumberOfBands(), theBandWidthArray, theBiasArray, theCalCoefArray, theGainArray, ossimImageSourceFilter::theInputConnection, theMaxPixelValue, theMinPixelValue, theSurfaceReflectance, theTile, theXaArray, theXbArray, and theXcArray.

544 {
545  // Check all the pointers...
546  if ( !theInputConnection || !theTile ||
548  {
549  disableSource();
550  return;
551  }
552 
554  if ( (theMinPixelValue.size() != bands) ||
555  (theMaxPixelValue.size() != bands) ||
556  (theXaArray.size() != bands) ||
557  (theXbArray.size() != bands) ||
558  (theXcArray.size() != bands) ||
559  (theBiasArray.size() != bands) ||
560  (theGainArray.size() != bands) ||
561  (theCalCoefArray.size() != bands) ||
562  (theBandWidthArray.size()!= bands))
563  {
564  disableSource();
565  return;
566  }
567 
568  enableSource();
569 }
virtual ossim_uint32 getNumberOfBands() const
vector< double > theXcArray
virtual void disableSource()
Definition: ossimSource.cpp:89
vector< double > theGainArray
vector< double > theMinPixelValue
ossimImageSource * theInputConnection
unsigned int ossim_uint32
vector< double > theBandWidthArray
vector< double > theXaArray
virtual void enableSource()
Definition: ossimSource.cpp:84
vector< double > theXbArray
ossimRefPtr< ossimImageData > theTile
vector< double > theCalCoefArray
vector< double > theBiasArray
vector< double > theMaxPixelValue

Friends And Related Function Documentation

◆ operator<<

ostream& operator<< ( ostream &  os,
const ossimAtCorrRemapper hr 
)
friend

Definition at line 725 of file ossimAtCorrRemapper.cpp.

726 {
727  return hr.print(os);
728 }
virtual ostream & print(ostream &os) const
Outputs theErrorStatus as an ossimErrorCode and an ossimString.

Member Data Documentation

◆ theBandWidthArray

vector<double> ossimAtCorrRemapper::theBandWidthArray
protected

Definition at line 82 of file ossimAtCorrRemapper.h.

Referenced by print(), and verifyEnabled().

◆ theBiasArray

vector<double> ossimAtCorrRemapper::theBiasArray
protected

Definition at line 79 of file ossimAtCorrRemapper.h.

Referenced by print(), and verifyEnabled().

◆ theCalCoefArray

vector<double> ossimAtCorrRemapper::theCalCoefArray
protected

Definition at line 81 of file ossimAtCorrRemapper.h.

Referenced by print(), and verifyEnabled().

◆ theGainArray

vector<double> ossimAtCorrRemapper::theGainArray
protected

Definition at line 80 of file ossimAtCorrRemapper.h.

Referenced by print(), and verifyEnabled().

◆ theMaxPixelValue

vector<double> ossimAtCorrRemapper::theMaxPixelValue
protected

Definition at line 75 of file ossimAtCorrRemapper.h.

Referenced by getNormMaxPixelValues(), print(), and verifyEnabled().

◆ theMinPixelValue

vector<double> ossimAtCorrRemapper::theMinPixelValue
protected

Definition at line 74 of file ossimAtCorrRemapper.h.

Referenced by getNormMinPixelValues(), print(), and verifyEnabled().

◆ theSensorType

ossimString ossimAtCorrRemapper::theSensorType
protected

Definition at line 83 of file ossimAtCorrRemapper.h.

Referenced by getSensorType(), print(), and setSensorType().

◆ theSurfaceReflectance

double* ossimAtCorrRemapper::theSurfaceReflectance
protected

◆ theTile

ossimRefPtr<ossimImageData> ossimAtCorrRemapper::theTile
protected

◆ theUseInterpolationFlag

bool ossimAtCorrRemapper::theUseInterpolationFlag
protected

◆ theXaArray

vector<double> ossimAtCorrRemapper::theXaArray
protected

◆ theXbArray

vector<double> ossimAtCorrRemapper::theXbArray
protected

◆ theXcArray

vector<double> ossimAtCorrRemapper::theXcArray
protected

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