Changeset 14906
- Timestamp:
- Sep 20, 2007, 9:16:15 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branch_20070830/psLib/src/imageops/psImageUnbin.c
r14861 r14906 7 7 * @author Eugene Magnier, IfA 8 8 * 9 * @version $Revision: 1.7.8. 2$ $Name: not supported by cvs2svn $10 * @date $Date: 2007-09- 17 01:14:28$9 * @version $Revision: 1.7.8.3 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2007-09-20 19:16:15 $ 11 11 * 12 12 * Copyright 2007 Institute for Astronomy, University of Hawaii … … 284 284 } 285 285 286 // limiting cases: Nx == 1 and/or Ny == 1 287 288 // if we have a single pixel, there is no spatial information 289 if ((in->numCols == 1) && (in->numRows == 1)) { 290 const double value = in->data.F32[0][0]; 291 return value; 292 } 293 286 294 // handle edge cases with extrapolation 287 295 … … 289 297 const int iy = y - 0.5; // index of reference pixel 290 298 299 // do numCols,Rows first so we are never < 0 291 300 const int Xs = PS_MAX (PS_MIN (ix, in->numCols - 2), 0); 292 301 const int Ys = PS_MAX (PS_MIN (iy, in->numRows - 2), 0); … … 301 310 const double rx = 1.0 - dx; 302 311 const double ry = 1.0 - dy; 312 313 // if Nx == 1, we have no x-dir spatial information 314 if (in->numCols == 1) { 315 double V0 = in->data.F32[Ys][Xs]; 316 double V1 = in->data.F32[Ye][Xs]; 317 318 const double value = V0*ry + V1*dy; 319 return value; 320 } 321 322 // if Ny == 1, we have no y-dir spatial information 323 if (in->numRows == 1) { 324 double V0 = in->data.F32[Ys][Xs]; 325 double V1 = in->data.F32[Ys][Xe]; 326 327 const double value = V0*rx + V1*dx; 328 return value; 329 } 303 330 304 331 // Vxy
Note:
See TracChangeset
for help on using the changeset viewer.
