- Timestamp:
- Sep 25, 2012, 5:33:33 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/czw_branch/20120906/psLib/src/imageops/psImageInterpolate.c
r34442 r34470 947 947 int yl,yh; 948 948 const psImage *image = interp->image; // Image to interpolate 949 // const psImage *mask = interp->mask; // Mask to interpolate950 const psImage *variance = interp->variance; // Variance to interpolate951 949 952 950 xl = floor(x); 953 951 if (xl < 0) { xl = 0; } 954 952 if (xl >= image->numCols) {xl = image->numCols - 1; } 953 //{ *imageValue = NAN; return PS_INTERPOLATE_STATUS_GOOD; } 955 954 xh = xl + 1; 956 955 if (xh >= image->numCols) {xh = image->numCols - 1; } 956 //{ *imageValue = NAN; return PS_INTERPOLATE_STATUS_GOOD; } 957 // 957 958 yl = floor(y); 958 959 if (yl < 0) { yl = 0; } 959 960 if (yl >= image->numRows) {yl = image->numRows - 1; } 961 //{ *imageValue = NAN; return PS_INTERPOLATE_STATUS_GOOD; } 962 // 960 963 yh = yl + 1; 961 964 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 // 976 967 if (imageValue && image) { 977 968 if (image->data.F32[yl][xl] == image->data.F32[yl][xh]) {
Note:
See TracChangeset
for help on using the changeset viewer.
