Changeset 1853 for trunk/psModules/src/pmMaskBadPixels.c
- Timestamp:
- Sep 22, 2004, 3:33:02 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/pmMaskBadPixels.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/pmMaskBadPixels.c
r1832 r1853 19 19 * @author Ross Harman, MHPCC 20 20 * 21 * @version $Revision: 1. 2$ $Name: not supported by cvs2svn $22 * @date $Date: 2004-09-2 0 20:36:46$21 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ 22 * @date $Date: 2004-09-23 01:33:02 $ 23 23 * 24 24 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 33 33 34 34 #include "pmMaskBadPixels.h" 35 #include "pmMaskBadPixelsErrors.h" 35 36 36 37 bool pmMaskBadPixels(psReadout *in, const psImage *mask, unsigned int maskVal, float sat, … … 57 58 // Check for nulls 58 59 if (in == NULL) { 59 psError(__func__, " : Line %d - Null not allowed for input readout", __LINE__); 60 return false; 60 return true; // Readout may not have data in it 61 61 } else if(mask==NULL) { 62 psError(__func__, " : Line %d - Null not allowed for mask", __LINE__); 62 psErrorMsg(PS_ERRORNAME_DOMAIN "pmMaskBadPixels", PS_ERR_BAD_PARAMETER_NULL, true, 63 PS_ERRORTEXT_pmMaskBadPixels_NULL_MASK_IMAGE); 63 64 return false; 64 65 } … … 66 67 inImage = in->image; 67 68 if (inImage == NULL) { 68 psError(__func__, " : Line %d - Null not allowed for input image", __LINE__); 69 psErrorMsg(PS_ERRORNAME_DOMAIN "pmMaskBadPixels", PS_ERR_BAD_PARAMETER_NULL, true, 70 PS_ERRORTEXT_pmMaskBadPixels_NULL_INPUT_IMAGE); 69 71 return false; 70 72 } else if(inMask == NULL) { … … 74 76 75 77 // Check input image and its mask are not larger than mask 76 if(inImage->numRows > mask->numRows) { 77 psError(__func__, " : Line %d - Input image exceeds mask image in number of rows. (%d vs %d).", 78 __LINE__, inImage->numRows, mask->numRows); 78 if(inImage->numRows>mask->numRows || inImage->numCols > mask->numCols) { 79 psErrorMsg(PS_ERRORNAME_DOMAIN "pmMaskBadPixels", PS_ERR_BAD_PARAMETER_SIZE, true, 80 PS_ERRORTEXT_pmMaskBadPixels_SIZE_INPUT_IMAGE, 81 inImage->numRows, inImage->numCols, mask->numRows, mask->numCols); 79 82 return false; 80 } else if(inImage->numCols > mask->numCols) { 81 psError(__func__, " : Line %d - Input image exceeds mask image in number of columns. (%d vs %d).", 82 __LINE__, inImage->numCols, mask->numCols); 83 return false; 84 } else if(inMask->numRows > mask->numRows) { 85 psError(__func__, " : Line %d - Input image mask exceeds mask image in number of rows. (%d vs %d).", 86 __LINE__, inImage->numRows, mask->numRows); 87 return false; 88 } else if(inMask->numCols > mask->numCols) { 89 psError(__func__, " : Line %d - Input image mask exceeds mask image in number of columns. (%d vs %d).", 90 __LINE__, inImage->numCols, mask->numCols); 83 } else if(inMask->numRows>mask->numRows || inMask->numCols>mask->numCols) { 84 psErrorMsg(PS_ERRORNAME_DOMAIN "pmMaskBadPixels", PS_ERR_BAD_PARAMETER_SIZE, true, 85 PS_ERRORTEXT_pmMaskBadPixels_SIZE_MASK_IMAGE, 86 inImage->numRows, inImage->numCols, mask->numRows, mask->numCols); 91 87 return false; 92 88 } … … 97 93 98 94 // Check that offsets are within image limits 99 if(totOffRow > mask->numRows-1) { 100 psError(__func__, " : Line %d - Initial row offset exceeds that of mask image. (%d vs %d).", 101 __LINE__, totOffRow, mask->numRows); 95 if(totOffRow>=mask->numRows || totOffCol>=mask->numCols) { 96 psErrorMsg(PS_ERRORNAME_DOMAIN "pmMaskBadPixels", PS_ERR_BAD_PARAMETER_SIZE, true, 97 PS_ERRORTEXT_pmMaskBadPixels_OFFSET_MASK_IMAGE, 98 totOffRow, totOffCol, mask->numRows, mask->numCols); 102 99 return false; 103 } else if(totOffCol > mask->numCols-1) { 104 psError(__func__, " : Line %d - Initial column offset exceeds that of mask image. (%d vs %d).", 105 __LINE__, totOffCol, mask->numCols); 100 } else if(totOffRow>=inImage->numRows || totOffCol>=inImage->numCols) { 101 psErrorMsg(PS_ERRORNAME_DOMAIN "pmMaskBadPixels", PS_ERR_BAD_PARAMETER_SIZE, true, 102 PS_ERRORTEXT_pmMaskBadPixels_OFFSET_INPUT_IMAGE, 103 totOffRow, totOffCol, inImage->numRows, inImage->numCols); 106 104 return false; 107 } else if(totOffRow > inImage->numRows-1) { 108 psError(__func__, " : Line %d - Initial row offset exceeds that of input image. (%d vs %d).", 109 __LINE__, totOffRow, inImage->numRows); 110 return false; 111 } else if(totOffCol > inImage->numCols-1) { 112 psError(__func__, " : Line %d - Initial column offset exceeds that of input image. (%d vs %d).", 113 __LINE__, totOffCol, inImage->numCols); 114 return false; 115 } else if(totOffRow > inMask->numRows-1) { 116 psError(__func__, " : Line %d - Initial row offset exceeds that of input image mask. (%d vs %d).", 117 __LINE__, totOffRow, inMask->numRows); 118 return false; 119 } else if(totOffCol > inMask->numCols-1) { 120 psError(__func__, " : Line %d - Initial column offset exceeds that of input image mask. (%d vs %d).", 121 __LINE__, totOffCol, inMask->numCols); 105 } else if(totOffRow>=inMask->numRows || totOffCol>=inMask->numCols) { 106 psErrorMsg(PS_ERRORNAME_DOMAIN "pmMaskBadPixels", PS_ERR_BAD_PARAMETER_SIZE, true, 107 PS_ERRORTEXT_pmMaskBadPixels_OFFSET_INPUT_IMAGE_MASK, 108 totOffRow, totOffCol, inMask->numRows, inMask->numCols); 122 109 return false; 123 110 } … … 127 114 maskType = mask->type.type; 128 115 if(PS_IS_PSELEMTYPE_COMPLEX(inType)) { 129 psError(__func__, " : Line %d - Complex types not allowed for input image. Type: %d", __LINE__, 130 inType); 116 psErrorMsg(PS_ERRORNAME_DOMAIN "pmMaskBadPixels", PS_ERR_BAD_PARAMETER_TYPE, true, 117 PS_ERRORTEXT_pmMaskBadPixels_TYPE_INPUT_IMAGE, 118 inType); 131 119 return false; 132 120 } else if(maskType!=PS_TYPE_MASK) { 133 psError(__func__, " : Line %d - Mask must be PS_TYPE_MASK type. Type: %d", __LINE__, maskType); 121 psErrorMsg(PS_ERRORNAME_DOMAIN "pmMaskBadPixels", PS_ERR_BAD_PARAMETER_TYPE, true, 122 PS_ERRORTEXT_pmMaskBadPixels_TYPE_MASK_IMAGE, 123 maskType); 134 124 return false; 135 125 } … … 183 173 PM_BAD_PIXELS(F64); 184 174 default: 185 psError(__func__, "Unsupported image datatype. Type: %d", inType); 175 psErrorMsg(PS_ERRORNAME_DOMAIN "pmMaskBadPixels", PS_ERR_BAD_PARAMETER_TYPE, true, 176 PS_ERRORTEXT_pmMaskBadPixels_TYPE_UNSUPPORTED, 177 inType); 186 178 } 187 179
Note:
See TracChangeset
for help on using the changeset viewer.
