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];
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;
64 a = vaInterpH1 + (vaInterpH2-vaInterpH1)*yt;
65 b = vbInterpH1 + (vbInterpH2-vbInterpH1)*yt;
66 c = vcInterpH1 + (vcInterpH2-vcInterpH1)*yt;
115 for(
int r = 0; r < gridSize.
y; ++r)
132 vector<double> xaAverage(
theAGrid.size());
133 vector<double> xcAverage(
theBGrid.size());
134 vector<double> xbAverage(
theCGrid.size());
145 for(idxBand = 0; idxBand <
theAGrid.size(); ++idxBand)
148 xaAverage[idxBand] = 0.0;
149 xbAverage[idxBand] = 0.0;
150 xcAverage[idxBand] = 0.0;
151 for(idxRow = 0; idxRow <
theAGrid[idxBand].size();++idxRow)
154 for(idxCol = 0; idxCol <
theAGrid[idxBand][idxRow].size();++idxCol)
156 xaAverage[idxBand] +=
theAGrid[idxBand][idxRow][idxCol];
160 for(idxRow = 0; idxRow <
theBGrid[idxBand].size();++idxRow)
163 for(idxCol = 0; idxCol <
theBGrid[idxBand][idxRow].size();++idxCol)
165 xbAverage[idxBand] +=
theBGrid[idxBand][idxRow][idxCol];
168 for(idxRow = 0; idxRow <
theCGrid[idxBand].size();++idxRow)
171 for(idxCol = 0; idxCol <
theCGrid[idxBand][idxRow].size();++idxCol)
173 xaAverage[idxBand] +=
theCGrid[idxBand][idxRow][idxCol];
174 xbAverage[idxBand] +=
theCGrid[idxBand][idxRow][idxCol];
175 xcAverage[idxBand] +=
theCGrid[idxBand][idxRow][idxCol];
181 for(idxBand = 0; idxBand <
theAGrid.size(); ++idxBand)
200 const char* MODULE =
"ossimAtCorrGridRemapper::loadState";
207 cerr << MODULE <<
" ERROR:" 208 <<
"Not initialized..." << endl;
219 const char* rowsLookup = NULL;
220 const char* colsLookup = NULL;
227 gridString +=
".grid";
229 rowsLookup = kwl.
find(prefix,
230 gridString +
".rows");
232 colsLookup = kwl.
find(prefix,
233 gridString +
".cols");
234 if(rowsLookup&&colsLookup)
236 cout <<
"both keywords needed: " << (gridString+
".rows") << endl
237 << (gridString+
".cols") << endl;
248 cout <<
"value for cols and rows keyword have 0" << endl;
256 for(r = 0; r < rows; ++r)
267 for(r = 0; r < rows; ++r)
269 for(c = 0; c < cols; ++c)
291 const char* prefix)
const 303 gridString +=
".grid";
virtual void setBaseToAverage()
virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0) const
This will return the bounding rect of the source.
virtual ossim_uint32 getNumberOfBands() const
vector< double > theXcArray
std::vector< std::vector< std::vector< double > > > theCGrid
void setGridSize(ossim_uint32 numberOfBands, const ossimIpt &gridSize)
Represents serializable keyword/value map.
virtual void initialize()
const char * find(const char *key) const
ossim_uint32 height() const
static ossimString toString(bool aValue)
Numeric to string methods.
RTTI_DEF1(ossimAtCorrGridRemapper, "ossimAtCorrGridRemapper", ossimAtCorrRemapper)
const ossimIpt & ul() const
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.
bool theUseInterpolationFlag
ossimAtCorrGridRemapper(ossimObject *owner=NULL, ossimImageSource *inputSource=NULL, const ossimString &sensorType="")
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
std::vector< std::vector< std::vector< double > > > theBGrid
virtual ~ossimAtCorrGridRemapper()
ossimImageSource * theInputConnection
unsigned int ossim_uint32
virtual void interpolate(const ossimDpt &pt, int band, double &a, double &b, double &c) const
virtual void initialize()
unsigned long toULong() const
vector< double > theXaArray
ossim_uint32 width() const
vector< double > theXbArray
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.
ossimRefPtr< ossimImageData > theTile
std::vector< std::vector< std::vector< double > > > theAGrid
virtual void interpolate(const ossimDpt &pt, int band, double &a, double &b, double &c) const
double * theSurfaceReflectance
bool pointWithin(const ossimIpt &pt) const