Changeset 21183 for trunk/psLib/src/imageops/psImagePixelInterpolate.c
- Timestamp:
- Jan 26, 2009, 8:40:07 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/imageops/psImagePixelInterpolate.c
r15254 r21183 11 11 * @author Eugene Magnier, IfA 12 12 * 13 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $14 * @date $Date: 200 7-10-09 19:25:44$13 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2009-01-27 06:39:37 $ 15 15 * 16 16 * Copyright 2007 Institute for Astronomy, University of Hawaii … … 54 54 /* do not test self */ \ 55 55 if (!jx && !jy) { continue; } \ 56 if (mask->data.PS_TYPE_ MASK_DATA[iy+jy][ix+jx] & maskVal) { continue; } \56 if (mask->data.PS_TYPE_IMAGE_MASK_DATA[iy+jy][ix+jx] & maskVal) { continue; } \ 57 57 nGood ++; \ 58 58 } \ … … 67 67 // just the mask, the output image contains enum values which define the type of interpolation which 68 68 // can be performed 69 psImage *psImagePixelInterpolateState (int *nBad, int *nPoor, psImage *mask, ps MaskType maskVal) {69 psImage *psImagePixelInterpolateState (int *nBad, int *nPoor, psImage *mask, psImageMaskType maskVal) { 70 70 71 71 psImage *result = psImageAlloc (mask->numCols, mask->numRows, PS_TYPE_S32); … … 79 79 80 80 // state of the good pixels (unmasked) 81 if (!(mask->data.PS_TYPE_ MASK_DATA[iy][ix] & maskVal)) {81 if (!(mask->data.PS_TYPE_IMAGE_MASK_DATA[iy][ix] & maskVal)) { 82 82 // count good neighbor pixels (+ self) 83 83 int nGood = 0; … … 94 94 if (jx + ix < 0) { continue; } 95 95 if (jx + ix >= mask->numCols) { continue; } 96 if (mask->data.PS_TYPE_ MASK_DATA[iy+jy][ix+jx] & maskVal) { continue; }96 if (mask->data.PS_TYPE_IMAGE_MASK_DATA[iy+jy][ix+jx] & maskVal) { continue; } 97 97 nGood ++; 98 98 minX = PS_MIN (minX, jx); … … 137 137 138 138 // interpolate the poor pixels using the available options 139 bool psImagePixelInterpolatePoor (psImage *image, psImage *state, psImage *mask, ps MaskType maskVal) {139 bool psImagePixelInterpolatePoor (psImage *image, psImage *state, psImage *mask, psImageMaskType maskVal) { 140 140 141 141 assert (image->numCols == state->numCols); … … 185 185 if (!jx && !jy) { continue; } 186 186 // skip masked pixels 187 if (mask->data.PS_TYPE_ MASK_DATA[iy+jy][ix+jx] & maskVal) { continue; }187 if (mask->data.PS_TYPE_IMAGE_MASK_DATA[iy+jy][ix+jx] & maskVal) { continue; } 188 188 x->data.F32[n] = jx; 189 189 y->data.F32[n] = jy; … … 241 241 242 242 // interpolate the good pixels to their true centers 243 bool psImagePixelInterpolateCenter (psImage *value, psImage *xCoord, psImage *yCoord, psImage *state, psImage *mask, ps MaskType maskVal) {243 bool psImagePixelInterpolateCenter (psImage *value, psImage *xCoord, psImage *yCoord, psImage *state, psImage *mask, psImageMaskType maskVal) { 244 244 245 245 assert (value->numCols == state->numCols); … … 299 299 if (jx + ix >= value->numCols) { continue; } 300 300 // skip masked pixels 301 if (mask->data.PS_TYPE_ MASK_DATA[iy+jy][ix+jx] & maskVal) { continue; }301 if (mask->data.PS_TYPE_IMAGE_MASK_DATA[iy+jy][ix+jx] & maskVal) { continue; } 302 302 x->data.F32[n] = xCoord->data.F32[iy+jy][ix+jx]; 303 303 y->data.F32[n] = yCoord->data.F32[iy+jy][ix+jx]; … … 331 331 if (jx + ix >= value->numCols) { continue; } 332 332 // skip masked pixels 333 if (mask->data.PS_TYPE_ MASK_DATA[iy+jy][ix+jx] & maskVal) { continue; }333 if (mask->data.PS_TYPE_IMAGE_MASK_DATA[iy+jy][ix+jx] & maskVal) { continue; } 334 334 x->data.F32[n] = xCoord->data.F32[iy+jy][ix+jx]; 335 335 y->data.F32[n] = yCoord->data.F32[iy+jy][ix+jx]; … … 363 363 for (int iy = 0; iy < value->numRows; iy++) { 364 364 for (int ix = 0; ix < value->numCols; ix++) { 365 if (mask->data.PS_TYPE_ MASK_DATA[iy][ix] & maskVal) { continue; }365 if (mask->data.PS_TYPE_IMAGE_MASK_DATA[iy][ix] & maskVal) { continue; } 366 366 value->data.F32[iy][ix] = output->data.F32[iy][ix]; 367 367 }
Note:
See TracChangeset
for help on using the changeset viewer.
