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

#include <ossimAtCorrGridRemapper.h>

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

Public Member Functions

 ossimAtCorrGridRemapper (ossimObject *owner=NULL, ossimImageSource *inputSource=NULL, const ossimString &sensorType="")
 
void setGridRect (const ossimIrect &rect)
 
void setGridSize (ossim_uint32 numberOfBands, const ossimIpt &gridSize)
 
ossimIpt getGridSize () const
 
void getValues (ossim_uint32 band, ossim_uint32 row, ossim_uint32 col, double &a, double &b, double &c)
 
void getValues (const ossimDpt &pt, ossim_uint32 band, double &a, double &b, double &c)
 
void setValues (ossim_uint32 band, ossim_uint32 row, ossim_uint32 col, const double &a, const double &b, const double &c)
 
virtual void initialize ()
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 Method to save the state of an object to a keyword list. More...
 
- Public Member Functions inherited from ossimAtCorrRemapper
 ossimAtCorrRemapper (ossimObject *owner=NULL, ossimImageSource *inputSource=NULL, const ossimString &sensorType="")
 
virtual ossimString getShortName () const
 
virtual ossimRefPtr< ossimImageDatagetTile (const ossimIrect &tile_rect, ossim_uint32 resLevel=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
 
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 ~ossimAtCorrGridRemapper ()
 
virtual void interpolate (const ossimDpt &pt, int band, double &a, double &b, double &c) const
 
virtual void setBaseToAverage ()
 
- Protected Member Functions inherited from ossimAtCorrRemapper
virtual ~ossimAtCorrRemapper ()
 
void verifyEnabled ()
 
- 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

ossimIrect theGridBounds
 
ossimIpt theUlGridBound
 
ossimIpt theGridSize
 
std::vector< std::vector< std::vector< double > > > theAGrid
 
std::vector< std::vector< std::vector< double > > > theBGrid
 
std::vector< std::vector< std::vector< double > > > theCGrid
 
- Protected Attributes inherited from ossimAtCorrRemapper
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
 

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

The grid is encoded into band separate grid and allows bilinear interpolation of atmospheric correction coefficients. It uses the implementation found in ossimAtCorrRemapper. The base class will call interpolate to calculate the a, b, c coefficients used. This class just overrides the base interpolation method. For gridded remappers

Sample keywordlist includes:

band1.grid.rows: 4 band1.grid.cols: 4 band1.grid.a1: band1.grid.b1: band1.grid.c1: band1.grid.a2: band1.grid.b2: band1.grid.c2: band1.grid.a3: band1.grid.b3: band1.grid.c3: band1.grid.a4: band1.grid.b4: band1.grid.c4: band2.grid.rows: 4 band2.grid.cols: 4 band2.grid.a1: band2.grid.b1: band2.grid.c1: band2.grid.a2: band2.grid.b2: band2.grid.c2: band2.grid.a3: band2.grid.b3: band2.grid.c3: band2.grid.a4: band2.grid.b4: band2.grid.c4:

: : :

Definition at line 57 of file ossimAtCorrGridRemapper.h.

Constructor & Destructor Documentation

◆ ossimAtCorrGridRemapper()

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

Definition at line 15 of file ossimAtCorrGridRemapper.cpp.

References ossimAtCorrRemapper::theUseInterpolationFlag.

18  :ossimAtCorrRemapper(owner, inputSource, sensorType)
19 {
21 }
ossimAtCorrRemapper(ossimObject *owner=NULL, ossimImageSource *inputSource=NULL, const ossimString &sensorType="")

◆ ~ossimAtCorrGridRemapper()

ossimAtCorrGridRemapper::~ossimAtCorrGridRemapper ( )
protectedvirtual

Definition at line 23 of file ossimAtCorrGridRemapper.cpp.

24 {
25 }

Member Function Documentation

◆ getGridSize()

ossimIpt ossimAtCorrGridRemapper::getGridSize ( ) const
inline

Definition at line 72 of file ossimAtCorrGridRemapper.h.

References theGridSize.

73  {
74  return theGridSize;
75  }

◆ getValues() [1/2]

void ossimAtCorrGridRemapper::getValues ( ossim_uint32  band,
ossim_uint32  row,
ossim_uint32  col,
double &  a,
double &  b,
double &  c 
)
inline

Definition at line 77 of file ossimAtCorrGridRemapper.h.

References theAGrid.

83  {
84  a = theAGrid[band][row][col];
85  b = theAGrid[band][row][col];
86  c = theAGrid[band][row][col];
87  }
std::vector< std::vector< std::vector< double > > > theAGrid

◆ getValues() [2/2]

void ossimAtCorrGridRemapper::getValues ( const ossimDpt pt,
ossim_uint32  band,
double &  a,
double &  b,
double &  c 
)
inline

Definition at line 89 of file ossimAtCorrGridRemapper.h.

References interpolate().

94  {
95  interpolate(pt, band, a, b, c);
96  }
virtual void interpolate(const ossimDpt &pt, int band, double &a, double &b, double &c) const

◆ initialize()

void ossimAtCorrGridRemapper::initialize ( )
virtual

Reimplemented from ossimAtCorrRemapper.

Definition at line 78 of file ossimAtCorrGridRemapper.cpp.

References ossimImageSource::getBoundingRect(), ossimAtCorrRemapper::initialize(), ossimIrect::makeNan(), setBaseToAverage(), theAGrid, theBGrid, theCGrid, theGridBounds, ossimImageSourceFilter::theInputConnection, theUlGridBound, ossimAtCorrRemapper::theUseInterpolationFlag, and ossimIrect::ul().

79 {
81 
83  {
86  }
87  else
88  {
90  }
91 
92  if(!theAGrid.size()||
93  !theBGrid.size()||
94  !theCGrid.size())
95  {
97  }
99 }
virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0) const
This will return the bounding rect of the source.
std::vector< std::vector< std::vector< double > > > theCGrid
const ossimIpt & ul() const
Definition: ossimIrect.h:274
std::vector< std::vector< std::vector< double > > > theBGrid
ossimImageSource * theInputConnection
void makeNan()
Definition: ossimIrect.h:329
std::vector< std::vector< std::vector< double > > > theAGrid

◆ interpolate()

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

Reimplemented from ossimAtCorrRemapper.

Definition at line 27 of file ossimAtCorrGridRemapper.cpp.

References ossimIrect::height(), ossimAtCorrRemapper::interpolate(), ossimIrect::pointWithin(), theAGrid, theBGrid, theCGrid, theGridBounds, theGridSize, theUlGridBound, ossimIrect::width(), ossimIpt::x, ossimDpt::x, x, ossimIpt::y, ossimDpt::y, and y.

Referenced by getValues().

32 {
34  {
35  double x = (((double)(pt.x - theUlGridBound.x))/theGridBounds.width())*(theGridSize.x-1);
36  double y = (((double)(pt.y - theUlGridBound.y))/theGridBounds.height())*(theGridSize.y-1);
37 
38  int xidx = (int)x;
39  int yidx = (int)y;
40 
41  double xt = x - xidx;
42  double yt = y - yidx;
43 
44  double va00 = theAGrid[band][yidx][xidx];
45  double va01 = theAGrid[band][yidx][xidx+1];
46  double va11 = theAGrid[band][yidx+1][xidx+1];
47  double va10 = theAGrid[band][yidx+1][xidx];
48  double vb00 = theBGrid[band][yidx][xidx];
49  double vb01 = theBGrid[band][yidx][xidx+1];
50  double vb11 = theBGrid[band][yidx+1][xidx+1];
51  double vb10 = theBGrid[band][yidx+1][xidx];
52  double vc00 = theCGrid[band][yidx][xidx];
53  double vc01 = theCGrid[band][yidx][xidx+1];
54  double vc11 = theCGrid[band][yidx+1][xidx+1];
55  double vc10 = theCGrid[band][yidx+1][xidx];
56 
57  double vaInterpH1 = va00 + (va01-va00)*xt;
58  double vaInterpH2 = va10 + (va11-va10)*xt;
59  double vbInterpH1 = vb00 + (vb01-vb00)*xt;
60  double vbInterpH2 = vb10 + (vb11-vb10)*xt;
61  double vcInterpH1 = vc00 + (vc01-vc00)*xt;
62  double vcInterpH2 = vc10 + (vc11-vc10)*xt;
63 
64  a = vaInterpH1 + (vaInterpH2-vaInterpH1)*yt;
65  b = vbInterpH1 + (vbInterpH2-vbInterpH1)*yt;
66  c = vcInterpH1 + (vcInterpH2-vcInterpH1)*yt;
67  }
68  else
69  {
71  band,
72  a,
73  b,
74  c);
75  }
76 }
ossim_uint32 x
std::vector< std::vector< std::vector< double > > > theCGrid
ossim_uint32 y
double y
Definition: ossimDpt.h:165
ossim_uint32 height() const
Definition: ossimIrect.h:487
std::vector< std::vector< std::vector< double > > > theBGrid
virtual void interpolate(const ossimDpt &pt, int band, double &a, double &b, double &c) const
ossim_uint32 width() const
Definition: ossimIrect.h:500
ossim_int32 y
Definition: ossimIpt.h:142
double x
Definition: ossimDpt.h:164
ossim_int32 x
Definition: ossimIpt.h:141
std::vector< std::vector< std::vector< double > > > theAGrid
bool pointWithin(const ossimIpt &pt) const
Definition: ossimIrect.h:729

◆ loadState()

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

Definition at line 197 of file ossimAtCorrGridRemapper.cpp.

References ossimKeywordlist::find(), ossimImageData::getNumberOfBands(), setBaseToAverage(), theAGrid, theBGrid, theCGrid, theGridSize, ossimAtCorrRemapper::theSurfaceReflectance, ossimAtCorrRemapper::theTile, ossimAtCorrRemapper::theUseInterpolationFlag, ossimString::toDouble(), ossimString::toString(), ossimString::toULong(), ossimIpt::x, and ossimIpt::y.

199 {
200  const char* MODULE = "ossimAtCorrGridRemapper::loadState";
201  theAGrid.clear();
202  theBGrid.clear();
203  theCGrid.clear();
204 
206  {
207  cerr << MODULE << " ERROR:"
208  << "Not initialized..." << endl;
209  return false;
210  }
213 
214  theAGrid.resize(bands);
215  theBGrid.resize(bands);
216  theCGrid.resize(bands);
217 
218 
219  const char* rowsLookup = NULL;
220  const char* colsLookup = NULL;
221  for(ossim_uint32 band = 0; band < bands; ++band)
222  {
223  ossim_uint32 r = 0;
224  ossim_uint32 c = 0;
225  ossimString gridString = "band";
226  gridString += ossimString::toString(band+1);
227  gridString += ".grid";
228 
229  rowsLookup = kwl.find(prefix,
230  gridString + ".rows");
231 
232  colsLookup = kwl.find(prefix,
233  gridString + ".cols");
234  if(rowsLookup&&colsLookup)
235  {
236  cout << "both keywords needed: " << (gridString+".rows") << endl
237  << (gridString+".cols") << endl;
238 
240  return false;
241  }
242 
243  ossim_uint32 rows = ossimString(rowsLookup).toULong();
244  ossim_uint32 cols = ossimString(colsLookup).toULong();
245 
246  if(cols&&rows)
247  {
248  cout << "value for cols and rows keyword have 0" << endl;
250  return false;
251  }
252 
253  theAGrid[band].resize(rows);
254  theBGrid[band].resize(rows);
255  theCGrid[band].resize(rows);
256  for(r = 0; r < rows; ++r)
257  {
258  theAGrid[band][r].resize(cols);
259  theBGrid[band][r].resize(cols);
260  theCGrid[band][r].resize(cols);
261  }
262 
263  ossim_uint32 idx = 1;
264  const char* aLookup;
265  const char* bLookup;
266  const char* cLookup;
267  for(r = 0; r < rows; ++r)
268  {
269  for(c = 0; c < cols; ++c)
270  {
271  aLookup = kwl.find(prefix, gridString+".a"+ossimString::toString(idx));
272  bLookup = kwl.find(prefix, gridString+".b"+ossimString::toString(idx));
273  cLookup = kwl.find(prefix, gridString+".c"+ossimString::toString(idx));
274  theAGrid[band][r][c] = ossimString(aLookup).toDouble();
275  theBGrid[band][r][c] = ossimString(bLookup).toDouble();
276  theCGrid[band][r][c] = ossimString(cLookup).toDouble();
277 
278  ++idx;
279  }
280  }
281 
282  theGridSize.x = cols;
283  theGridSize.y = rows;
285  }
286 
287  return true;
288 }
virtual ossim_uint32 getNumberOfBands() const
std::vector< std::vector< std::vector< double > > > theCGrid
const char * find(const char *key) const
static ossimString toString(bool aValue)
Numeric to string methods.
std::vector< std::vector< std::vector< double > > > theBGrid
unsigned int ossim_uint32
double toDouble() const
unsigned long toULong() const
ossimRefPtr< ossimImageData > theTile
ossim_int32 y
Definition: ossimIpt.h:142
ossim_int32 x
Definition: ossimIpt.h:141
std::vector< std::vector< std::vector< double > > > theAGrid

◆ saveState()

bool ossimAtCorrGridRemapper::saveState ( ossimKeywordlist kwl,
const char *  prefix = 0 
) const
virtual

Method to save the state of an object to a keyword list.

Return true if ok or false on error.

Reimplemented from ossimImageSourceFilter.

Definition at line 290 of file ossimAtCorrGridRemapper.cpp.

References ossimKeywordlist::add(), ossimImageSourceFilter::saveState(), size, theAGrid, theGridSize, ossimString::toString(), ossimIpt::x, and ossimIpt::y.

292 {
293 
294  ossim_uint32 bands = (ossim_uint32)theAGrid.size();
295 
296  for(ossim_uint32 band = 0; band < bands; ++band)
297  {
298  int idx = 1;
299  int r = 0;
300  int c = 0;
301  ossimString gridString = "band";
302  gridString += ossimString::toString(band+1);
303  gridString += ".grid";
304 
305  ossim_uint32 rows = (ossim_uint32)theAGrid[band].size();
306  kwl.add(prefix,
307  gridString+".rows",
308  rows,
309  true);
310  ossim_uint32 cols = (ossim_uint32)theAGrid[band][0].size();
311  kwl.add(prefix,
312  gridString+".cols",
313  cols,
314  true);
315  for(r = 0; r < theGridSize.y; ++r)
316  {
317  for(c = 0; c < theGridSize.x; ++c)
318  {
319  kwl.add(prefix,
320  gridString+".a"+ossimString::toString(idx),
321  theAGrid[band][r][c],
322  true);
323  kwl.add(prefix,
324  gridString+".b"+ossimString::toString(idx),
325  theAGrid[band][r][c],
326  true);
327  kwl.add(prefix,
328  gridString+".c"+ossimString::toString(idx),
329  theAGrid[band][r][c],
330  true);
331 
332  ++idx;
333  }
334  }
335  }
336 
337  return ossimAtCorrRemapper::saveState(kwl, prefix);
338 }
static ossimString toString(bool aValue)
Numeric to string methods.
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
yy_size_t size
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.
ossim_int32 y
Definition: ossimIpt.h:142
ossim_int32 x
Definition: ossimIpt.h:141
std::vector< std::vector< std::vector< double > > > theAGrid

◆ setBaseToAverage()

void ossimAtCorrGridRemapper::setBaseToAverage ( )
protectedvirtual

Definition at line 129 of file ossimAtCorrGridRemapper.cpp.

References theAGrid, theBGrid, theCGrid, theGridSize, ossimAtCorrRemapper::theXaArray, ossimAtCorrRemapper::theXbArray, ossimAtCorrRemapper::theXcArray, ossimIpt::x, and ossimIpt::y.

Referenced by initialize(), and loadState().

130 {
131  ossim_uint32 idxBand;
132  vector<double> xaAverage(theAGrid.size());
133  vector<double> xcAverage(theBGrid.size());
134  vector<double> xbAverage(theCGrid.size());
135  // double aAverage=0.0, bAverage=0.0, cAverag=0.0;
136 
137 
138  if((theAGrid.size() != theBGrid.size())||
139  (theAGrid.size() != theCGrid.size())||
140  (theAGrid.size() == 0))
141  {
142  return;
143  }
144 
145  for(idxBand = 0; idxBand < theAGrid.size(); ++idxBand)
146  {
147  ossim_uint32 idxRow = 0;
148  xaAverage[idxBand] = 0.0;
149  xbAverage[idxBand] = 0.0;
150  xcAverage[idxBand] = 0.0;
151  for(idxRow = 0; idxRow < theAGrid[idxBand].size();++idxRow)
152  {
153  ossim_uint32 idxCol = 0;
154  for(idxCol = 0; idxCol < theAGrid[idxBand][idxRow].size();++idxCol)
155  {
156  xaAverage[idxBand] += theAGrid[idxBand][idxRow][idxCol];
157 
158  }
159  }
160  for(idxRow = 0; idxRow < theBGrid[idxBand].size();++idxRow)
161  {
162  ossim_uint32 idxCol = 0;
163  for(idxCol = 0; idxCol < theBGrid[idxBand][idxRow].size();++idxCol)
164  {
165  xbAverage[idxBand] += theBGrid[idxBand][idxRow][idxCol];
166  }
167  }
168  for(idxRow = 0; idxRow < theCGrid[idxBand].size();++idxRow)
169  {
170  ossim_uint32 idxCol = 0;
171  for(idxCol = 0; idxCol < theCGrid[idxBand][idxRow].size();++idxCol)
172  {
173  xaAverage[idxBand] += theCGrid[idxBand][idxRow][idxCol];
174  xbAverage[idxBand] += theCGrid[idxBand][idxRow][idxCol];
175  xcAverage[idxBand] += theCGrid[idxBand][idxRow][idxCol];
176 
177  }
178  }
179  }
180 
181  for(idxBand = 0; idxBand < theAGrid.size(); ++idxBand)
182  {
183  xaAverage[idxBand] /=(double)(theGridSize.x*theGridSize.y);
184  xbAverage[idxBand] /=(double)(theGridSize.x*theGridSize.y);
185  xcAverage[idxBand] /=(double)(theGridSize.x*theGridSize.y);
186  }
187 
188  theXaArray = xaAverage;
189  theXbArray = xbAverage;
190  theXcArray = xcAverage;
191 }
vector< double > theXcArray
std::vector< std::vector< std::vector< double > > > theCGrid
std::vector< std::vector< std::vector< double > > > theBGrid
unsigned int ossim_uint32
vector< double > theXaArray
vector< double > theXbArray
ossim_int32 y
Definition: ossimIpt.h:142
ossim_int32 x
Definition: ossimIpt.h:141
std::vector< std::vector< std::vector< double > > > theAGrid

◆ setGridRect()

void ossimAtCorrGridRemapper::setGridRect ( const ossimIrect rect)
inline

Definition at line 66 of file ossimAtCorrGridRemapper.h.

References theGridBounds, theUlGridBound, and ossimIrect::ul().

67  {
68  theGridBounds = rect;
69  theUlGridBound = rect.ul();
70  }
const ossimIpt & ul() const
Definition: ossimIrect.h:274

◆ setGridSize()

void ossimAtCorrGridRemapper::setGridSize ( ossim_uint32  numberOfBands,
const ossimIpt gridSize 
)

Definition at line 101 of file ossimAtCorrGridRemapper.cpp.

References theAGrid, theBGrid, theCGrid, theGridSize, ossimIpt::x, and ossimIpt::y.

102 {
103 
104  if((theGridSize!=gridSize)||(numberOfBands != theAGrid.size()))
105  {
106  theAGrid.resize(numberOfBands);
107  theBGrid.resize(numberOfBands);
108  theCGrid.resize(numberOfBands);
109 
110  for(ossim_uint32 b = 0; b < numberOfBands;++b)
111  {
112  theAGrid[b].resize(gridSize.y);
113  theBGrid[b].resize(gridSize.y);
114  theCGrid[b].resize(gridSize.y);
115  for(int r = 0; r < gridSize.y; ++r)
116  {
117  theAGrid[b][r].resize(gridSize.x);
118  theBGrid[b][r].resize(gridSize.x);
119  theCGrid[b][r].resize(gridSize.x);
120  }
121 
122  }
123  theGridSize = gridSize;
124  }
125 
126 }
std::vector< std::vector< std::vector< double > > > theCGrid
std::vector< std::vector< std::vector< double > > > theBGrid
unsigned int ossim_uint32
ossim_int32 y
Definition: ossimIpt.h:142
ossim_int32 x
Definition: ossimIpt.h:141
std::vector< std::vector< std::vector< double > > > theAGrid

◆ setValues()

void ossimAtCorrGridRemapper::setValues ( ossim_uint32  band,
ossim_uint32  row,
ossim_uint32  col,
const double &  a,
const double &  b,
const double &  c 
)
inline

Definition at line 98 of file ossimAtCorrGridRemapper.h.

References theAGrid, theBGrid, and theCGrid.

104  {
105  theAGrid[band][row][col] = a;
106  theBGrid[band][row][col] = b;
107  theCGrid[band][row][col] = c;
108  }
std::vector< std::vector< std::vector< double > > > theCGrid
std::vector< std::vector< std::vector< double > > > theBGrid
std::vector< std::vector< std::vector< double > > > theAGrid

Member Data Documentation

◆ theAGrid

std::vector< std::vector< std::vector<double> > > ossimAtCorrGridRemapper::theAGrid
protected

◆ theBGrid

std::vector< std::vector< std::vector<double> > > ossimAtCorrGridRemapper::theBGrid
protected

◆ theCGrid

std::vector< std::vector< std::vector<double> > > ossimAtCorrGridRemapper::theCGrid
protected

◆ theGridBounds

ossimIrect ossimAtCorrGridRemapper::theGridBounds
protected

Definition at line 123 of file ossimAtCorrGridRemapper.h.

Referenced by initialize(), interpolate(), and setGridRect().

◆ theGridSize

ossimIpt ossimAtCorrGridRemapper::theGridSize
protected

◆ theUlGridBound

ossimIpt ossimAtCorrGridRemapper::theUlGridBound
protected

Definition at line 124 of file ossimAtCorrGridRemapper.h.

Referenced by initialize(), interpolate(), and setGridRect().


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