IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 25, 2012, 5:33:33 PM (14 years ago)
Author:
watersc1
Message:

Hardcoded version that gets the right solution. I wanted to save this before attempting to clean up the code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/czw_branch/20120906/psLib/src/imageops/psImageInterpolate.c

    r34442 r34470  
    947947  int yl,yh;
    948948  const psImage *image = interp->image; // Image to interpolate
    949   // const psImage *mask = interp->mask; // Mask to interpolate
    950   const psImage *variance = interp->variance; // Variance to interpolate
    951949
    952950  xl = floor(x);
    953951  if (xl < 0) { xl = 0; }
    954952  if (xl >= image->numCols) {xl = image->numCols - 1; }
     953    //{ *imageValue = NAN; return PS_INTERPOLATE_STATUS_GOOD; }
    955954  xh = xl + 1;
    956955  if (xh >= image->numCols) {xh = image->numCols - 1; }
     956    //{ *imageValue = NAN; return PS_INTERPOLATE_STATUS_GOOD; }
     957    //
    957958  yl = floor(y);
    958959  if (yl < 0) { yl = 0; }
    959960  if (yl >= image->numRows) {yl = image->numRows - 1; }
     961    //{ *imageValue = NAN; return PS_INTERPOLATE_STATUS_GOOD; }
     962  //
    960963  yh = yl + 1;
    961964  if (yh >= image->numRows) {yh = image->numRows - 1; }
    962   if (varianceValue && variance) {
    963     u1 = (xh - x) * variance->data.F32[yl][xl] + (x - xl) * variance->data.F32[yl][xh];
    964     u2 = (xh - x) * variance->data.F32[yh][xl] + (x - xl) * variance->data.F32[yh][xh];
    965 
    966     *varianceValue = (yh - y) * u1 + (y - yl) * u2;
    967   }
    968 #if 0
    969   if (maskValue && mask) {
    970     u1 = (xh - x) * mask->data.F32[yl][xl] + (x - xl) * mask->data.F32[yl][xh];
    971     u2 = (xh - x) * mask->data.F32[yh][xl] + (x - xl) * mask->data.F32[yh][xh];
    972 
    973     maskValue = (yh - y) * u1 + (y - yl) * u2;
    974   }
    975 #endif
     965    //{ *imageValue = NAN; return PS_INTERPOLATE_STATUS_GOOD; }
     966  //
    976967  if (imageValue && image) {
    977968    if (image->data.F32[yl][xl] == image->data.F32[yl][xh]) {
Note: See TracChangeset for help on using the changeset viewer.