Changeset 1840
- Timestamp:
- Sep 21, 2004, 12:30:19 PM (22 years ago)
- Location:
- trunk/psLib
- Files:
-
- 24 edited
-
psLib.kdevses (modified) (2 diffs)
-
src/fft/psImageFFT.c (modified) (17 diffs)
-
src/image/psImage.c (modified) (4 diffs)
-
src/image/psImageConvolve.c (modified) (5 diffs)
-
src/image/psImageErrors.dat (modified) (1 diff)
-
src/image/psImageErrors.h (modified) (2 diffs)
-
src/image/psImageExtraction.c (modified) (20 diffs)
-
src/image/psImageFFT.c (modified) (17 diffs)
-
src/image/psImageIO.c (modified) (24 diffs)
-
src/image/psImageManip.c (modified) (38 diffs)
-
src/image/psImageStats.c (modified) (5 diffs)
-
src/imageops/psImageConvolve.c (modified) (5 diffs)
-
src/imageops/psImageStats.c (modified) (5 diffs)
-
src/mathtypes/psImage.c (modified) (4 diffs)
-
src/sys/psMemory.c (modified) (1 diff)
-
src/sys/psType.h (modified) (2 diffs)
-
src/sysUtils/psMemory.c (modified) (1 diff)
-
src/sysUtils/psType.h (modified) (2 diffs)
-
test/dataManip/Makefile (modified) (2 diffs)
-
test/image/verified/tst_psImage.stderr (modified) (3 diffs)
-
test/image/verified/tst_psImageExtraction.stderr (modified) (1 diff)
-
test/image/verified/tst_psImageFFT.stderr (modified) (1 diff)
-
test/image/verified/tst_psImageManip.stderr (modified) (7 diffs)
-
test/image/verified/tst_psImageStats01.stderr (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/psLib.kdevses
r1807 r1840 2 2 <!DOCTYPE KDevPrjSession> 3 3 <KDevPrjSession> 4 <DocsAndViews NumberOfDocuments="0" /> 4 <DocsAndViews NumberOfDocuments="6" > 5 <Doc0 NumberOfViews="1" URL="file:/home/desonia/psLib/src/psErrorCodes.dat" > 6 <View0 line="14" Type="???" > 7 <AdditionalSettings Top="1" Width="1216" Attach="1" Height="749" Left="1" MinMaxMode="0" /> 8 </View0> 9 </Doc0> 10 <Doc1 NumberOfViews="1" URL="file:/home/desonia/psLib/src/image/psImageErrors.dat" > 11 <View0 line="35" Type="???" > 12 <AdditionalSettings Top="1" Width="1216" Attach="1" Height="747" Left="1" MinMaxMode="0" /> 13 </View0> 14 </Doc1> 15 <Doc2 NumberOfViews="1" URL="file:/home/desonia/psLib/src/image/psImageIO.c" > 16 <View0 line="374" Type="???" > 17 <AdditionalSettings Top="1" Width="1216" Attach="1" Height="749" Left="1" MinMaxMode="0" /> 18 </View0> 19 </Doc2> 20 <Doc3 NumberOfViews="1" URL="file:/home/desonia/psLib/src/image/psImageFFT.c" > 21 <View0 line="0" Type="???" > 22 <AdditionalSettings Top="2" Width="1214" Attach="1" Height="747" Left="2" MinMaxMode="0" /> 23 </View0> 24 </Doc3> 25 <Doc4 NumberOfViews="1" URL="file:/home/desonia/psLib/src/image/psImageFFT.h" > 26 <View0 line="0" Type="???" > 27 <AdditionalSettings Top="2" Width="1214" Attach="1" Height="745" Left="2" MinMaxMode="0" /> 28 </View0> 29 </Doc4> 30 <Doc5 NumberOfViews="1" URL="file:/home/desonia/psLib/src/image/psImageErrors.h" > 31 <View0 line="64" Type="???" > 32 <AdditionalSettings Top="1" Width="1216" Attach="1" Height="749" Left="1" MinMaxMode="0" /> 33 </View0> 34 </Doc5> 35 </DocsAndViews> 5 36 <pluginList> 6 37 <kdevbookmarks> … … 10 41 <mark line="652" /> 11 42 <mark line="593" /> 43 </bookmark> 44 <bookmark url="/home/desonia/psLib/src/collections/psBitSet.c" > 45 <mark line="194" /> 12 46 </bookmark> 13 47 </bookmarks> -
trunk/psLib/src/fft/psImageFFT.c
r1625 r1840 5 5 * @author Robert DeSonia, MHPCC 6 6 * 7 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $8 * @date $Date: 2004-0 8-25 21:10:09 $7 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2004-09-21 22:30:19 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 22 22 #include "psImageExtraction.h" 23 23 24 #include "psImageErrors.h" 25 24 26 #define P_FFTW_PLAN_RIGOR FFTW_ESTIMATE 25 27 … … 42 44 43 45 if ((type != PS_TYPE_F32) && (type != PS_TYPE_C32)) { 44 psError(__func__, "Input image must be a 32-bit float or complex image (type=%d)", type); 46 char* typeStr; 47 PS_TYPE_NAME(typeStr,type); 48 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageFFT", 49 PS_ERR_BAD_PARAMETER_TYPE, true, 50 PS_ERRORTEXT_psImageFFT_IMAGE_TYPE_UNSUPPORTED, 51 typeStr); 45 52 psFree(out); 46 53 return NULL; … … 48 55 49 56 if (type != PS_TYPE_C32 && direction == PS_FFT_REVERSE) { 50 psError(__func__, "Input image must be complex image for reverse FFT (type=%d).", type); 57 char* typeStr; 58 PS_TYPE_NAME(typeStr,type); 59 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageFFT", 60 PS_ERR_BAD_PARAMETER_TYPE, true, 61 PS_ERRORTEXT_psImageFFT_REVERSE_NOT_COMPLEX, 62 typeStr); 51 63 psFree(out); 52 64 return NULL; … … 55 67 56 68 if (type != PS_TYPE_F32 && direction == PS_FFT_FORWARD) { 57 psError(__func__, "Input image must be real image for forward FFT (type=%d).", type); 69 char* typeStr; 70 PS_TYPE_NAME(typeStr,type); 71 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageFFT", 72 PS_ERR_BAD_PARAMETER_TYPE, true, 73 PS_ERRORTEXT_psImageFFT_FORWARD_NOT_REAL, 74 typeStr); 58 75 psFree(out); 59 76 return NULL; … … 69 86 numCols = in->numCols; 70 87 88 // n.b. FFTW can perform a in-place transform at the same or faster than out-of-place. 71 89 out = psImageCopy(out, in, PS_TYPE_C32); 72 73 90 plan = fftwf_plan_dft_2d(numCols, numRows, 74 91 (fftwf_complex *) out->data.C32[0], 75 92 (fftwf_complex *) out->data.C32[0], direction, P_FFTW_PLAN_RIGOR); 76 93 77 /* check if a plan exists now */94 /* check if a plan exists now -- if not, it is a real problem */ 78 95 if (plan == NULL) { 79 psError(__func__, "Failed to create FFTW plan."); 96 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageFFT", 97 PS_ERR_BAD_PARAMETER_TYPE, true, 98 PS_ERRORTEXT_psImageFFT_FFTW_PLAN_NULL); 80 99 psFree(out); 81 100 return NULL; … … 106 125 numRows = in->numRows; 107 126 108 /* if not a complex number, this is logically just a copy */ 109 if (!PS_IS_PSELEMTYPE_COMPLEX(type)) { 110 // Warn user, as this is probably not expected 111 psLogMsg(__func__, PS_LOG_WARN, "Real portion of a non-Complex type called called for. " 112 "Just an image copy was performed."); 127 /* if not a complex number, this is logically just a copy then */ 128 if (!PS_IS_PSELEMTYPE_COMPLEX(type) && type != PS_TYPE_PTR) { 113 129 return psImageCopy(out, in, type); 114 130 } … … 141 157 } 142 158 } else { 143 psError(__func__, "Can not extract real component from given image type (%d).", type); 159 char* typeStr; 160 PS_TYPE_NAME(typeStr,type); 161 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageReal", 162 PS_ERR_BAD_PARAMETER_TYPE, true, 163 PS_ERRORTEXT_psImage_IMAGE_TYPE_UNSUPPORTED, 164 typeStr); 165 144 166 psFree(out); 145 167 return NULL; … … 164 186 numRows = in->numRows; 165 187 166 /* if not a complex number, this is logically just zeroed image of same size */ 167 if (!PS_IS_PSELEMTYPE_COMPLEX(type)) { 168 // Warn user, as this is probably not expected 169 psLogMsg(__func__, PS_LOG_WARN, "Imaginary portion of a non-Complex type called for. " 170 "A zero image was returned."); 188 /* if not a complex image type, this is logically just zeroed image of same size */ 189 if (!PS_IS_PSELEMTYPE_COMPLEX(type) && type != PS_TYPE_PTR) { 171 190 out = psImageRecycle(out, numCols, numRows, type); 172 191 memset(out->data.V[0], 0, PSELEMTYPE_SIZEOF(type) * numCols * numRows); … … 201 220 } 202 221 } else { 203 psError(__func__, "Can not extract imaginary component from given image type (%d).", type); 222 char* typeStr; 223 PS_TYPE_NAME(typeStr,type); 224 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageImaginary", 225 PS_ERR_BAD_PARAMETER_TYPE, true, 226 PS_ERRORTEXT_psImage_IMAGE_TYPE_UNSUPPORTED, 227 typeStr); 204 228 psFree(out); 205 229 return NULL; … … 225 249 226 250 if (imag->type.type != type) { 227 psError(__func__, "The inputs to psImageComplex must be the same type."); 251 char* typeStrReal; 252 char* typeStrImag; 253 PS_TYPE_NAME(typeStrReal,type); 254 PS_TYPE_NAME(typeStrImag,imag->type.type); 255 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageComplex", 256 PS_ERR_BAD_PARAMETER_TYPE, true, 257 PS_ERRORTEXT_psImageFFT_REAL_IMAG_TYPE_MISMATCH, 258 typeStrReal,typeStrImag); 228 259 psFree(out); 229 260 return NULL; … … 231 262 232 263 if (imag->numCols != numCols || imag->numRows != numRows) { 233 psError(__func__, "The inputs to psImageComplex must be the same dimensions."); 234 psFree(out); 235 return NULL; 236 } 237 238 if (PS_IS_PSELEMTYPE_COMPLEX(type)) { 239 psError(__func__, "The inputs to psImageComplex can not be complex."); 240 psFree(out); 241 return NULL; 242 } 243 244 if (type != PS_TYPE_F32 && type != PS_TYPE_F64) { 245 psError(__func__, "The input type to psImageComplex must be a floating point."); 264 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageComplex", 265 PS_ERR_BAD_PARAMETER_VALUE, true, 266 PS_ERRORTEXT_psImageFFT_REAL_IMAG_SIZE_MISMATCH, 267 numCols, numRows, imag->numCols, imag->numRows); 246 268 psFree(out); 247 269 return NULL; … … 280 302 } 281 303 } else { 282 psError(__func__, "Can not merge real and imaginary portions for given image type (%d).", type); 283 psFree(out); 284 return NULL; 285 } 304 char* typeStr; 305 PS_TYPE_NAME(typeStr,type); 306 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageComplex", 307 PS_ERR_BAD_PARAMETER_TYPE, true, 308 PS_ERRORTEXT_psImageFFT_NONREAL_NOTSUPPORTED, 309 typeStr); 310 psFree(out); 311 return NULL; 312 } 313 286 314 287 315 return out; … … 303 331 numRows = in->numRows; 304 332 305 /* if not a complex number, this is logically just a image copy */ 306 if (!PS_IS_PSELEMTYPE_COMPLEX(type)) { 307 // Warn user, as this is probably not expected 308 psLogMsg(__func__, PS_LOG_WARN, "Complex Conjugate of a non-Complex type called for. " 309 "Image copy was performed instead."); 333 /* if not a complex image, this is logically just a image copy */ 334 if (!PS_IS_PSELEMTYPE_COMPLEX(type) && type != PS_TYPE_PTR) { 310 335 return psImageCopy(out, in, type); 311 336 } … … 338 363 } 339 364 } else { 340 psError(__func__, "Can not compute complex conjugate for given image type (%d).", type); 365 char* typeStr; 366 PS_TYPE_NAME(typeStr,type); 367 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageConjugate", 368 PS_ERR_BAD_PARAMETER_TYPE, true, 369 PS_ERRORTEXT_psImageFFT_NONCOMPLEX_NOTSUPPORTED, 370 typeStr); 341 371 psFree(out); 342 372 return NULL; … … 362 392 numRows = in->numRows; 363 393 numElementsSquared = numCols * numCols * numRows * numRows; 364 365 /* if not a complex number, this is not implemented */366 if (!PS_IS_PSELEMTYPE_COMPLEX(type)) {367 psError(__func__, "Power Spectrum for non-complex inputs is not implemented.");368 psFree(out);369 return NULL;370 }371 394 372 395 if (type == PS_TYPE_C32) { … … 405 428 } 406 429 } else { 407 psError(__func__, "Can not power spectrum for given image type (%d).", type); 408 psFree(out); 409 return NULL; 410 } 411 412 return out; 413 414 } 430 char* typeStr; 431 PS_TYPE_NAME(typeStr,type); 432 psErrorMsg(PS_ERRORNAME_DOMAIN "psImagePowerSpectrum", 433 PS_ERR_BAD_PARAMETER_TYPE, true, 434 PS_ERRORTEXT_psImageFFT_NONCOMPLEX_NOTSUPPORTED, 435 typeStr); 436 psFree(out); 437 return NULL; 438 } 439 440 return out; 441 442 } -
trunk/psLib/src/image/psImage.c
r1818 r1840 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1.4 3$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-09- 16 18:51:31$12 * @version $Revision: 1.44 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-09-21 22:30:19 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 224 224 } 225 225 226 #define PSIMAGE_PIXEL_INTERPOLATE_CASE(TYPE) \226 #define PSIMAGE_PIXEL_INTERPOLATE_CASE(TYPE) \ 227 227 case PS_TYPE_##TYPE: \ 228 228 switch (mode) { \ … … 237 237 default: \ 238 238 psErrorMsg(PS_ERRORNAME_DOMAIN "psImagePixelInterpolate", \ 239 PS_ERR_BAD_PARAMETER_VALUE,true, \240 PS_ERRORTEXT_psImage_INTERPOLATE_METHOD_INVALID, \241 mode); \242 } \239 PS_ERR_BAD_PARAMETER_VALUE,true, \ 240 PS_ERRORTEXT_psImage_INTERPOLATE_METHOD_INVALID, \ 241 mode); \ 242 } \ 243 243 break 244 244 … … 256 256 PSIMAGE_PIXEL_INTERPOLATE_CASE(C32); 257 257 PSIMAGE_PIXEL_INTERPOLATE_CASE(C64); 258 default: 259 psErrorMsg(PS_ERRORNAME_DOMAIN "psImagePixelInterpolate", 260 PS_ERR_BAD_PARAMETER_TYPE,true, 261 PS_ERRORTEXT_psImage_IMAGE_TYPE_UNSUPPORTED, 262 input->type.type); 258 default: { 259 char* typeStr; 260 PS_TYPE_NAME(typeStr,input->type.type); 261 psErrorMsg(PS_ERRORNAME_DOMAIN "psImagePixelInterpolate", 262 PS_ERR_BAD_PARAMETER_TYPE,true, 263 PS_ERRORTEXT_psImage_IMAGE_TYPE_UNSUPPORTED, 264 typeStr); 265 } 263 266 } 264 267 -
trunk/psLib/src/image/psImageConvolve.c
r1653 r1840 5 5 * @author Robert DeSonia, MHPCC 6 6 * 7 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $8 * @date $Date: 2004-0 8-28 01:18:28$7 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2004-09-21 22:30:19 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 16 16 #include "psLogMsg.h" 17 17 #include "psError.h" 18 19 #include "psImageErrors.h" 18 20 19 21 static void freeKernel(psKernel* ptr); … … 76 78 } 77 79 78 psKernel *psKernelGenerate(const psVector *xShifts, const psVector *yShifts)80 psKernel* psKernelGenerate(const psVector* xShifts, const psVector* yShifts) 79 81 { 80 82 int x = 0; … … 91 93 // got non-NULL vectors? 92 94 if (xShifts == NULL || yShifts == NULL) { 93 psError(__func__,"Shift vectors can not be NULL."); 95 psErrorMsg(PS_ERRORNAME_DOMAIN "psKernelGenerate", 96 PS_ERR_BAD_PARAMETER_NULL, true, 97 PS_ERRORTEXT_psImageConvolve_SHIFT_NULL); 94 98 return NULL; 95 99 } 96 100 101 // types match? 97 102 if (xShifts->type.type != yShifts->type.type) { 98 psError(__func__,"Shift vectors can not be different data types."); 103 char* typeXStr; 104 char* typeYStr; 105 PS_TYPE_NAME(typeXStr,xShifts->type.type); 106 PS_TYPE_NAME(typeYStr,yShifts->type.type); 107 psErrorMsg(PS_ERRORNAME_DOMAIN "psKernelGenerate", 108 PS_ERR_BAD_PARAMETER_TYPE, true, 109 PS_ERRORTEXT_psImageConvolve_SHIFT_TYPE_MISMATCH, 110 typeXStr, typeYStr); 99 111 return NULL; 100 112 } … … 158 170 KERNEL_GENERATE_CASE(C32); 159 171 KERNEL_GENERATE_CASE(C64); 160 default: 161 psError(__func__,"Shift vector datatype not supported."); 172 173 default: { 174 char* typeStr; 175 PS_TYPE_NAME(typeStr,xShifts->type.type); 176 psErrorMsg(PS_ERRORNAME_DOMAIN "psKernelGenerate", 177 PS_ERR_BAD_PARAMETER_TYPE, true, 178 PS_ERRORTEXT_psImage_IMAGE_TYPE_UNSUPPORTED, 179 typeStr); 180 } 162 181 } 163 182 -
trunk/psLib/src/image/psImageErrors.dat
r1818 r1840 11 11 psImage_NOT_AN_IMAGE The input psImage must have a PS_DIMEN_IMAGE dimension type. 12 12 psImage_IMAGE_NULL Can not operate on a NULL psImage. 13 psImage_IMAGE_TYPE_UNSUPPORTED Specified psImage type (% d) is not supported.13 psImage_IMAGE_TYPE_UNSUPPORTED Specified psImage type (%s) is not supported. 14 14 psImage_INTERPOLATE_METHOD_INVALID Specified interpolation method (%d) is not supported. 15 psImage_SUBSET_RANGE_INVALID Specified subset range, [%d:%d,%d:%d], lies outside psImage's boundaries, [0:%d,0:%d]. 16 psImage_SUBSECTION_NULL Specified subsection string can not be NULL. 17 psImage_SUBSECTION_INVALID Specified subsection string, '%s', can not be parsed. Must be in the form '[x1:x2,y1:y2]'. 18 psImage_NOT_PARENT Specified psImage can not be a child of another psImage. 19 psImage_INPLACE_NOTSUPPORTED Specified input and output psImage can not reference the same psImage. 20 psImage_SUBSET_ZERO_SIZE Specified subset, [%d:%d,%d:%d], contains no pixel data. 21 psImage_IMAGE_MASK_SIZE Input psImage mask size, %dx%d, does not match psImage input size, %dx%d. 22 psImage_IMAGE_MASK_TYPE Input psImage mask type, %s, is not the supported mask datatype of %s. 23 psImage_BAD_STAT Specified statistic option, %d, is not valid. Must specify one and only one statistic type. 24 psImage_NO_STAT_OPTIONS Specified statistic option did not indicate any operation to perform. 25 psImage_STAT_NULL Specified statistic can not be NULL. 26 psImage_SLICE_DIRECTION_INVALID Specified slice direction, %d, is invalid. 27 psImage_PARAMETER_OUTOF_TYPERANGE Specified %s value, %g, is outside of psImage type's range (%s: %g to %g). 28 # 29 psImageFFT_IMAGE_TYPE_UNSUPPORTED Input psImage type (%s) is not supported. Valid image types are psF32 and psC32. 30 psImageFFT_REVERSE_NOT_COMPLEX Input psImage (%s) is not complex. Reverse FFT operation requires a complex psImage input. 31 psImageFFT_FORWARD_NOT_REAL Input psImage (%s) is not real. Forward FFT operation requires a real psImage input. 32 psImageFFT_FFTW_PLAN_NULL Could not create a valid FFT plan to perform the transform. 33 psImageFFT_REAL_IMAG_TYPE_MISMATCH Real psImage type (%s) and imaginary psImage type (%s) must be the same. 34 psImageFFT_REAL_IMAG_SIZE_MISMATCH Real psImage size (%dx%d) and imaginary psImage size (%dx%d) must be the same. 35 psImageFFT_NONREAL_NOTSUPPORTED Input psImage type, %s, is required to be either psF32 or psF64. 36 psImageFFT_NONCOMPLEX_NOTSUPPORTED Input psImage type, %s, is required to be either psC32 or psC64. 37 # 38 psImageIO_FILENAME_NULL Specified filename can not be NULL. 39 psImageIO_FILENAME_INVALID Could not open file,'%s'.\nCFITSIO Error: %s 40 psImageIO_EXTNAME_INVALID Could not find HDU with extension name '%s' in file %s.\nCFITSIO Error: %s 41 psImageIO_EXTNUM_INVALID Could not find HDU #%d in file %s.\nCFITSIO Error: %s 42 psImageIO_DATATYPE_UNKNOWN Could not determine image data type for file %s.\nCFITSIO Error: %s 43 psImageIO_IMAGE_DIM_UNKNOWN Could not determine image dimensions for file %s.\nCFITSIO Error: %s 44 psImageIO_IMAGE_SIZE_UNKNOWN Could not determine image size for file %s.\nCFITSIO Error: %s 45 psImageIO_IMAGE_DIMENSION_UNSUPPORTED Image number of dimensions, %d, is not valid. Only two or three dimensions supported for FITS I/O. 46 psImageIO_FITS_TYPE_UNSUPPORTED FITS image type, BITPIX=%d, in file %s is not supported. 47 psImageIO_READ_FAILED Reading from FITS file %s failed.\nCFITSIO Error: %s 48 psImageIO_TYPE_UNSUPPORTED Input psImage type, %s, is not supported. 49 psImageIO_WRITE_EXTNUM_INVALID Specified extension number, %d, must not exceed number of HDUs, %d, by more than one. 50 psImageIO_FILENAME_CREATE_FAILED Could not create file,'%s'.\nCFITSIO Error: %s 51 psImageIO_CREATE_EXTENSION_FAILED Could not create EXTNAME keyword for file,'%s'.\nCFITSIO Error: %s 52 psImageIO_CREATE_HDU_FAILED Could not create HDU for writing psImage in file,'%s'.\nCFITSIO Error: %s 53 psImageIO_WRITE_FAILED Could not write psImage data to file,'%s'.\nCFITSIO Error: %s 54 # 55 psImageManip_MAXMIN Specified min value, %g, can not be greater than the specified max value, %g. 56 psImageManip_MAXMIN_REAL Specified real-portion of min value, %g, can not be greater than the real-portion of max value, %g. 57 psImageManip_MAXMIN_IMAG Specified imaginary-portion of min value, %g, can not be greater than the imaginary-portion of max value, %g. 58 psImageManip_OPERATION_NULL Operation can not be NULL. 59 psImageManip_OVERLAY_TYPE_MISMATCH Input overlay psImage type, %s, must match input psImage type, %s. 60 psImageManip_CLIP_VALUE_INVALID Specified %s value, %g%+gi, is not the the range of input psImage's valid pixel values (%s), i.e. [%g:%g]. 61 psImageManip_OVERLAY_OPERATOR_INVALID Specified operation, '%s', is not supported. 62 psImageManip_SCALE_NOT_POSITIVE Specified scale value, %d, must be a positive value. 63 psImageManip_INTERPOLATION_MODE_UNSUPPORTED Specified interpolation mode, %d, is unsupported. 64 psImageConvolve_SHIFT_NULL Specified shift vectors can not be NULL. 65 psImageConvolve_SHIFT_TYPE_MISMATCH The X-shift vector type, %s, does not match the Y-shift vector type, %s. Types must match. -
trunk/psLib/src/image/psImageErrors.h
r1818 r1840 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1. 2$ $Name: not supported by cvs2svn $10 * @date $Date: 2004-09- 16 18:51:31$9 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2004-09-21 22:30:19 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 33 33 #define PS_ERRORTEXT_psImage_NOT_AN_IMAGE "The input psImage must have a PS_DIMEN_IMAGE dimension type." 34 34 #define PS_ERRORTEXT_psImage_IMAGE_NULL "Can not operate on a NULL psImage." 35 #define PS_ERRORTEXT_psImage_IMAGE_TYPE_UNSUPPORTED "Specified psImage type (% d) is not supported."35 #define PS_ERRORTEXT_psImage_IMAGE_TYPE_UNSUPPORTED "Specified psImage type (%s) is not supported." 36 36 #define PS_ERRORTEXT_psImage_INTERPOLATE_METHOD_INVALID "Specified interpolation method (%d) is not supported." 37 #define PS_ERRORTEXT_psImage_SUBSET_RANGE_INVALID "Specified subset range, [%d:%d,%d:%d], lies outside psImage's boundaries, [0:%d,0:%d]." 38 #define PS_ERRORTEXT_psImage_SUBSECTION_NULL "Specified subsection string can not be NULL." 39 #define PS_ERRORTEXT_psImage_SUBSECTION_INVALID "Specified subsection string, '%s', can not be parsed. Must be in the form '[x1:x2,y1:y2]'." 40 #define PS_ERRORTEXT_psImage_NOT_PARENT "Specified psImage can not be a child of another psImage." 41 #define PS_ERRORTEXT_psImage_INPLACE_NOTSUPPORTED "Specified input and output psImage can not reference the same psImage." 42 #define PS_ERRORTEXT_psImage_SUBSET_ZERO_SIZE "Specified subset, [%d:%d,%d:%d], contains no pixel data." 43 #define PS_ERRORTEXT_psImage_IMAGE_MASK_SIZE "Input psImage mask size, %dx%d, does not match psImage input size, %dx%d." 44 #define PS_ERRORTEXT_psImage_IMAGE_MASK_TYPE "Input psImage mask type, %s, is not the supported mask datatype of %s." 45 #define PS_ERRORTEXT_psImage_BAD_STAT "Specified statistic option, %d, is not valid. Must specify one and only one statistic type." 46 #define PS_ERRORTEXT_psImage_NO_STAT_OPTIONS "Specified statistic option did not indicate any operation to perform." 47 #define PS_ERRORTEXT_psImage_STAT_NULL "Specified statistic can not be NULL." 48 #define PS_ERRORTEXT_psImage_SLICE_DIRECTION_INVALID "Specified slice direction, %d, is invalid." 49 #define PS_ERRORTEXT_psImage_PARAMETER_OUTOF_TYPERANGE "Specified %s value, %g, is outside of psImage type's range (%s: %g to %g)." 50 #define PS_ERRORTEXT_psImageFFT_IMAGE_TYPE_UNSUPPORTED "Input psImage type (%s) is not supported. Valid image types are psF32 and psC32." 51 #define PS_ERRORTEXT_psImageFFT_REVERSE_NOT_COMPLEX "Input psImage (%s) is not complex. Reverse FFT operation requires a complex psImage input." 52 #define PS_ERRORTEXT_psImageFFT_FORWARD_NOT_REAL "Input psImage (%s) is not real. Forward FFT operation requires a real psImage input." 53 #define PS_ERRORTEXT_psImageFFT_FFTW_PLAN_NULL "Could not create a valid FFT plan to perform the transform." 54 #define PS_ERRORTEXT_psImageFFT_REAL_IMAG_TYPE_MISMATCH "Real psImage type (%s) and imaginary psImage type (%s) must be the same." 55 #define PS_ERRORTEXT_psImageFFT_REAL_IMAG_SIZE_MISMATCH "Real psImage size (%dx%d) and imaginary psImage size (%dx%d) must be the same." 56 #define PS_ERRORTEXT_psImageFFT_NONREAL_NOTSUPPORTED "Input psImage type, %s, is required to be either psF32 or psF64." 57 #define PS_ERRORTEXT_psImageFFT_NONCOMPLEX_NOTSUPPORTED "Input psImage type, %s, is required to be either psC32 or psC64." 58 #define PS_ERRORTEXT_psImageIO_FILENAME_NULL "Specified filename can not be NULL." 59 #define PS_ERRORTEXT_psImageIO_FILENAME_INVALID "Could not open file,'%s'.\nCFITSIO Error: %s" 60 #define PS_ERRORTEXT_psImageIO_EXTNAME_INVALID "Could not find HDU with extension name '%s' in file %s.\nCFITSIO Error: %s" 61 #define PS_ERRORTEXT_psImageIO_EXTNUM_INVALID "Could not find HDU #%d in file %s.\nCFITSIO Error: %s" 62 #define PS_ERRORTEXT_psImageIO_DATATYPE_UNKNOWN "Could not determine image data type for file %s.\nCFITSIO Error: %s" 63 #define PS_ERRORTEXT_psImageIO_IMAGE_DIM_UNKNOWN "Could not determine image dimensions for file %s.\nCFITSIO Error: %s" 64 #define PS_ERRORTEXT_psImageIO_IMAGE_SIZE_UNKNOWN "Could not determine image size for file %s.\nCFITSIO Error: %s" 65 #define PS_ERRORTEXT_psImageIO_IMAGE_DIMENSION_UNSUPPORTED "Image number of dimensions, %d, is not valid. Only two or three dimensions supported for FITS I/O." 66 #define PS_ERRORTEXT_psImageIO_FITS_TYPE_UNSUPPORTED "FITS image type, BITPIX=%d, in file %s is not supported." 67 #define PS_ERRORTEXT_psImageIO_READ_FAILED "Reading from FITS file %s failed.\nCFITSIO Error: %s" 68 #define PS_ERRORTEXT_psImageIO_TYPE_UNSUPPORTED "Input psImage type, %s, is not supported." 69 #define PS_ERRORTEXT_psImageIO_WRITE_EXTNUM_INVALID "Specified extension number, %d, must not exceed number of HDUs, %d, by more than one." 70 #define PS_ERRORTEXT_psImageIO_FILENAME_CREATE_FAILED "Could not create file,'%s'.\nCFITSIO Error: %s" 71 #define PS_ERRORTEXT_psImageIO_CREATE_EXTENSION_FAILED "Could not create EXTNAME keyword for file,'%s'.\nCFITSIO Error: %s" 72 #define PS_ERRORTEXT_psImageIO_CREATE_HDU_FAILED "Could not create HDU for writing psImage in file,'%s'.\nCFITSIO Error: %s" 73 #define PS_ERRORTEXT_psImageIO_WRITE_FAILED "Could not write psImage data to file,'%s'.\nCFITSIO Error: %s" 74 #define PS_ERRORTEXT_psImageManip_MAXMIN "Specified min value, %g, can not be greater than the specified max value, %g." 75 #define PS_ERRORTEXT_psImageManip_MAXMIN_REAL "Specified real-portion of min value, %g, can not be greater than the real-portion of max value, %g." 76 #define PS_ERRORTEXT_psImageManip_MAXMIN_IMAG "Specified imaginary-portion of min value, %g, can not be greater than the imaginary-portion of max value, %g." 77 #define PS_ERRORTEXT_psImageManip_OPERATION_NULL "Operation can not be NULL." 78 #define PS_ERRORTEXT_psImageManip_OVERLAY_TYPE_MISMATCH "Input overlay psImage type, %s, must match input psImage type, %s." 79 #define PS_ERRORTEXT_psImageManip_CLIP_VALUE_INVALID "Specified %s value, %g%+gi, is not the the range of input psImage's valid pixel values (%s), i.e. [%g:%g]. " 80 #define PS_ERRORTEXT_psImageManip_OVERLAY_OPERATOR_INVALID "Specified operation, '%s', is not supported." 81 #define PS_ERRORTEXT_psImageManip_SCALE_NOT_POSITIVE "Specified scale value, %d, must be a positive value." 82 #define PS_ERRORTEXT_psImageManip_INTERPOLATION_MODE_UNSUPPORTED "Specified interpolation mode, %d, is unsupported." 83 #define PS_ERRORTEXT_psImageConvolve_SHIFT_NULL "Specified shift vectors can not be NULL." 84 #define PS_ERRORTEXT_psImageConvolve_SHIFT_TYPE_MISMATCH "The X-shift vector type, %s, does not match the Y-shift vector type, %s. Types must match." 37 85 //~End 38 86 -
trunk/psLib/src/image/psImageExtraction.c
r1613 r1840 10 10 * @author Robert DeSonia, MHPCC 11 11 * 12 * @version $Revision: 1.1 2$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-0 8-25 00:04:01$12 * @version $Revision: 1.13 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-09-21 22:30:19 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 22 22 #include "psImageExtraction.h" 23 23 #include "psError.h" 24 25 #include "psImageErrors.h" 24 26 25 27 psImage* psImageSubset(psImage* image, … … 34 36 35 37 if (image == NULL || image->data.V == NULL) { 36 psError(__func__, "Can not subset image because input image or its pixel buffer is NULL."); 38 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageSubset", 39 PS_ERR_BAD_PARAMETER_NULL, true, 40 PS_ERRORTEXT_psImage_IMAGE_NULL); 37 41 return NULL; 38 42 } 39 43 40 44 if (image->type.dimen != PS_DIMEN_IMAGE) { 41 psError(__func__, "Can not subset image because input image is not an image."); 45 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageSubset", 46 PS_ERR_BAD_PARAMETER_TYPE, true, 47 PS_ERRORTEXT_psImage_NOT_AN_IMAGE); 42 48 return NULL; 43 49 } 44 50 45 51 if (numCols < 1 || numRows < 1) { 46 psError(__func__, 47 "Can not subset image because number of rows or columns are zero (%dx%d).", numCols, numRows); 48 return NULL; 49 } 50 51 if (col0 >= image->numCols || row0 >= image->numRows) { 52 psError(__func__, 53 "Can not subset image because col0,row0 (%d,%d) is not a valid pixel location.", col0, row0); 54 return NULL; 55 } 56 57 /* validate subimage size */ 58 if (col0 + numCols >= image->numCols || row0 + numRows >= image->numRows) { 59 psError(__func__, 60 "Can not subset image outside of image boundaries (size=%dx%d, " 61 "subset=[%d:%d,%d:%d]).", 62 image->numCols, image->numRows, col0, col0 + numCols, row0, row0 + numRows); 52 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageSubset", 53 PS_ERR_BAD_PARAMETER_VALUE, true, 54 PS_ERRORTEXT_psImage_AREA_NEGATIVE, 55 numCols,numRows); 56 return NULL; 57 } 58 59 if ( col0 >= image->numCols || 60 row0 >= image->numRows || 61 col0 + numCols >= image->numCols || 62 row0 + numRows >= image->numRows ) { 63 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageSubset", 64 PS_ERR_BAD_PARAMETER_VALUE, true, 65 PS_ERRORTEXT_psImage_SUBSET_RANGE_INVALID, 66 col0, col0 + numCols, row0, row0 + numRows, 67 image->numCols, image->numRows); 63 68 return NULL; 64 69 } … … 104 109 // section should be of the form '[x1:x2,y1:y2]' 105 110 if (section == NULL) { 106 psError(__func__,"The subsection string input can not be NULL."); 111 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageSubsection", 112 PS_ERR_BAD_PARAMETER_NULL, true, 113 PS_ERRORTEXT_psImage_SUBSECTION_NULL); 107 114 return NULL; 108 115 } 109 116 110 117 if (sscanf(section,"[%d:%d,%d:%d]",&x1,&x2,&y1,&y2) < 4) { 111 psError(__func__,"The subsection string (%s) can not be parsed. " 112 "Needs to be of the form '[x1:x2,y1:y2]'", 113 section); 118 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageSubsection", 119 PS_ERR_BAD_PARAMETER_NULL, true, 120 PS_ERRORTEXT_psImage_SUBSECTION_INVALID, 121 section); 114 122 return NULL; 115 123 } … … 120 128 { 121 129 if (image == NULL || image->data.V == NULL) { 122 psError(__func__, "Can not subset image because input image or its " 123 "pixel buffer is NULL."); 130 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageTrim", 131 PS_ERR_BAD_PARAMETER_NULL, true, 132 PS_ERRORTEXT_psImage_IMAGE_NULL); 124 133 return NULL; 125 134 } 126 135 127 136 if (image->parent != NULL) { 128 psError(__func__, "Can not perform a trim on a child image."); 137 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageTrim", 138 PS_ERR_BAD_PARAMETER_NULL, true, 139 PS_ERRORTEXT_psImage_NOT_PARENT); 129 140 return NULL; 130 141 } … … 134 145 y0 >= image->numRows || y1 >= image->numRows || 135 146 x0 > x1 || y0 > y1 ) { 136 psError(__func__, "Can not subset image because specified region " 137 "[%d:%d,%d:%d] is not valid for image of size %dx%d.", 138 x0,x1,y0,y1,image->numCols,image->numRows); 147 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageTrim", 148 PS_ERR_BAD_PARAMETER_VALUE, true, 149 PS_ERRORTEXT_psImage_SUBSET_RANGE_INVALID, 150 x0, x1, y0, y1, 151 image->numCols, image->numRows); 139 152 return NULL; 140 153 } … … 179 192 180 193 if (input == NULL || input->data.V == NULL) { 181 psError(__func__, "Can not copy image because input image or its pixel buffer is NULL."); 194 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageCopy", 195 PS_ERR_BAD_PARAMETER_NULL, true, 196 PS_ERRORTEXT_psImage_IMAGE_NULL); 182 197 psFree(output); 183 198 return NULL; … … 185 200 186 201 if (input == output) { 187 psError (__func__,188 "Can not copy image because given input and output "189 "parameter reference the same psImage struct.");202 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageCopy", 203 PS_ERR_BAD_PARAMETER_NULL, true, 204 PS_ERRORTEXT_psImage_INPLACE_NOTSUPPORTED); 190 205 psFree(output); 191 206 return NULL; … … 193 208 194 209 if (input->type.dimen != PS_DIMEN_IMAGE) { 195 psError(__func__, "Can not copy image because input image is not actually an image."); 210 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageCopy", 211 PS_ERR_BAD_PARAMETER_TYPE, true, 212 PS_ERRORTEXT_psImage_NOT_AN_IMAGE); 196 213 psFree(output); 197 214 return NULL; … … 205 222 206 223 if (inDatatype == PS_TYPE_PTR || type == PS_TYPE_PTR) { 207 psError(__func__, "Can not copy image to/from a void* matrix"); 224 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageCopy", 225 PS_ERR_BAD_PARAMETER_TYPE, true, 226 PS_ERRORTEXT_psImage_IMAGE_TYPE_UNSUPPORTED, 227 PS_TYPE_PTR_NAME); 208 228 psFree(output); 209 229 return NULL; … … 220 240 return output; 221 241 } 242 222 243 #define PSIMAGE_ELEMENT_COPY(IN,INTYPE,OUT,OUTTYPE,ELEMENTS) { \ 223 244 ps##INTYPE *in; \ … … 232 253 } 233 254 234 #define PSIMAGE_COPY_CASE(OUT,OUTTYPE) \ 235 switch (inDatatype) { \ 236 case PS_TYPE_S8: \ 237 PSIMAGE_ELEMENT_COPY(input,S8,OUT,OUTTYPE,elements); \ 238 break; \ 239 case PS_TYPE_S16: \ 240 PSIMAGE_ELEMENT_COPY(input,S16,OUT,OUTTYPE,elements); \ 241 break; \ 242 case PS_TYPE_S32: \ 243 PSIMAGE_ELEMENT_COPY(input,S32,OUT,OUTTYPE,elements); \ 244 break; \ 245 case PS_TYPE_S64: \ 246 PSIMAGE_ELEMENT_COPY(input,S64,OUT,OUTTYPE,elements); \ 247 break; \ 248 case PS_TYPE_U8: \ 249 PSIMAGE_ELEMENT_COPY(input,U8,OUT,OUTTYPE,elements); \ 250 break; \ 251 case PS_TYPE_U16: \ 252 PSIMAGE_ELEMENT_COPY(input,U16,OUT,OUTTYPE,elements); \ 253 break; \ 254 case PS_TYPE_U32: \ 255 PSIMAGE_ELEMENT_COPY(input,U32,OUT,OUTTYPE,elements); \ 256 break; \ 257 case PS_TYPE_U64: \ 258 PSIMAGE_ELEMENT_COPY(input,U64,OUT,OUTTYPE,elements); \ 259 break; \ 260 case PS_TYPE_F32: \ 261 PSIMAGE_ELEMENT_COPY(input,F32,OUT,OUTTYPE,elements); \ 262 break; \ 263 case PS_TYPE_F64: \ 264 PSIMAGE_ELEMENT_COPY(input,F64,OUT,OUTTYPE,elements); \ 265 break; \ 266 case PS_TYPE_C32: \ 267 PSIMAGE_ELEMENT_COPY(input,C32,OUT,OUTTYPE,elements); \ 268 break; \ 269 case PS_TYPE_C64: \ 270 PSIMAGE_ELEMENT_COPY(input,C64,OUT,OUTTYPE,elements); \ 271 break; \ 272 default: \ 273 break; \ 255 #define PSIMAGE_COPY_CASE(OUT,OUTTYPE) { \ 256 switch (inDatatype) { \ 257 case PS_TYPE_S8: \ 258 PSIMAGE_ELEMENT_COPY(input,S8,OUT,OUTTYPE,elements); \ 259 break; \ 260 case PS_TYPE_S16: \ 261 PSIMAGE_ELEMENT_COPY(input,S16,OUT,OUTTYPE,elements); \ 262 break; \ 263 case PS_TYPE_S32: \ 264 PSIMAGE_ELEMENT_COPY(input,S32,OUT,OUTTYPE,elements); \ 265 break; \ 266 case PS_TYPE_S64: \ 267 PSIMAGE_ELEMENT_COPY(input,S64,OUT,OUTTYPE,elements); \ 268 break; \ 269 case PS_TYPE_U8: \ 270 PSIMAGE_ELEMENT_COPY(input,U8,OUT,OUTTYPE,elements); \ 271 break; \ 272 case PS_TYPE_U16: \ 273 PSIMAGE_ELEMENT_COPY(input,U16,OUT,OUTTYPE,elements); \ 274 break; \ 275 case PS_TYPE_U32: \ 276 PSIMAGE_ELEMENT_COPY(input,U32,OUT,OUTTYPE,elements); \ 277 break; \ 278 case PS_TYPE_U64: \ 279 PSIMAGE_ELEMENT_COPY(input,U64,OUT,OUTTYPE,elements); \ 280 break; \ 281 case PS_TYPE_F32: \ 282 PSIMAGE_ELEMENT_COPY(input,F32,OUT,OUTTYPE,elements); \ 283 break; \ 284 case PS_TYPE_F64: \ 285 PSIMAGE_ELEMENT_COPY(input,F64,OUT,OUTTYPE,elements); \ 286 break; \ 287 case PS_TYPE_C32: \ 288 PSIMAGE_ELEMENT_COPY(input,C32,OUT,OUTTYPE,elements); \ 289 break; \ 290 case PS_TYPE_C64: \ 291 PSIMAGE_ELEMENT_COPY(input,C64,OUT,OUTTYPE,elements); \ 292 break; \ 293 default: \ 294 break; \ 295 } \ 274 296 } 275 297 … … 311 333 PSIMAGE_COPY_CASE(output, C64); 312 334 break; 313 default: 314 break; 335 default: { 336 char* typeStr; 337 PS_TYPE_NAME(typeStr,type); 338 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageCopy", 339 PS_ERR_BAD_PARAMETER_TYPE, true, 340 PS_ERRORTEXT_psImage_IMAGE_TYPE_UNSUPPORTED, 341 typeStr); 342 psFree(output); 343 344 break; 345 } 315 346 } 316 347 return output; … … 338 369 339 370 if (in == NULL || in->data.V == NULL) { 340 psError(__func__, "Input image can not be NULL."); 371 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageSlice", 372 PS_ERR_BAD_PARAMETER_NULL, true, 373 PS_ERRORTEXT_psImage_IMAGE_NULL); 341 374 psFree(out); 342 375 return NULL; 343 376 } 344 377 345 if (numRows == 0 || numCols == 0) { 346 psError(__func__, "The specified region contains no data (%dx%d)", numCols, numRows); 378 if (numRows < 1 || numCols < 1) { 379 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageSlice", 380 PS_ERR_BAD_PARAMETER_NULL, true, 381 PS_ERRORTEXT_psImage_SUBSET_ZERO_SIZE, 382 col,col+numCols,row,row+numRows); 347 383 psFree(out); 348 384 return NULL; … … 374 410 if (mask != NULL) { 375 411 if (inRows != mask->numRows || inCols != mask->numCols) { 376 psError(__func__, 377 "The mask and image dimensions did not match (%dx%d vs %dx%d)", 378 mask->numCols, mask->numRows, in->numCols, in->numRows); 412 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageSlice", 413 PS_ERR_BAD_PARAMETER_VALUE, true, 414 PS_ERRORTEXT_psImage_IMAGE_MASK_SIZE, 415 mask->numCols,mask->numRows, 416 inCols, inRows); 379 417 psFree(out); 380 418 } 381 419 if (mask->type.type != PS_TYPE_MASK) { 382 psError(__func__, "The mask datatype (%d) must be %s.", mask->type.type, PS_TYPE_MASK_NAME); 420 char* typeStr; 421 PS_TYPE_NAME(typeStr,mask->type.type); 422 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageSlice", 423 PS_ERR_BAD_PARAMETER_TYPE, true, 424 PS_ERRORTEXT_psImage_IMAGE_MASK_TYPE, 425 typeStr, PS_TYPE_MASK_NAME); 383 426 psFree(out); 384 427 } 385 428 } 386 429 387 if (row >= inRows || col >= inCols || col + numCols > in->numCols || row + numRows > in->numRows) { 388 psError(__func__, 389 "The specified image region (%d,%d to %d,%d) is outside of image area (0,0 to %d,%d).", 390 col, row, col + numCols - 1, row + numRows - 1, in->numCols - 1, in->numRows - 1); 430 if (row >= inRows || col >= inCols || col + numCols > inCols || row + numRows > inRows) { 431 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageSlice", 432 PS_ERR_BAD_PARAMETER_VALUE, true, 433 PS_ERRORTEXT_psImage_SUBSET_RANGE_INVALID, 434 col, row, col+numCols, row+numRows, 435 inCols, inRows); 391 436 psFree(out); 392 437 return NULL; 393 438 } 439 440 if (stats == NULL) { 441 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageSlice", 442 PS_ERR_BAD_PARAMETER_NULL, true, 443 PS_ERRORTEXT_psImage_STAT_NULL); 444 psFree(out); 445 return NULL; 446 } 447 394 448 // verify that the stats struct specifies a 395 449 // single stats operation 396 if (stats == NULL || p_psGetStatValue(stats, &statVal) == false) { 397 psError(__func__, "The stat options didn't specify a single supported statistic type."); 450 if (p_psGetStatValue(stats, &statVal) == false) { 451 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageSlice", 452 PS_ERR_BAD_PARAMETER_VALUE, false, 453 PS_ERRORTEXT_psImage_BAD_STAT); 398 454 psFree(out); 399 455 return NULL; … … 410 466 psU32* outPosition = NULL; 411 467 412 // recycle output to make a proper 413 // sized/type output structure 414 // n.b. type is double as that is the 415 // type given for all stats in 468 // recycle output to make a proper sized/type output structure 469 // n.b. type is double as that is the type given for all stats is 416 470 // psStats. 417 471 out = psVectorRecycle(out, numCols, PS_TYPE_F64); … … 474 528 PSIMAGE_CUT_VERTICAL(C32); 475 529 PSIMAGE_CUT_VERTICAL(C64); 476 default: 477 psError(__func__, "Unsupported datatype (%d)", type); 478 psFree(out); 479 out = NULL; 530 default: { 531 char* typeStr; 532 PS_TYPE_NAME(typeStr,type); 533 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageSlice", 534 PS_ERR_BAD_PARAMETER_TYPE, true, 535 PS_ERRORTEXT_psImage_IMAGE_TYPE_UNSUPPORTED, 536 typeStr); 537 psFree(out); 538 out = NULL; 539 } 480 540 } 481 541 psFree(imgVec); 482 542 psFree(maskVec); 483 } else if (direction == PS_CUT_Y_POS || direction == PS_CUT_Y_NEG) { // Cut 484 // 485 // 486 // 487 // 488 // 489 // 490 // 491 // 492 // 493 // in 494 // Y 495 // direction 543 } else if (direction == PS_CUT_Y_POS || direction == PS_CUT_Y_NEG) { 544 // Cut in Y direction 496 545 psVector* imgVec = NULL; 497 546 psVector* maskVec = NULL; … … 509 558 maskVec->n = maskVec->nalloc = numCols; 510 559 } 511 // recycle output to make a proper 512 // sized/type output structure 513 // n.b. type is double as that is the 514 // type given for all stats in 560 // recycle output to make a proper sized/type output structure 561 // n.b. type is double as that is the type given for all stats in 515 562 // psStats. 516 563 out = psVectorRecycle(out, numRows, PS_TYPE_F64); … … 535 582 } 536 583 myStats = psVectorStats(myStats, imgVec, maskVec, maskVal); 537 (void)p_psGetStatValue(myStats, &statVal); // we 538 // know 539 // it 540 // works 541 // cause we tested it 542 // above 584 (void)p_psGetStatValue(myStats, &statVal); // we know it works cause we tested it above 543 585 *outData = statVal; 544 586 if (outPosition != NULL) { … … 551 593 psFree(imgVec); 552 594 psFree(maskVec); 553 } else { // don't 554 // know 555 // what 556 // the 557 // direction 558 // flag 559 // is 560 psError(__func__, "Invalid direction flag (%d)", direction); 595 } else { // don't know what the direction flag is 596 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageSlice", 597 PS_ERR_BAD_PARAMETER_VALUE, true, 598 PS_ERRORTEXT_psImage_SLICE_DIRECTION_INVALID, 599 direction); 561 600 psFree(out); 562 601 out = NULL; -
trunk/psLib/src/image/psImageFFT.c
r1625 r1840 5 5 * @author Robert DeSonia, MHPCC 6 6 * 7 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $8 * @date $Date: 2004-0 8-25 21:10:09 $7 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2004-09-21 22:30:19 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 22 22 #include "psImageExtraction.h" 23 23 24 #include "psImageErrors.h" 25 24 26 #define P_FFTW_PLAN_RIGOR FFTW_ESTIMATE 25 27 … … 42 44 43 45 if ((type != PS_TYPE_F32) && (type != PS_TYPE_C32)) { 44 psError(__func__, "Input image must be a 32-bit float or complex image (type=%d)", type); 46 char* typeStr; 47 PS_TYPE_NAME(typeStr,type); 48 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageFFT", 49 PS_ERR_BAD_PARAMETER_TYPE, true, 50 PS_ERRORTEXT_psImageFFT_IMAGE_TYPE_UNSUPPORTED, 51 typeStr); 45 52 psFree(out); 46 53 return NULL; … … 48 55 49 56 if (type != PS_TYPE_C32 && direction == PS_FFT_REVERSE) { 50 psError(__func__, "Input image must be complex image for reverse FFT (type=%d).", type); 57 char* typeStr; 58 PS_TYPE_NAME(typeStr,type); 59 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageFFT", 60 PS_ERR_BAD_PARAMETER_TYPE, true, 61 PS_ERRORTEXT_psImageFFT_REVERSE_NOT_COMPLEX, 62 typeStr); 51 63 psFree(out); 52 64 return NULL; … … 55 67 56 68 if (type != PS_TYPE_F32 && direction == PS_FFT_FORWARD) { 57 psError(__func__, "Input image must be real image for forward FFT (type=%d).", type); 69 char* typeStr; 70 PS_TYPE_NAME(typeStr,type); 71 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageFFT", 72 PS_ERR_BAD_PARAMETER_TYPE, true, 73 PS_ERRORTEXT_psImageFFT_FORWARD_NOT_REAL, 74 typeStr); 58 75 psFree(out); 59 76 return NULL; … … 69 86 numCols = in->numCols; 70 87 88 // n.b. FFTW can perform a in-place transform at the same or faster than out-of-place. 71 89 out = psImageCopy(out, in, PS_TYPE_C32); 72 73 90 plan = fftwf_plan_dft_2d(numCols, numRows, 74 91 (fftwf_complex *) out->data.C32[0], 75 92 (fftwf_complex *) out->data.C32[0], direction, P_FFTW_PLAN_RIGOR); 76 93 77 /* check if a plan exists now */94 /* check if a plan exists now -- if not, it is a real problem */ 78 95 if (plan == NULL) { 79 psError(__func__, "Failed to create FFTW plan."); 96 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageFFT", 97 PS_ERR_BAD_PARAMETER_TYPE, true, 98 PS_ERRORTEXT_psImageFFT_FFTW_PLAN_NULL); 80 99 psFree(out); 81 100 return NULL; … … 106 125 numRows = in->numRows; 107 126 108 /* if not a complex number, this is logically just a copy */ 109 if (!PS_IS_PSELEMTYPE_COMPLEX(type)) { 110 // Warn user, as this is probably not expected 111 psLogMsg(__func__, PS_LOG_WARN, "Real portion of a non-Complex type called called for. " 112 "Just an image copy was performed."); 127 /* if not a complex number, this is logically just a copy then */ 128 if (!PS_IS_PSELEMTYPE_COMPLEX(type) && type != PS_TYPE_PTR) { 113 129 return psImageCopy(out, in, type); 114 130 } … … 141 157 } 142 158 } else { 143 psError(__func__, "Can not extract real component from given image type (%d).", type); 159 char* typeStr; 160 PS_TYPE_NAME(typeStr,type); 161 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageReal", 162 PS_ERR_BAD_PARAMETER_TYPE, true, 163 PS_ERRORTEXT_psImage_IMAGE_TYPE_UNSUPPORTED, 164 typeStr); 165 144 166 psFree(out); 145 167 return NULL; … … 164 186 numRows = in->numRows; 165 187 166 /* if not a complex number, this is logically just zeroed image of same size */ 167 if (!PS_IS_PSELEMTYPE_COMPLEX(type)) { 168 // Warn user, as this is probably not expected 169 psLogMsg(__func__, PS_LOG_WARN, "Imaginary portion of a non-Complex type called for. " 170 "A zero image was returned."); 188 /* if not a complex image type, this is logically just zeroed image of same size */ 189 if (!PS_IS_PSELEMTYPE_COMPLEX(type) && type != PS_TYPE_PTR) { 171 190 out = psImageRecycle(out, numCols, numRows, type); 172 191 memset(out->data.V[0], 0, PSELEMTYPE_SIZEOF(type) * numCols * numRows); … … 201 220 } 202 221 } else { 203 psError(__func__, "Can not extract imaginary component from given image type (%d).", type); 222 char* typeStr; 223 PS_TYPE_NAME(typeStr,type); 224 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageImaginary", 225 PS_ERR_BAD_PARAMETER_TYPE, true, 226 PS_ERRORTEXT_psImage_IMAGE_TYPE_UNSUPPORTED, 227 typeStr); 204 228 psFree(out); 205 229 return NULL; … … 225 249 226 250 if (imag->type.type != type) { 227 psError(__func__, "The inputs to psImageComplex must be the same type."); 251 char* typeStrReal; 252 char* typeStrImag; 253 PS_TYPE_NAME(typeStrReal,type); 254 PS_TYPE_NAME(typeStrImag,imag->type.type); 255 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageComplex", 256 PS_ERR_BAD_PARAMETER_TYPE, true, 257 PS_ERRORTEXT_psImageFFT_REAL_IMAG_TYPE_MISMATCH, 258 typeStrReal,typeStrImag); 228 259 psFree(out); 229 260 return NULL; … … 231 262 232 263 if (imag->numCols != numCols || imag->numRows != numRows) { 233 psError(__func__, "The inputs to psImageComplex must be the same dimensions."); 234 psFree(out); 235 return NULL; 236 } 237 238 if (PS_IS_PSELEMTYPE_COMPLEX(type)) { 239 psError(__func__, "The inputs to psImageComplex can not be complex."); 240 psFree(out); 241 return NULL; 242 } 243 244 if (type != PS_TYPE_F32 && type != PS_TYPE_F64) { 245 psError(__func__, "The input type to psImageComplex must be a floating point."); 264 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageComplex", 265 PS_ERR_BAD_PARAMETER_VALUE, true, 266 PS_ERRORTEXT_psImageFFT_REAL_IMAG_SIZE_MISMATCH, 267 numCols, numRows, imag->numCols, imag->numRows); 246 268 psFree(out); 247 269 return NULL; … … 280 302 } 281 303 } else { 282 psError(__func__, "Can not merge real and imaginary portions for given image type (%d).", type); 283 psFree(out); 284 return NULL; 285 } 304 char* typeStr; 305 PS_TYPE_NAME(typeStr,type); 306 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageComplex", 307 PS_ERR_BAD_PARAMETER_TYPE, true, 308 PS_ERRORTEXT_psImageFFT_NONREAL_NOTSUPPORTED, 309 typeStr); 310 psFree(out); 311 return NULL; 312 } 313 286 314 287 315 return out; … … 303 331 numRows = in->numRows; 304 332 305 /* if not a complex number, this is logically just a image copy */ 306 if (!PS_IS_PSELEMTYPE_COMPLEX(type)) { 307 // Warn user, as this is probably not expected 308 psLogMsg(__func__, PS_LOG_WARN, "Complex Conjugate of a non-Complex type called for. " 309 "Image copy was performed instead."); 333 /* if not a complex image, this is logically just a image copy */ 334 if (!PS_IS_PSELEMTYPE_COMPLEX(type) && type != PS_TYPE_PTR) { 310 335 return psImageCopy(out, in, type); 311 336 } … … 338 363 } 339 364 } else { 340 psError(__func__, "Can not compute complex conjugate for given image type (%d).", type); 365 char* typeStr; 366 PS_TYPE_NAME(typeStr,type); 367 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageConjugate", 368 PS_ERR_BAD_PARAMETER_TYPE, true, 369 PS_ERRORTEXT_psImageFFT_NONCOMPLEX_NOTSUPPORTED, 370 typeStr); 341 371 psFree(out); 342 372 return NULL; … … 362 392 numRows = in->numRows; 363 393 numElementsSquared = numCols * numCols * numRows * numRows; 364 365 /* if not a complex number, this is not implemented */366 if (!PS_IS_PSELEMTYPE_COMPLEX(type)) {367 psError(__func__, "Power Spectrum for non-complex inputs is not implemented.");368 psFree(out);369 return NULL;370 }371 394 372 395 if (type == PS_TYPE_C32) { … … 405 428 } 406 429 } else { 407 psError(__func__, "Can not power spectrum for given image type (%d).", type); 408 psFree(out); 409 return NULL; 410 } 411 412 return out; 413 414 } 430 char* typeStr; 431 PS_TYPE_NAME(typeStr,type); 432 psErrorMsg(PS_ERRORNAME_DOMAIN "psImagePowerSpectrum", 433 PS_ERR_BAD_PARAMETER_TYPE, true, 434 PS_ERRORTEXT_psImageFFT_NONCOMPLEX_NOTSUPPORTED, 435 typeStr); 436 psFree(out); 437 return NULL; 438 } 439 440 return out; 441 442 } -
trunk/psLib/src/image/psImageIO.c
r1440 r1840 1 2 1 /** @file psImageIO.c 3 2 * … … 8 7 * @author Robert DeSonia, MHPCC 9 8 * 10 * @version $Revision: 1.1 0$ $Name: not supported by cvs2svn $11 * @date $Date: 2004-0 8-09 23:34:58$9 * @version $Revision: 1.11 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2004-09-21 22:30:19 $ 12 11 * 13 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 22 21 #include "psMemory.h" 23 22 23 #include "psImageErrors.h" 24 24 25 psImage* psImageReadSection(psImage* output, 25 26 int col, 26 27 int row, 27 int numCols, int numRows, int z, char *extname, int extnum, char *filename) 28 int numCols, 29 int numRows, 30 int z, 31 char *extname, 32 int extnum, 33 char *filename) 28 34 { 29 35 fitsfile *fptr = NULL; /* Pointer to the FITS file */ … … 42 48 43 49 if (filename == NULL) { 44 psError(__func__, "Must specify filename; it can not be NULL."); 50 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageReadSection", 51 PS_ERR_BAD_PARAMETER_NULL, true, 52 PS_ERRORTEXT_psImageIO_FILENAME_NULL); 45 53 psFree(output); 46 54 return NULL; … … 51 59 if (fptr == NULL || status != 0) { 52 60 fits_get_errstatus(status, fitsErr); 53 psError(__func__, "Could not open file '%s'. (%s)", filename, fitsErr); 61 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageReadSection", 62 PS_ERR_BAD_PARAMETER_VALUE, true, 63 PS_ERRORTEXT_psImageIO_FILENAME_INVALID, 64 filename, fitsErr); 54 65 psFree(output); 55 66 return NULL; … … 62 73 status = 0; 63 74 (void)fits_close_file(fptr, &status); 64 psError(__func__, "Could not index to '%s' HDU for file %s. (%s)", extname, filename, fitsErr); 75 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageReadSection", 76 PS_ERR_LOCATION_INVALID, true, 77 PS_ERRORTEXT_psImageIO_EXTNAME_INVALID, 78 extname, filename, fitsErr); 65 79 psFree(output); 66 80 return NULL; … … 71 85 status = 0; 72 86 (void)fits_close_file(fptr, &status); 73 psError(__func__, "Could not index to HDU #%d for file %s. (%s)", extnum, filename, fitsErr); 87 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageReadSection", 88 PS_ERR_LOCATION_INVALID, true, 89 PS_ERRORTEXT_psImageIO_EXTNUM_INVALID, 90 extnum, filename, fitsErr); 74 91 psFree(output); 75 92 return NULL; … … 82 99 status = 0; 83 100 (void)fits_close_file(fptr, &status); 84 psError("Could not determine image data type of '%s'. (%s)", filename, fitsErr); 101 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageReadSection", 102 PS_ERR_IO, true, 103 PS_ERRORTEXT_psImageIO_DATATYPE_UNKNOWN, 104 filename, fitsErr); 85 105 psFree(output); 86 106 return NULL; … … 92 112 status = 0; 93 113 (void)fits_close_file(fptr, &status); 94 psError("Could not determine dimensions of '%s'. (%s)", filename, fitsErr); 114 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageReadSection", 115 PS_ERR_IO, true, 116 PS_ERRORTEXT_psImageIO_IMAGE_DIM_UNKNOWN, 117 filename, fitsErr); 95 118 psFree(output); 96 119 return NULL; … … 101 124 status = 0; 102 125 (void)fits_close_file(fptr, &status); 103 psError("Dimensions of '%s' are not supported (NAXIS=%i).", filename, nAxis); 126 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageReadSection", 127 PS_ERR_IO, true, 128 PS_ERRORTEXT_psImageIO_IMAGE_DIMENSION_UNSUPPORTED, 129 nAxis); 104 130 psFree(output); 105 131 return NULL; … … 111 137 status = 0; 112 138 (void)fits_close_file(fptr, &status); 113 psError("Could not determine image size of '%s'. (%s)", filename, fitsErr); 139 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageReadSection", 140 PS_ERR_IO, true, 141 PS_ERRORTEXT_psImageIO_IMAGE_SIZE_UNKNOWN, 142 filename, fitsErr); 114 143 psFree(output); 115 144 return NULL; … … 134 163 increment[1] = 1; 135 164 increment[2] = 1; 136 137 // turn off the BSCALE/BZERO processing in138 // CFITSIO139 // (void)fits_set_bscale(fptr,140 // 1.0,0.0,&status);141 165 142 166 switch (bitPix) { … … 178 202 break; 179 203 default: 180 psError(__func__, "Unsupported bitpix value (%d) in FITS file %s.", bitPix, filename); 204 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageReadSection", 205 PS_ERR_IO, true, 206 PS_ERRORTEXT_psImageIO_FITS_TYPE_UNSUPPORTED, 207 bitPix, filename); 181 208 psFree(output); 182 209 return NULL; 183 210 } 184 211 output = psImageRecycle(output, numCols, numRows, datatype); 185 if (fits_read_subset 186 (fptr, fitsDatatype, firstPixel, 187 lastPixel, increment, NULL, output->data.V[0], &anynull, &status) != 0) { 212 if (fits_read_subset(fptr, fitsDatatype, firstPixel, lastPixel, increment, 213 NULL, output->data.V[0], &anynull, &status) != 0) { 188 214 psFree(output); 189 215 (void)fits_get_errstatus(status, fitsErr); 190 216 status = 0; 191 217 (void)fits_close_file(fptr, &status); 192 psError(__func__, "Failed to read image [%s]", filename, fitsErr); 218 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageReadSection", 219 PS_ERR_IO, true, 220 PS_ERRORTEXT_psImageIO_READ_FAILED, 221 filename, fitsErr); 193 222 return NULL; 194 223 } … … 199 228 } 200 229 201 bool psImageWriteSection(psImage* input, int col0, int row0, int z, char *extname, int extnum, 230 bool psImageWriteSection(psImage* input, 231 int col0, 232 int row0, 233 int z, 234 char *extname, 235 int extnum, 202 236 char *filename) 203 237 { … … 220 254 /* need a valid image to write */ 221 255 if (input == NULL) { 222 psError(__func__, "Can not write %s. Input psImage is NULL.", filename); 256 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageWriteSection", 257 PS_ERR_BAD_PARAMETER_NULL, true, 258 PS_ERRORTEXT_psImage_IMAGE_NULL); 223 259 return false; 224 260 } … … 263 299 datatype = TDOUBLE; 264 300 break; 265 default: 266 psError(__func__, 267 "psImage datatype (%d) not supported. File %s not written.", input->type.type, filename); 268 return false; 301 default: { 302 char* typeStr; 303 PS_TYPE_NAME(typeStr,input->type.type); 304 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageWriteSection", 305 PS_ERR_BAD_PARAMETER_TYPE, true, 306 PS_ERRORTEXT_psImageIO_TYPE_UNSUPPORTED, 307 typeStr); 308 return false; 309 } 269 310 } 270 311 … … 275 316 if (fptr == NULL || status != 0) { 276 317 fits_get_errstatus(status, fitsErr); 277 psError(__func__, "Could not open file '%s'. FITS error:%s", filename, fitsErr); 318 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageWriteSection", 319 PS_ERR_BAD_PARAMETER_VALUE, true, 320 PS_ERRORTEXT_psImageIO_FILENAME_INVALID, 321 filename, fitsErr); 278 322 return false; 279 323 } … … 285 329 status = 0; 286 330 (void)fits_close_file(fptr, &status); 287 psError(__func__, 288 "Could not index to '%s' HDU for file %s. (%s)", extname, filename, fitsErr); 331 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageWriteSection", 332 PS_ERR_LOCATION_INVALID, true, 333 PS_ERRORTEXT_psImageIO_EXTNAME_INVALID, 334 extname, filename, fitsErr); 289 335 return false; 290 336 } … … 296 342 status = 0; 297 343 (void)fits_close_file(fptr, &status); 298 psError(__func__, 299 "extnum (%d) must not exceed number of HDUs (%d) by more than one.", extnum, numHDUs); 344 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageWriteSection", 345 PS_ERR_LOCATION_INVALID, true, 346 PS_ERRORTEXT_psImageIO_WRITE_EXTNUM_INVALID, 347 extnum, numHDUs); 300 348 return false; 301 349 } else if (numHDUs == extnum) { … … 305 353 status = 0; 306 354 (void)fits_close_file(fptr, &status); 307 psError(__func__, "Could not index to HDU #%d for file %s. (%s)", extnum, filename, fitsErr); 355 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageWriteSection", 356 PS_ERR_LOCATION_INVALID, true, 357 PS_ERRORTEXT_psImageIO_EXTNUM_INVALID, 358 extnum, filename, fitsErr); 308 359 return false; 309 360 } … … 318 369 if (fptr == NULL || status != 0) { 319 370 fits_get_errstatus(status, fitsErr); 320 psError(__func__, "Could not create file '%s'. (%s)", filename, fitsErr); 371 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageWriteSection", 372 PS_ERR_IO, true, 373 PS_ERRORTEXT_psImageIO_FILENAME_CREATE_FAILED, 374 filename, fitsErr); 321 375 return false; 322 376 } … … 333 387 status = 0; 334 388 (void)fits_close_file(fptr, &status); 335 psError(__func__, "Could not create image HDU in FITS file '%s'. %s", filename, fitsErr); 389 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageWriteSection", 390 PS_ERR_IO, true, 391 PS_ERRORTEXT_psImageIO_CREATE_HDU_FAILED, 392 filename, fitsErr); 336 393 return false; 337 394 } … … 347 404 status = 0; 348 405 (void)fits_close_file(fptr, &status); 349 psError(__func__, 350 "Could not create EXTNAME keyword in FITS file '%s'. (%s)", filename, fitsErr); 406 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageWriteSection", 407 PS_ERR_IO, true, 408 PS_ERRORTEXT_psImageIO_CREATE_EXTENSION_FAILED, 409 filename, fitsErr); 351 410 return false; 352 411 } … … 366 425 status = 0; 367 426 (void)fits_close_file(fptr, &status); 368 psError(__func__, "Could not write image data to '%s'. (%s)", filename, fitsErr); 427 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageWriteSection", 428 PS_ERR_IO, true, 429 PS_ERRORTEXT_psImageIO_WRITE_FAILED, 430 filename, fitsErr); 369 431 return false; 370 432 } -
trunk/psLib/src/image/psImageManip.c
r1827 r1840 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1.2 0$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-09- 17 23:57:41$12 * @version $Revision: 1.21 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-09-21 22:30:19 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 26 26 #include "psMemory.h" 27 27 #include "psImageExtraction.h" 28 29 #include "psImageErrors.h" 28 30 29 31 int psImageClip(psImage* input, … … 42 44 43 45 if (max < min) { 44 psError(__func__, "psImageClip can not be invoked with max < min."); 46 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageClip", 47 PS_ERR_BAD_PARAMETER_VALUE, true, 48 PS_ERRORTEXT_psImageManip_MAXMIN, 49 (double)min,(double)max); 45 50 return 0; 46 51 } … … 51 56 switch (input->type.type) { 52 57 53 #define psImageClipCase(type ,typename) \58 #define psImageClipCase(type) \ 54 59 case PS_TYPE_##type: { \ 55 60 if (vmin < PS_MIN_##type || vmin > PS_MAX_##type) { \ 56 psError(__func__, "Specified vmin (%g) is outside of image's " \ 57 typename " pixel range (%g to %g)", \ 58 vmin,(psF64)PS_MIN_##type,(psF64)PS_MAX_##type); \ 61 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageClip", \ 62 PS_ERR_BAD_PARAMETER_VALUE, true, \ 63 PS_ERRORTEXT_psImage_PARAMETER_OUTOF_TYPERANGE, \ 64 "vmin",vmin, PS_TYPE_##type##_NAME, \ 65 (psF64)PS_MIN_##type,(psF64)PS_MAX_##type); \ 59 66 } \ 60 67 if (vmax > PS_MAX_##type || vmax < PS_MIN_##type) { \ 61 psError(__func__, "Specified vmax (%g) is outside of image's " \ 62 typename " pixel range (%g to %g)", \ 63 vmax,(psF64)PS_MIN_##type,(psF64)PS_MAX_##type); \ 68 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageClip", \ 69 PS_ERR_BAD_PARAMETER_VALUE, true, \ 70 PS_ERRORTEXT_psImage_PARAMETER_OUTOF_TYPERANGE, \ 71 "vmax",vmax, PS_TYPE_##type##_NAME, \ 72 (psF64)PS_MIN_##type,(psF64)PS_MAX_##type); \ 64 73 } \ 65 74 for (unsigned int row = 0;row<numRows;row++) { \ … … 78 87 break; 79 88 80 #define psImageClipCaseComplex(type, typename,absfcn)\89 #define psImageClipCaseComplex(type,absfcn)\ 81 90 case PS_TYPE_##type: { \ 82 91 if (vmin < PS_MIN_##type || vmin > PS_MAX_##type) { \ 83 psError(__func__, "Specified vmin (%g) is outside of image's " \ 84 typename " pixel range", \ 85 vmin); \ 92 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageClip", \ 93 PS_ERR_BAD_PARAMETER_VALUE, true, \ 94 PS_ERRORTEXT_psImage_PARAMETER_OUTOF_TYPERANGE, \ 95 "vmin",vmin, PS_TYPE_##type##_NAME, \ 96 (psF64)PS_MIN_##type,(psF64)PS_MAX_##type); \ 86 97 } \ 87 98 if (vmax > PS_MAX_##type || vmax < PS_MIN_##type) { \ 88 psError(__func__, "Specified vmax (%g) is outside of image's " \ 89 typename " pixel range", \ 90 vmax); \ 99 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageClip", \ 100 PS_ERR_BAD_PARAMETER_VALUE, true, \ 101 PS_ERRORTEXT_psImage_PARAMETER_OUTOF_TYPERANGE, \ 102 "vmax",vmax, PS_TYPE_##type##_NAME, \ 103 (psF64)PS_MIN_##type,(psF64)PS_MAX_##type); \ 91 104 } \ 92 105 for (unsigned int row = 0;row<numRows;row++) { \ … … 105 118 break; 106 119 107 psImageClipCase(S8, "psS8") 108 psImageClipCase(S16, "psS16") 109 psImageClipCase(S32, "psS32") 110 psImageClipCase(S64, "psS64") 111 psImageClipCase(U8, "psU8") 112 psImageClipCase(U16, "psU16") 113 psImageClipCase(U32, "psU32") 114 psImageClipCase(U64, "psU64") 115 psImageClipCase(F32, "psF32") 116 psImageClipCase(F64, "psF64") 117 psImageClipCaseComplex(C32, "psC32", cabsf) 118 psImageClipCaseComplex(C64, "psC64", cabs) 119 120 default: 121 psError(__func__, "psImageClip does not support the given datatype (%d)", input->type.type); 120 psImageClipCase(S8) 121 psImageClipCase(S16) 122 psImageClipCase(S32) 123 psImageClipCase(S64) 124 psImageClipCase(U8) 125 psImageClipCase(U16) 126 psImageClipCase(U32) 127 psImageClipCase(U64) 128 psImageClipCase(F32) 129 psImageClipCase(F64) 130 psImageClipCaseComplex(C32, cabsf) 131 psImageClipCaseComplex(C64, cabs) 132 133 default: { 134 char* typeStr; 135 PS_TYPE_NAME(typeStr,input->type.type); 136 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageClip", 137 PS_ERR_BAD_PARAMETER_TYPE, true, 138 PS_ERRORTEXT_psImage_IMAGE_TYPE_UNSUPPORTED, 139 typeStr); 140 } 122 141 } 123 142 … … 158 177 psImageClipNaNCase(C64) 159 178 160 default: 161 psError(__func__, "psImageClip does not support the given datatype (%d)", input->type.type); 179 default: { 180 char* typeStr; 181 PS_TYPE_NAME(typeStr,input->type.type); 182 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageClipNaN", 183 PS_ERR_BAD_PARAMETER_TYPE, true, 184 PS_ERRORTEXT_psImage_IMAGE_TYPE_UNSUPPORTED, 185 typeStr); 186 } 162 187 } 163 188 … … 180 205 181 206 if (image == NULL || overlay == NULL) { 182 psError(__func__, "one of the input images was NULL."); 207 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageOverlaySection", 208 PS_ERR_BAD_PARAMETER_NULL, true, 209 PS_ERRORTEXT_psImage_IMAGE_NULL); 183 210 return 1; 184 211 } 185 212 186 213 if (op == NULL) { 187 psError(__func__, "Operation can not be NULL."); 214 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageOverlaySection", 215 PS_ERR_BAD_PARAMETER_NULL, true, 216 PS_ERRORTEXT_psImageManip_OPERATION_NULL); 188 217 return 1; 189 218 } … … 192 221 193 222 if (type != overlay->type.type) { 194 psError(__func__, "Image and overlay datatypes must match. (%d vs %d)", type, overlay->type.type); 223 char* typeStr; 224 char* typeStrOverlay; 225 PS_TYPE_NAME(typeStr,type); 226 PS_TYPE_NAME(typeStrOverlay,overlay->type.type); 227 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageOverlaySection", 228 PS_ERR_BAD_PARAMETER_TYPE, true, 229 PS_ERRORTEXT_psImageManip_OVERLAY_TYPE_MISMATCH, 230 typeStrOverlay, typeStr); 195 231 return 2; 196 232 } … … 200 236 overlayNumRows = overlay->numRows; 201 237 overlayNumCols = overlay->numCols; 202 203 /* check row0/col0 to see if it is within the image size */204 if (row0 < 0 || col0 < 0 || row0 >= imageNumRows || col0 >= imageNumCols) {205 psError(__func__,206 "Overlay origin of (%d,%d) is outside of the image dimensions (%d x %d).",207 col0, row0, imageNumCols, imageNumRows);208 return 3;209 }210 211 /* check if overlay is totally withing input image */212 238 imageRowLimit = row0 + overlayNumRows; 213 239 imageColLimit = col0 + overlayNumCols; 214 if (imageRowLimit > imageNumRows || imageColLimit > imageNumCols) { 215 psError(__func__, 216 "Overlay image (%d,%d -> %d,%d) is partially outside" 217 " of the input image (%d x %d).", 218 col0, row0, col0 + overlayNumCols - 1, row0 + overlayNumRows - 1, imageNumCols, imageNumRows); 219 return 4; 240 241 /* check to see if overlay is within the input image */ 242 if ( row0 < 0 || 243 col0 < 0 || 244 imageRowLimit > imageNumRows || 245 imageColLimit > imageNumCols) { 246 247 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageOverlaySection", 248 PS_ERR_BAD_PARAMETER_VALUE, true, 249 PS_ERRORTEXT_psImage_SUBSET_RANGE_INVALID, 250 col0, imageColLimit, row0, imageRowLimit, 251 imageNumCols, imageNumRows); 252 return 3; 220 253 } 221 254 … … 245 278 break; \ 246 279 default: \ 247 psError(__func__,"Unknown operation %s",op); \ 280 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageOverlaySection", \ 281 PS_ERR_BAD_PARAMETER_VALUE, true, \ 282 PS_ERRORTEXT_psImageManip_OVERLAY_OPERATOR_INVALID, \ 283 op); \ 248 284 return 5; \ 249 285 } \ … … 265 301 psImageOverlayCase(C64); 266 302 267 default: 268 psError(__func__, "Can not operate on type %d.", type); 303 default: { 304 char* typeStr; 305 PS_TYPE_NAME(typeStr,type); 306 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageOverlaySection", 307 PS_ERR_BAD_PARAMETER_TYPE, true, 308 PS_ERRORTEXT_psImage_IMAGE_TYPE_UNSUPPORTED, 309 typeStr); 310 } 269 311 } 270 312 … … 287 329 288 330 if (input == NULL) { 289 psError(__func__, "Can not perform clip on NULL image"); 331 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageClipComplexRegion", 332 PS_ERR_BAD_PARAMETER_NULL, true, 333 PS_ERRORTEXT_psImage_IMAGE_NULL); 290 334 return 0; 291 335 } 292 336 293 337 if (realMax < realMin) { 294 psError(__func__, 295 "psImageClipComplexRegion can not be invoked with " "max < min in the real image space."); 338 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageClipComplexRegion", 339 PS_ERR_BAD_PARAMETER_VALUE, true, 340 PS_ERRORTEXT_psImageManip_MAXMIN_REAL, 341 (double)realMin, (double)realMax); 296 342 return 0; 297 343 } 298 344 if (imagMax < imagMin) { 299 psError(__func__, 300 "psImageClipComplexRegion can not be invoked with " 301 "max < min in the imaginary image space."); 345 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageClipComplexRegion", 346 PS_ERR_BAD_PARAMETER_VALUE, true, 347 PS_ERRORTEXT_psImageManip_MAXMIN_IMAG, 348 (double)imagMin, (double)imagMax); 302 349 return 0; 303 350 } … … 306 353 numCols = input->numCols; 307 354 308 #define psImageClipComplexRegionCase(type, typename,realfcn,imagfcn) \355 #define psImageClipComplexRegionCase(type,realfcn,imagfcn) \ 309 356 case PS_TYPE_##type: { \ 310 357 if (realfcn(vmin) < PS_MIN_##type || imagfcn(vmin) < PS_MIN_##type || \ 311 358 realfcn(vmin) > PS_MAX_##type || imagfcn(vmin) > PS_MAX_##type ) { \ 312 psError(__func__, "Specified vmin (%g%+gi) is outside of image's " \ 313 typename " pixel range", \ 314 creal(vmin),cimag(vmin)); \ 359 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageClipComplexRegion", \ 360 PS_ERR_BAD_PARAMETER_VALUE, true, \ 361 PS_ERRORTEXT_psImageManip_CLIP_VALUE_INVALID, \ 362 "vmin", creal(vmin), cimag(vmin), \ 363 PS_TYPE_##type##_NAME, PS_MIN_##type, PS_MAX_##type); \ 315 364 break; \ 316 365 } \ 317 366 if (realfcn(vmax) > PS_MAX_##type || imagfcn(vmax) > PS_MAX_##type || \ 318 367 realfcn(vmax) < PS_MIN_##type || imagfcn(vmax) < PS_MIN_##type ) { \ 319 psError(__func__, "Specified vmax (%g%+gi) is outside of image's " \ 320 typename " pixel range", \ 321 creal(vmax),cimag(vmax)); \ 368 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageClipComplexRegion", \ 369 PS_ERR_BAD_PARAMETER_VALUE, true, \ 370 PS_ERRORTEXT_psImageManip_CLIP_VALUE_INVALID, \ 371 "vmax", creal(vmax), cimag(vmax), \ 372 PS_TYPE_##type##_NAME, PS_MIN_##type, PS_MAX_##type); \ 322 373 break; \ 323 374 } \ … … 339 390 switch (input->type.type) { 340 391 341 psImageClipComplexRegionCase(C32, "psC32", crealf, cimagf) 342 psImageClipComplexRegionCase(C64, "psC64", creal, cimag) 343 344 default: 345 psError(__func__, "psImageClip does not support the given datatype (%d)", input->type.type); 392 psImageClipComplexRegionCase(C32, crealf, cimagf) 393 psImageClipComplexRegionCase(C64, creal, cimag) 394 395 default: { 396 char* typeStr; 397 PS_TYPE_NAME(typeStr,input->type.type); 398 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageClipComplexRegion", 399 PS_ERR_BAD_PARAMETER_TYPE, true, 400 PS_ERRORTEXT_psImage_IMAGE_TYPE_UNSUPPORTED, 401 typeStr); 402 } 346 403 } 347 404 … … 367 424 368 425 if (in == NULL) { 369 psError(__func__, "Input image is NULL."); 426 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageRebin", 427 PS_ERR_BAD_PARAMETER_NULL, true, 428 PS_ERRORTEXT_psImage_IMAGE_NULL); 370 429 psFree(out); 371 430 return NULL; … … 373 432 374 433 if (scale < 1) { 375 psError(__func__, "The scale must be positive."); 434 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageRebin", 435 PS_ERR_BAD_PARAMETER_VALUE, true, 436 PS_ERRORTEXT_psImageManip_SCALE_NOT_POSITIVE, 437 scale); 376 438 psFree(out); 377 439 return NULL; … … 379 441 380 442 if (stats == NULL) { 381 psError(__func__, "The stats input can not be NULL."); 443 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageRebin", 444 PS_ERR_BAD_PARAMETER_NULL, true, 445 PS_ERRORTEXT_psImage_STAT_NULL); 382 446 psFree(out); 383 447 return NULL; … … 385 449 386 450 if (p_psGetStatValue(stats, &statVal) == false) { 387 psError(__func__, "The stat options didn't specify a single supported statistic type."); 451 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageRebin", 452 PS_ERR_BAD_PARAMETER_VALUE, true, 453 PS_ERRORTEXT_psImage_BAD_STAT, 454 stats->options); 388 455 psFree(out); 389 456 return NULL; … … 394 461 if (mask != NULL) { 395 462 if (mask->type.type != PS_TYPE_MASK) { 396 psError(__func__, "The mask datatype must be %s (%d).", 397 PS_TYPE_MASK_NAME, 398 mask->type.type); 463 char* typeStr; 464 PS_TYPE_NAME(typeStr,mask->type.type); 465 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageRebin", 466 PS_ERR_BAD_PARAMETER_TYPE, true, 467 PS_ERRORTEXT_psImage_IMAGE_MASK_TYPE, 468 typeStr, PS_TYPE_MASK_NAME); 399 469 psFree(out); 400 470 psFree(vec); … … 462 532 PS_IMAGE_REBIN_CASE(C32); 463 533 PS_IMAGE_REBIN_CASE(C64); 464 default: 465 psError(__func__, "Input image type not supported."); 466 psFree(out); 467 out = NULL; 534 535 default: { 536 char* typeStr; 537 PS_TYPE_NAME(typeStr,in->type.type); 538 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageRebin", 539 PS_ERR_BAD_PARAMETER_TYPE, true, 540 PS_ERRORTEXT_psImage_IMAGE_TYPE_UNSUPPORTED, 541 typeStr); 542 psFree(out); 543 out = NULL; 544 } 468 545 } 469 546 … … 484 561 485 562 if (in == NULL) { 486 psError(__func__, "Input image can not be NULL."); 563 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageResample", 564 PS_ERR_BAD_PARAMETER_NULL, true, 565 PS_ERRORTEXT_psImage_IMAGE_NULL); 487 566 psFree(out); 488 567 return NULL; … … 520 599 PSIMAGE_RESAMPLE_CASE(C32) 521 600 PSIMAGE_RESAMPLE_CASE(C64) 522 default: 523 psError(__func__, "Unsupported type (%d)", in->type.type); 524 psFree(out); 525 return NULL; 601 default: { 602 char* typeStr; 603 PS_TYPE_NAME(typeStr,in->type.type); 604 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageResample", 605 PS_ERR_BAD_PARAMETER_TYPE, true, 606 PS_ERRORTEXT_psImage_IMAGE_TYPE_UNSUPPORTED, 607 typeStr); 608 psFree(out); 609 out = NULL; 610 } 526 611 } 527 612 … … 539 624 540 625 if (in == NULL) { 541 psError(__func__, "Input image can not be NULL."); 626 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageRoll", 627 PS_ERR_BAD_PARAMETER_NULL, true, 628 PS_ERRORTEXT_psImage_IMAGE_NULL); 542 629 psFree(out); 543 630 return NULL; … … 570 657 inRowNumber -= outRows; 571 658 } 572 psU8* inRow = in->data.U8[inRowNumber]; // to 573 574 // allow 575 576 // byte 577 // arithmetic, 578 579 // but for all types 659 psU8* inRow = in->data.U8[inRowNumber]; // use byte arithmetic for all types 580 660 psU8* outRow = out->data.U8[row]; 581 661 … … 594 674 { 595 675 if (in == NULL) { 596 psError(__func__, "The input image was NULL."); 676 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageRotate", 677 PS_ERR_BAD_PARAMETER_NULL, true, 678 PS_ERRORTEXT_psImage_IMAGE_NULL); 597 679 psFree(out); 598 680 return NULL; … … 635 717 PSIMAGE_ROTATE_LEFT_90(C32); 636 718 PSIMAGE_ROTATE_LEFT_90(C64); 637 default: 638 psError(__func__, "Unsupported type (%d)", type); 639 psFree(out); 640 return NULL; 719 default: { 720 char* typeStr; 721 PS_TYPE_NAME(typeStr,type); 722 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageRotate", 723 PS_ERR_BAD_PARAMETER_TYPE, true, 724 PS_ERRORTEXT_psImage_IMAGE_TYPE_UNSUPPORTED, 725 typeStr); 726 psFree(out); 727 return NULL; 728 } 641 729 } 642 730 } else if (fabsf(angle - 180.0f) < FLT_EPSILON) { … … 675 763 PSIMAGE_ROTATE_180_CASE(C32); 676 764 PSIMAGE_ROTATE_180_CASE(C64); 677 default: 678 psError(__func__, "Unsupported type (%d)", type); 679 psFree(out); 680 return NULL; 765 766 default: { 767 char* typeStr; 768 PS_TYPE_NAME(typeStr,type); 769 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageRotate", 770 PS_ERR_BAD_PARAMETER_TYPE, true, 771 PS_ERRORTEXT_psImage_IMAGE_TYPE_UNSUPPORTED, 772 typeStr); 773 psFree(out); 774 return NULL; 775 } 681 776 } 682 777 } else if (fabsf(angle - 270.0f) < FLT_EPSILON) { … … 714 809 PSIMAGE_ROTATE_RIGHT_90(C32); 715 810 PSIMAGE_ROTATE_RIGHT_90(C64); 716 default: 717 psError(__func__, "Unsupported type (%d)", type); 718 psFree(out); 719 return NULL; 811 812 default: { 813 char* typeStr; 814 PS_TYPE_NAME(typeStr,type); 815 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageRotate", 816 PS_ERR_BAD_PARAMETER_TYPE, true, 817 PS_ERRORTEXT_psImage_IMAGE_TYPE_UNSUPPORTED, 818 typeStr); 819 psFree(out); 820 return NULL; 821 } 720 822 } 721 823 } else if (fabsf(angle) < FLT_EPSILON) { … … 731 833 double sinT = sinf(t); 732 834 733 // calculate the corners of the rotated 734 // image so we know the proper 735 // output image size. 736 // x' = x cos(t) + y sin(t); i.e, x' = 737 // (x-centerX)*cosT + 738 // (y-centerY)*sinT; 739 // y' = y cos(t) - x sin(t); i.e. y' = 740 // (y-centerY)*cosT - 741 // (x-centerX)*sinT; 835 // calculate the corners of the rotated image so we know the proper output image size. 836 // x' = x cos(t) + y sin(t); i.e, x' = (x-centerX)*cosT + (y-centerY)*sinT; 837 // y' = y cos(t) - x sin(t); i.e. y' = (y-centerY)*cosT - (x-centerX)*sinT; 742 838 743 839 int outCols = ceil(abs(numCols * cosT) + abs(numRows * sinT)) + 1; … … 748 844 out = psImageRecycle(out, outCols, outRows, type); 749 845 750 /* optimized public domain rotation routine by Karl Lager float cosT,sinT; cosT = cos(t); sinT = 751 * sin(t); for (y = min_y; y <= max_y; y++) { x' = min_x * cosT + y * sinT + x1'; y' = y * cosT - 752 * min_x * sinT + y1'; for (x = min_x; x <= max_x; x++) { if (x', y') * * * * * * * * is in the 753 * bounds of the bitmap, get pixel(x', y') and plot the pixel to (x, y) on screen. x' += cosT; y' -= 754 * sinT; } } */ 755 756 // precalculate some figures that are 757 // used within loop 846 /* optimized public domain rotation routine by Karl Lager 847 * 848 * float cosT,sinT; 849 * cosT = cos(t); 850 * sinT = sin(t); 851 * for (y = min_y; y <= max_y; y++) { 852 * x' = min_x * cosT + y * sinT + x1'; 853 * y' = y * cosT - min_x * sinT + y1'; 854 * for (x = min_x; x <= max_x; x++) { 855 * if (x', y') is in the bounds of the bitmap, get pixel 856 * (x', y') and plot the pixel to (x, y) on screen. 857 * x' += cosT; 858 * y' -= sinT; 859 * } 860 * } 861 */ 862 863 // precalculate some figures that are used within loop 758 864 float minXTimesCosTPlusCenterX = minX * cosT + centerX; 759 865 float CenterYMinusminXTimesSinT = centerY - minX * sinT; 760 866 761 867 #define PSIMAGE_ROTATE_ARBITRARY_LOOP(TYPE,MODE) { \ 762 if (creal(unexposedValue) < PS_MIN_##TYPE || creal(unexposedValue) > PS_MAX_##TYPE || \ 763 cimag(unexposedValue) < PS_MIN_##TYPE || cimag(unexposedValue) > PS_MAX_##TYPE) { \ 764 psError(__func__,"The given unexposedValue (%g%+g) is outside of the " \ 765 "image type's range (%g->%g).", \ 766 creal(unexposedValue),cimag(unexposedValue), \ 767 (double)PS_MIN_##TYPE,(double)PS_MAX_##TYPE); \ 868 if (creal(unexposedValue) < PS_MIN_##TYPE || \ 869 creal(unexposedValue) > PS_MAX_##TYPE || \ 870 cimag(unexposedValue) < PS_MIN_##TYPE || \ 871 cimag(unexposedValue) > PS_MAX_##TYPE) { \ 872 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageRotate", \ 873 PS_ERR_BAD_PARAMETER_VALUE, true, \ 874 PS_ERRORTEXT_psImageManip_CLIP_VALUE_INVALID, \ 875 "unexposedValue", \ 876 creal(unexposedValue),cimag(unexposedValue), \ 877 PS_TYPE_##TYPE##_NAME, \ 878 (double)PS_MIN_##TYPE,(double)PS_MAX_##TYPE); \ 768 879 psFree(out); \ 769 880 out = NULL; \ … … 824 935 PSIMAGE_ROTATE_ARBITRARY_LOOP(C64,MODE); \ 825 936 break; \ 826 default: \ 827 psError(__func__,"Image type (%d) not supported",type); \ 828 psFree(out); \ 829 out = NULL; \ 937 default: { \ 938 char* typeStr; \ 939 PS_TYPE_NAME(typeStr,type); \ 940 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageRotate", \ 941 PS_ERR_BAD_PARAMETER_TYPE, true, \ 942 PS_ERRORTEXT_psImage_IMAGE_TYPE_UNSUPPORTED, \ 943 typeStr); \ 944 psFree(out); \ 945 out = NULL; \ 946 } \ 830 947 } \ 831 948 break; … … 835 952 PSIMAGE_ROTATE_ARBITRARY_CASE(BILINEAR); 836 953 default: 837 psError(__func__, "Unsupported interpolation mode (%d)", mode); 954 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageRotate", 955 PS_ERR_BAD_PARAMETER_VALUE, true, 956 PS_ERRORTEXT_psImageManip_INTERPOLATION_MODE_UNSUPPORTED, 957 mode); 838 958 psFree(out); 839 959 out = NULL; … … 857 977 858 978 if (in == NULL) { 859 psError(__func__, "Input image can not be NULL."); 979 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageShift", 980 PS_ERR_BAD_PARAMETER_NULL, true, 981 PS_ERRORTEXT_psImage_IMAGE_NULL); 860 982 psFree(out); 861 983 return NULL; … … 871 993 #define PSIMAGE_SHIFT_CASE(MODE,TYPE) \ 872 994 case PS_TYPE_##TYPE: \ 873 if (creal(unexposedValue) < PS_MIN_##TYPE || creal(unexposedValue) > PS_MAX_##TYPE || \ 874 cimag(unexposedValue) < PS_MIN_##TYPE || cimag(unexposedValue) > PS_MAX_##TYPE) { \ 875 psError(__func__,"The given unexposedValue (%g%+g) is outside of the " \ 876 "image type's range (%g->%g).", \ 877 creal(unexposedValue), cimag(unexposedValue), \ 878 (double)PS_MIN_##TYPE,(double)PS_MAX_##TYPE); \ 995 if (creal(unexposedValue) < PS_MIN_##TYPE || \ 996 creal(unexposedValue) > PS_MAX_##TYPE || \ 997 cimag(unexposedValue) < PS_MIN_##TYPE || \ 998 cimag(unexposedValue) > PS_MAX_##TYPE) { \ 999 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageShift", \ 1000 PS_ERR_BAD_PARAMETER_VALUE, true, \ 1001 PS_ERRORTEXT_psImageManip_CLIP_VALUE_INVALID, \ 1002 "unexposedValue", \ 1003 creal(unexposedValue),cimag(unexposedValue), \ 1004 PS_TYPE_##TYPE##_NAME, \ 1005 (double)PS_MIN_##TYPE,(double)PS_MAX_##TYPE); \ 879 1006 psFree(out); \ 880 1007 out = NULL; \ … … 885 1012 float y = dy+(float)row; \ 886 1013 for (int col=0;col<outCols;col++) { \ 887 outRow[col] = p_psImagePixelInterpolate##MODE##_##TYPE(in,dx+(float)col,y,unexposedValue); \ 1014 outRow[col] = p_psImagePixelInterpolate##MODE##_##TYPE( \ 1015 in,dx+(float)col,y,unexposedValue); \ 888 1016 } \ 889 1017 } \ … … 905 1033 PSIMAGE_SHIFT_CASE(MODE,C32); \ 906 1034 PSIMAGE_SHIFT_CASE(MODE,C64); \ 907 default: \ 908 psError(__func__, "Image type (%d) not supported.", type); \ 909 psFree(out); \ 910 out = NULL; \ 1035 \ 1036 default: { \ 1037 char* typeStr; \ 1038 PS_TYPE_NAME(typeStr,type); \ 1039 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageRotate", \ 1040 PS_ERR_BAD_PARAMETER_TYPE, true, \ 1041 PS_ERRORTEXT_psImage_IMAGE_TYPE_UNSUPPORTED, \ 1042 typeStr); \ 1043 psFree(out); \ 1044 out = NULL; \ 1045 } \ 911 1046 } \ 912 1047 break; … … 917 1052 PSIMAGE_SHIFT_ARBITRARY_CASE(BILINEAR); 918 1053 default: 919 psError(__func__, "Unsupported interpolation mode (%d)", mode); 1054 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageShift", 1055 PS_ERR_BAD_PARAMETER_VALUE, true, 1056 PS_ERRORTEXT_psImageManip_INTERPOLATION_MODE_UNSUPPORTED, 1057 mode); 920 1058 psFree(out); 921 1059 out = NULL; -
trunk/psLib/src/image/psImageStats.c
r1719 r1840 10 10 * @author George Gusciora, MHPCC 11 11 * 12 * @version $Revision: 1.3 4$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-09- 08 06:02:47$12 * @version $Revision: 1.35 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-09-21 22:30:19 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 32 32 #include "psImageStats.h" 33 33 34 #include "psImageErrors.h" 35 34 36 /// This routine must determine the various statistics for the image. 35 37 … … 43 45 44 46 if (stats == NULL) { 45 psError(__func__, "The input psStats struct can not be NULL."); 47 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageStats", 48 PS_ERR_BAD_PARAMETER_NULL, true, 49 PS_ERRORTEXT_psImage_STAT_NULL); 46 50 return NULL; 47 51 } 48 52 49 53 if (in == NULL) { 50 psError(__func__, "The input image can not be NULL."); 54 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageStats", 55 PS_ERR_BAD_PARAMETER_NULL, true, 56 PS_ERRORTEXT_psImage_IMAGE_NULL); 51 57 return NULL; 52 58 } 53 59 54 60 if (stats->options == 0) { 55 psError(__func__, "No statistic option/operation was specified."); 61 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageStats", 62 PS_ERR_BAD_PARAMETER_VALUE, true, 63 PS_ERRORTEXT_psImage_NO_STAT_OPTIONS); 56 64 return stats; 57 65 } … … 62 70 junkData->nalloc = in->numRows * in->numCols; 63 71 junkData->n = junkData->nalloc; 64 junkData->data.V = in->data.V[0]; // since 65 // psImage 66 // data 67 // is 68 // contiguous... 72 junkData->data.V = in->data.V[0]; // since psImage data is contiguous... 69 73 70 74 if (mask != NULL) { 71 75 if (mask->type.type != PS_TYPE_MASK) { 72 psError(__func__, "Expected the mask image type not found (type=%x)", mask->type.type); 76 char* typeStr; 77 PS_TYPE_NAME(typeStr,mask->type.type); 78 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageStats", 79 PS_ERR_BAD_PARAMETER_TYPE, true, 80 PS_ERRORTEXT_psImage_IMAGE_MASK_TYPE, 81 typeStr, PS_TYPE_MASK_NAME); 73 82 psFree(junkData); 74 83 return NULL; … … 109 118 junkData->nalloc = in->numRows * in->numCols; 110 119 junkData->n = junkData->nalloc; 111 junkData->data.V = in->data.V[0]; // since 112 // psImage 113 // data 114 // is 115 // contiguous... 120 junkData->data.V = in->data.V[0]; // since psImage data is contiguous... 116 121 117 122 if (mask != NULL) { 118 123 if (mask->type.type != PS_TYPE_MASK) { 119 psError(__func__, "Expected the mask image type not found (type=%x)", mask->type.type); 124 char* typeStr; 125 PS_TYPE_NAME(typeStr,mask->type.type); 126 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageHistogram", 127 PS_ERR_BAD_PARAMETER_TYPE, true, 128 PS_ERRORTEXT_psImage_IMAGE_MASK_TYPE, 129 typeStr, PS_TYPE_MASK_NAME); 130 psFree(out); 120 131 psFree(junkData); 121 132 return NULL; 122 133 } 123 // stuff the mask data into a psVector 124 // struct. 134 // stuff the mask data into a psVector struct. 125 135 junkMask = psAlloc(sizeof(psVector)); 126 136 junkMask->type = mask->type; -
trunk/psLib/src/imageops/psImageConvolve.c
r1653 r1840 5 5 * @author Robert DeSonia, MHPCC 6 6 * 7 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $8 * @date $Date: 2004-0 8-28 01:18:28$7 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2004-09-21 22:30:19 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 16 16 #include "psLogMsg.h" 17 17 #include "psError.h" 18 19 #include "psImageErrors.h" 18 20 19 21 static void freeKernel(psKernel* ptr); … … 76 78 } 77 79 78 psKernel *psKernelGenerate(const psVector *xShifts, const psVector *yShifts)80 psKernel* psKernelGenerate(const psVector* xShifts, const psVector* yShifts) 79 81 { 80 82 int x = 0; … … 91 93 // got non-NULL vectors? 92 94 if (xShifts == NULL || yShifts == NULL) { 93 psError(__func__,"Shift vectors can not be NULL."); 95 psErrorMsg(PS_ERRORNAME_DOMAIN "psKernelGenerate", 96 PS_ERR_BAD_PARAMETER_NULL, true, 97 PS_ERRORTEXT_psImageConvolve_SHIFT_NULL); 94 98 return NULL; 95 99 } 96 100 101 // types match? 97 102 if (xShifts->type.type != yShifts->type.type) { 98 psError(__func__,"Shift vectors can not be different data types."); 103 char* typeXStr; 104 char* typeYStr; 105 PS_TYPE_NAME(typeXStr,xShifts->type.type); 106 PS_TYPE_NAME(typeYStr,yShifts->type.type); 107 psErrorMsg(PS_ERRORNAME_DOMAIN "psKernelGenerate", 108 PS_ERR_BAD_PARAMETER_TYPE, true, 109 PS_ERRORTEXT_psImageConvolve_SHIFT_TYPE_MISMATCH, 110 typeXStr, typeYStr); 99 111 return NULL; 100 112 } … … 158 170 KERNEL_GENERATE_CASE(C32); 159 171 KERNEL_GENERATE_CASE(C64); 160 default: 161 psError(__func__,"Shift vector datatype not supported."); 172 173 default: { 174 char* typeStr; 175 PS_TYPE_NAME(typeStr,xShifts->type.type); 176 psErrorMsg(PS_ERRORNAME_DOMAIN "psKernelGenerate", 177 PS_ERR_BAD_PARAMETER_TYPE, true, 178 PS_ERRORTEXT_psImage_IMAGE_TYPE_UNSUPPORTED, 179 typeStr); 180 } 162 181 } 163 182 -
trunk/psLib/src/imageops/psImageStats.c
r1719 r1840 10 10 * @author George Gusciora, MHPCC 11 11 * 12 * @version $Revision: 1.3 4$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-09- 08 06:02:47$12 * @version $Revision: 1.35 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-09-21 22:30:19 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 32 32 #include "psImageStats.h" 33 33 34 #include "psImageErrors.h" 35 34 36 /// This routine must determine the various statistics for the image. 35 37 … … 43 45 44 46 if (stats == NULL) { 45 psError(__func__, "The input psStats struct can not be NULL."); 47 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageStats", 48 PS_ERR_BAD_PARAMETER_NULL, true, 49 PS_ERRORTEXT_psImage_STAT_NULL); 46 50 return NULL; 47 51 } 48 52 49 53 if (in == NULL) { 50 psError(__func__, "The input image can not be NULL."); 54 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageStats", 55 PS_ERR_BAD_PARAMETER_NULL, true, 56 PS_ERRORTEXT_psImage_IMAGE_NULL); 51 57 return NULL; 52 58 } 53 59 54 60 if (stats->options == 0) { 55 psError(__func__, "No statistic option/operation was specified."); 61 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageStats", 62 PS_ERR_BAD_PARAMETER_VALUE, true, 63 PS_ERRORTEXT_psImage_NO_STAT_OPTIONS); 56 64 return stats; 57 65 } … … 62 70 junkData->nalloc = in->numRows * in->numCols; 63 71 junkData->n = junkData->nalloc; 64 junkData->data.V = in->data.V[0]; // since 65 // psImage 66 // data 67 // is 68 // contiguous... 72 junkData->data.V = in->data.V[0]; // since psImage data is contiguous... 69 73 70 74 if (mask != NULL) { 71 75 if (mask->type.type != PS_TYPE_MASK) { 72 psError(__func__, "Expected the mask image type not found (type=%x)", mask->type.type); 76 char* typeStr; 77 PS_TYPE_NAME(typeStr,mask->type.type); 78 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageStats", 79 PS_ERR_BAD_PARAMETER_TYPE, true, 80 PS_ERRORTEXT_psImage_IMAGE_MASK_TYPE, 81 typeStr, PS_TYPE_MASK_NAME); 73 82 psFree(junkData); 74 83 return NULL; … … 109 118 junkData->nalloc = in->numRows * in->numCols; 110 119 junkData->n = junkData->nalloc; 111 junkData->data.V = in->data.V[0]; // since 112 // psImage 113 // data 114 // is 115 // contiguous... 120 junkData->data.V = in->data.V[0]; // since psImage data is contiguous... 116 121 117 122 if (mask != NULL) { 118 123 if (mask->type.type != PS_TYPE_MASK) { 119 psError(__func__, "Expected the mask image type not found (type=%x)", mask->type.type); 124 char* typeStr; 125 PS_TYPE_NAME(typeStr,mask->type.type); 126 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageHistogram", 127 PS_ERR_BAD_PARAMETER_TYPE, true, 128 PS_ERRORTEXT_psImage_IMAGE_MASK_TYPE, 129 typeStr, PS_TYPE_MASK_NAME); 130 psFree(out); 120 131 psFree(junkData); 121 132 return NULL; 122 133 } 123 // stuff the mask data into a psVector 124 // struct. 134 // stuff the mask data into a psVector struct. 125 135 junkMask = psAlloc(sizeof(psVector)); 126 136 junkMask->type = mask->type; -
trunk/psLib/src/mathtypes/psImage.c
r1818 r1840 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1.4 3$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-09- 16 18:51:31$12 * @version $Revision: 1.44 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-09-21 22:30:19 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 224 224 } 225 225 226 #define PSIMAGE_PIXEL_INTERPOLATE_CASE(TYPE) \226 #define PSIMAGE_PIXEL_INTERPOLATE_CASE(TYPE) \ 227 227 case PS_TYPE_##TYPE: \ 228 228 switch (mode) { \ … … 237 237 default: \ 238 238 psErrorMsg(PS_ERRORNAME_DOMAIN "psImagePixelInterpolate", \ 239 PS_ERR_BAD_PARAMETER_VALUE,true, \240 PS_ERRORTEXT_psImage_INTERPOLATE_METHOD_INVALID, \241 mode); \242 } \239 PS_ERR_BAD_PARAMETER_VALUE,true, \ 240 PS_ERRORTEXT_psImage_INTERPOLATE_METHOD_INVALID, \ 241 mode); \ 242 } \ 243 243 break 244 244 … … 256 256 PSIMAGE_PIXEL_INTERPOLATE_CASE(C32); 257 257 PSIMAGE_PIXEL_INTERPOLATE_CASE(C64); 258 default: 259 psErrorMsg(PS_ERRORNAME_DOMAIN "psImagePixelInterpolate", 260 PS_ERR_BAD_PARAMETER_TYPE,true, 261 PS_ERRORTEXT_psImage_IMAGE_TYPE_UNSUPPORTED, 262 input->type.type); 258 default: { 259 char* typeStr; 260 PS_TYPE_NAME(typeStr,input->type.type); 261 psErrorMsg(PS_ERRORNAME_DOMAIN "psImagePixelInterpolate", 262 PS_ERR_BAD_PARAMETER_TYPE,true, 263 PS_ERRORTEXT_psImage_IMAGE_TYPE_UNSUPPORTED, 264 typeStr); 265 } 263 266 } 264 267 -
trunk/psLib/src/sys/psMemory.c
r1826 r1840 8 8 * @author Robert Lupton, Princeton University 9 9 * 10 * @version $Revision: 1.4 0$ $Name: not supported by cvs2svn $11 * @date $Date: 2004-09- 17 19:23:24$10 * @version $Revision: 1.41 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2004-09-21 22:30:19 $ 12 12 * 13 13 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/sys/psType.h
r1448 r1840 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.2 0$ $Name: not supported by cvs2svn $14 * @date $Date: 2004-0 8-10 01:55:34$13 * @version $Revision: 1.21 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2004-09-21 22:30:19 $ 15 15 * 16 16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 103 103 #define PS_MAX_C64 DBL_MAX /**< maximum valid real or imaginary psC32 value */ 104 104 105 #define PS_TYPE_S8_NAME "psS8" 106 #define PS_TYPE_S16_NAME "psS16" 107 #define PS_TYPE_S32_NAME "psS32" 108 #define PS_TYPE_S64_NAME "psS64" 109 #define PS_TYPE_U8_NAME "psU8" 110 #define PS_TYPE_U16_NAME "psU16" 111 #define PS_TYPE_U32_NAME "psU32" 112 #define PS_TYPE_U64_NAME "psU64" 113 #define PS_TYPE_F32_NAME "psF32" 114 #define PS_TYPE_F64_NAME "psF64" 115 #define PS_TYPE_C32_NAME "psC32" 116 #define PS_TYPE_C64_NAME "psC64" 117 #define PS_TYPE_PTR_NAME "psPTR" 118 119 #define PS_TYPE_NAME(value,type) \ 120 switch(type) { \ 121 case PS_TYPE_S8: \ 122 value = PS_TYPE_S8_NAME; \ 123 break; \ 124 case PS_TYPE_S16: \ 125 value = PS_TYPE_S16_NAME; \ 126 break; \ 127 case PS_TYPE_S32: \ 128 value = PS_TYPE_S32_NAME; \ 129 break; \ 130 case PS_TYPE_S64: \ 131 value = PS_TYPE_S64_NAME; \ 132 break; \ 133 case PS_TYPE_U8: \ 134 value = PS_TYPE_U8_NAME; \ 135 break; \ 136 case PS_TYPE_U16: \ 137 value = PS_TYPE_U16_NAME; \ 138 break; \ 139 case PS_TYPE_U32: \ 140 value = PS_TYPE_U32_NAME; \ 141 break; \ 142 case PS_TYPE_U64: \ 143 value = PS_TYPE_U64_NAME; \ 144 break; \ 145 case PS_TYPE_F32: \ 146 value = PS_TYPE_F32_NAME; \ 147 break; \ 148 case PS_TYPE_F64: \ 149 value = PS_TYPE_F64_NAME; \ 150 break; \ 151 case PS_TYPE_C32: \ 152 value = PS_TYPE_C32_NAME; \ 153 break; \ 154 case PS_TYPE_C64: \ 155 value = PS_TYPE_C64_NAME; \ 156 break; \ 157 case PS_TYPE_PTR: \ 158 value = PS_TYPE_PTR_NAME; \ 159 break; \ 160 default: \ 161 value = "unknown"; \ 162 }; 163 105 164 /// Macro to get the bad pixel reason code (stored as part of mask value) 106 165 #define PS_BADPIXEL_BITMASK 0x0f -
trunk/psLib/src/sysUtils/psMemory.c
r1826 r1840 8 8 * @author Robert Lupton, Princeton University 9 9 * 10 * @version $Revision: 1.4 0$ $Name: not supported by cvs2svn $11 * @date $Date: 2004-09- 17 19:23:24$10 * @version $Revision: 1.41 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2004-09-21 22:30:19 $ 12 12 * 13 13 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/sysUtils/psType.h
r1448 r1840 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.2 0$ $Name: not supported by cvs2svn $14 * @date $Date: 2004-0 8-10 01:55:34$13 * @version $Revision: 1.21 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2004-09-21 22:30:19 $ 15 15 * 16 16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 103 103 #define PS_MAX_C64 DBL_MAX /**< maximum valid real or imaginary psC32 value */ 104 104 105 #define PS_TYPE_S8_NAME "psS8" 106 #define PS_TYPE_S16_NAME "psS16" 107 #define PS_TYPE_S32_NAME "psS32" 108 #define PS_TYPE_S64_NAME "psS64" 109 #define PS_TYPE_U8_NAME "psU8" 110 #define PS_TYPE_U16_NAME "psU16" 111 #define PS_TYPE_U32_NAME "psU32" 112 #define PS_TYPE_U64_NAME "psU64" 113 #define PS_TYPE_F32_NAME "psF32" 114 #define PS_TYPE_F64_NAME "psF64" 115 #define PS_TYPE_C32_NAME "psC32" 116 #define PS_TYPE_C64_NAME "psC64" 117 #define PS_TYPE_PTR_NAME "psPTR" 118 119 #define PS_TYPE_NAME(value,type) \ 120 switch(type) { \ 121 case PS_TYPE_S8: \ 122 value = PS_TYPE_S8_NAME; \ 123 break; \ 124 case PS_TYPE_S16: \ 125 value = PS_TYPE_S16_NAME; \ 126 break; \ 127 case PS_TYPE_S32: \ 128 value = PS_TYPE_S32_NAME; \ 129 break; \ 130 case PS_TYPE_S64: \ 131 value = PS_TYPE_S64_NAME; \ 132 break; \ 133 case PS_TYPE_U8: \ 134 value = PS_TYPE_U8_NAME; \ 135 break; \ 136 case PS_TYPE_U16: \ 137 value = PS_TYPE_U16_NAME; \ 138 break; \ 139 case PS_TYPE_U32: \ 140 value = PS_TYPE_U32_NAME; \ 141 break; \ 142 case PS_TYPE_U64: \ 143 value = PS_TYPE_U64_NAME; \ 144 break; \ 145 case PS_TYPE_F32: \ 146 value = PS_TYPE_F32_NAME; \ 147 break; \ 148 case PS_TYPE_F64: \ 149 value = PS_TYPE_F64_NAME; \ 150 break; \ 151 case PS_TYPE_C32: \ 152 value = PS_TYPE_C32_NAME; \ 153 break; \ 154 case PS_TYPE_C64: \ 155 value = PS_TYPE_C64_NAME; \ 156 break; \ 157 case PS_TYPE_PTR: \ 158 value = PS_TYPE_PTR_NAME; \ 159 break; \ 160 default: \ 161 value = "unknown"; \ 162 }; 163 105 164 /// Macro to get the bad pixel reason code (stored as part of mask value) 106 165 #define PS_BADPIXEL_BITMASK 0x0f -
trunk/psLib/test/dataManip/Makefile
r1830 r1840 3 3 ## Makefile: test/sysUtils 4 4 ## 5 ## $Revision: 1.4 1$ $Name: not supported by cvs2svn $6 ## $Date: 2004-09- 18 01:50:24$5 ## $Revision: 1.42 $ $Name: not supported by cvs2svn $ 6 ## $Date: 2004-09-21 22:30:19 $ 7 7 ## 8 8 ## Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 26 26 tst_psFunc04 \ 27 27 tst_psFunc05 \ 28 tst_psFunc06 \29 28 tst_psHist00 \ 30 29 tst_psHist01 \ -
trunk/psLib/test/image/verified/tst_psImage.stderr
r1761 r1840 11 11 <DATE><TIME>|<HOST>|I|testImageAlloc 12 12 Following should be an error. 13 <DATE><TIME>|<HOST>|E|ps ImageAlloc14 Invalid value for number of rows or columns (numRows=0, numCols=0).13 <DATE><TIME>|<HOST>|E|psLib.image.psImageAlloc 14 Specified number of rows (0) or columns (0) is invalid. 15 15 <DATE><TIME>|<HOST>|I|testImageAlloc 16 16 Testing psImage with type 102h 17 17 <DATE><TIME>|<HOST>|I|testImageAlloc 18 18 Following should be an error. 19 <DATE><TIME>|<HOST>|E|ps ImageAlloc20 Invalid value for number of rows or columns (numRows=0, numCols=0).19 <DATE><TIME>|<HOST>|E|psLib.image.psImageAlloc 20 Specified number of rows (0) or columns (0) is invalid. 21 21 <DATE><TIME>|<HOST>|I|testImageAlloc 22 22 Testing psImage with type 104h 23 23 <DATE><TIME>|<HOST>|I|testImageAlloc 24 24 Following should be an error. 25 <DATE><TIME>|<HOST>|E|ps ImageAlloc26 Invalid value for number of rows or columns (numRows=0, numCols=0).25 <DATE><TIME>|<HOST>|E|psLib.image.psImageAlloc 26 Specified number of rows (0) or columns (0) is invalid. 27 27 <DATE><TIME>|<HOST>|I|testImageAlloc 28 28 Testing psImage with type 108h 29 29 <DATE><TIME>|<HOST>|I|testImageAlloc 30 30 Following should be an error. 31 <DATE><TIME>|<HOST>|E|ps ImageAlloc32 Invalid value for number of rows or columns (numRows=0, numCols=0).31 <DATE><TIME>|<HOST>|E|psLib.image.psImageAlloc 32 Specified number of rows (0) or columns (0) is invalid. 33 33 <DATE><TIME>|<HOST>|I|testImageAlloc 34 34 Testing psImage with type 301h 35 35 <DATE><TIME>|<HOST>|I|testImageAlloc 36 36 Following should be an error. 37 <DATE><TIME>|<HOST>|E|ps ImageAlloc38 Invalid value for number of rows or columns (numRows=0, numCols=0).37 <DATE><TIME>|<HOST>|E|psLib.image.psImageAlloc 38 Specified number of rows (0) or columns (0) is invalid. 39 39 <DATE><TIME>|<HOST>|I|testImageAlloc 40 40 Testing psImage with type 302h 41 41 <DATE><TIME>|<HOST>|I|testImageAlloc 42 42 Following should be an error. 43 <DATE><TIME>|<HOST>|E|ps ImageAlloc44 Invalid value for number of rows or columns (numRows=0, numCols=0).43 <DATE><TIME>|<HOST>|E|psLib.image.psImageAlloc 44 Specified number of rows (0) or columns (0) is invalid. 45 45 <DATE><TIME>|<HOST>|I|testImageAlloc 46 46 Testing psImage with type 304h 47 47 <DATE><TIME>|<HOST>|I|testImageAlloc 48 48 Following should be an error. 49 <DATE><TIME>|<HOST>|E|ps ImageAlloc50 Invalid value for number of rows or columns (numRows=0, numCols=0).49 <DATE><TIME>|<HOST>|E|psLib.image.psImageAlloc 50 Specified number of rows (0) or columns (0) is invalid. 51 51 <DATE><TIME>|<HOST>|I|testImageAlloc 52 52 Testing psImage with type 308h 53 53 <DATE><TIME>|<HOST>|I|testImageAlloc 54 54 Following should be an error. 55 <DATE><TIME>|<HOST>|E|ps ImageAlloc56 Invalid value for number of rows or columns (numRows=0, numCols=0).55 <DATE><TIME>|<HOST>|E|psLib.image.psImageAlloc 56 Specified number of rows (0) or columns (0) is invalid. 57 57 <DATE><TIME>|<HOST>|I|testImageAlloc 58 58 Testing psImage with type 404h 59 59 <DATE><TIME>|<HOST>|I|testImageAlloc 60 60 Following should be an error. 61 <DATE><TIME>|<HOST>|E|ps ImageAlloc62 Invalid value for number of rows or columns (numRows=0, numCols=0).61 <DATE><TIME>|<HOST>|E|psLib.image.psImageAlloc 62 Specified number of rows (0) or columns (0) is invalid. 63 63 <DATE><TIME>|<HOST>|I|testImageAlloc 64 64 Testing psImage with type 408h 65 65 <DATE><TIME>|<HOST>|I|testImageAlloc 66 66 Following should be an error. 67 <DATE><TIME>|<HOST>|E|ps ImageAlloc68 Invalid value for number of rows or columns (numRows=0, numCols=0).67 <DATE><TIME>|<HOST>|E|psLib.image.psImageAlloc 68 Specified number of rows (0) or columns (0) is invalid. 69 69 <DATE><TIME>|<HOST>|I|testImageAlloc 70 70 Testing psImage with type 808h 71 71 <DATE><TIME>|<HOST>|I|testImageAlloc 72 72 Following should be an error. 73 <DATE><TIME>|<HOST>|E|ps ImageAlloc74 Invalid value for number of rows or columns (numRows=0, numCols=0).73 <DATE><TIME>|<HOST>|E|psLib.image.psImageAlloc 74 Specified number of rows (0) or columns (0) is invalid. 75 75 <DATE><TIME>|<HOST>|I|testImageAlloc 76 76 Testing psImage with type 810h 77 77 <DATE><TIME>|<HOST>|I|testImageAlloc 78 78 Following should be an error. 79 <DATE><TIME>|<HOST>|E|ps ImageAlloc80 Invalid value for number of rows or columns (numRows=0, numCols=0).79 <DATE><TIME>|<HOST>|E|psLib.image.psImageAlloc 80 Specified number of rows (0) or columns (0) is invalid. 81 81 <DATE><TIME>|<HOST>|I|testImageAlloc 82 82 Testing psImage with type 0h 83 83 <DATE><TIME>|<HOST>|I|testImageAlloc 84 84 Following should be an error. 85 <DATE><TIME>|<HOST>|E|ps ImageAlloc86 Invalid value for number of rows or columns (numRows=0, numCols=0).85 <DATE><TIME>|<HOST>|E|psLib.image.psImageAlloc 86 Specified number of rows (0) or columns (0) is invalid. 87 87 88 88 ---> TESTPOINT PASSED (psImage{psImageAlloc} | tst_psImage.c) … … 114 114 <DATE><TIME>|<HOST>|I|testImageSubset 115 115 An error should follow... 116 <DATE><TIME>|<HOST>|E|ps ImageSubset117 Can not subset image because input image or its pixel buffer is NULL.116 <DATE><TIME>|<HOST>|E|psLib.image.psImageSubset 117 Can not operate on a NULL psImage. 118 118 <DATE><TIME>|<HOST>|I|testImageSubset 119 119 Verify the returned psImage structure pointer is null and program execution doesn't stop, if the input parameters nrow and/or ncol are zero. Also verify input psImage structure is not modified. 120 120 <DATE><TIME>|<HOST>|I|testImageSubset 121 121 An error should follow... 122 <DATE><TIME>|<HOST>|E|ps ImageSubset123 Can not subset image because number of rows or columns are zero (64x0).122 <DATE><TIME>|<HOST>|E|psLib.image.psImageSubset 123 Specified number of rows (64) or columns (0) is invalid. 124 124 <DATE><TIME>|<HOST>|I|testImageSubset 125 125 An error should follow... 126 <DATE><TIME>|<HOST>|E|ps ImageSubset127 Can not subset image because number of rows or columns are zero (0x128).126 <DATE><TIME>|<HOST>|E|psLib.image.psImageSubset 127 Specified number of rows (0) or columns (128) is invalid. 128 128 <DATE><TIME>|<HOST>|I|testImageSubset 129 129 Verify the returned psImage structure pointer is null and program execution doesn't stop, if the input parameters row0 and col0 are not within the range of values of psImage structure image. 130 130 <DATE><TIME>|<HOST>|I|testImageSubset 131 131 An error should follow... 132 <DATE><TIME>|<HOST>|E|ps ImageSubset133 Can not subset image because col0,row0 (128,0) is not a valid pixel location.132 <DATE><TIME>|<HOST>|E|psLib.image.psImageSubset 133 Specified subset range, [128:<LINENO>,0:<LINENO>], lies outside psImage's boundaries, [0:<LINENO>,0:<LINENO>]. 134 134 <DATE><TIME>|<HOST>|I|testImageSubset 135 135 An error should follow... 136 <DATE><TIME>|<HOST>|E|ps ImageSubset137 Can not subset image because col0,row0 (0,256) is not a valid pixel location.136 <DATE><TIME>|<HOST>|E|psLib.image.psImageSubset 137 Specified subset range, [0:<LINENO>,256:<LINENO>], lies outside psImage's boundaries, [0:<LINENO>,0:<LINENO>]. 138 138 <DATE><TIME>|<HOST>|I|testImageSubset 139 139 An error should follow... 140 <DATE><TIME>|<HOST>|E|ps ImageSubset141 Can not subset image because col0,row0 (-1,0) is not a valid pixel location.140 <DATE><TIME>|<HOST>|E|psLib.image.psImageSubset 141 Specified subset range, [-1:<LINENO>,0:<LINENO>], lies outside psImage's boundaries, [0:<LINENO>,0:<LINENO>]. 142 142 <DATE><TIME>|<HOST>|I|testImageSubset 143 143 An error should follow... 144 <DATE><TIME>|<HOST>|E|ps ImageSubset145 Can not subset image because col0,row0 (0,-1) is not a valid pixel location.144 <DATE><TIME>|<HOST>|E|psLib.image.psImageSubset 145 Specified subset range, [0:<LINENO>,-1:<LINENO>], lies outside psImage's boundaries, [0:<LINENO>,0:<LINENO>]. 146 146 <DATE><TIME>|<HOST>|I|testImageSubset 147 147 Verify the returned psImage structure pointer is null and program execution doesn't stop if the input parameters nrow, ncol, row0 and col0 specify a range of data not within the input psImage structure image. Also verify the input psImage structure is not modified. 148 148 <DATE><TIME>|<HOST>|I|testImageSubset 149 149 An error should follow... 150 <DATE><TIME>|<HOST>|E|ps ImageSubset151 Can not subset image outside of image boundaries (size=128x256, subset=[64:<LINENO>,0:<LINENO>]).150 <DATE><TIME>|<HOST>|E|psLib.image.psImageSubset 151 Specified subset range, [64:<LINENO>,0:<LINENO>], lies outside psImage's boundaries, [0:<LINENO>,0:<LINENO>]. 152 152 <DATE><TIME>|<HOST>|I|testImageSubset 153 153 An error should follow... 154 <DATE><TIME>|<HOST>|E|ps ImageSubset155 Can not subset image outside of image boundaries (size=128x256, subset=[0:<LINENO>,128:<LINENO>]).154 <DATE><TIME>|<HOST>|E|psLib.image.psImageSubset 155 Specified subset range, [0:<LINENO>,128:<LINENO>], lies outside psImage's boundaries, [0:<LINENO>,0:<LINENO>]. 156 156 <DATE><TIME>|<HOST>|I|testImageSubset 157 157 An error should follow... 158 <DATE><TIME>|<HOST>|E|ps ImageSubset159 Can not subset image outside of image boundaries (size=128x256, subset=[64:<LINENO>,128:<LINENO>]).158 <DATE><TIME>|<HOST>|E|psLib.image.psImageSubset 159 Specified subset range, [64:<LINENO>,128:<LINENO>], lies outside psImage's boundaries, [0:<LINENO>,0:<LINENO>]. 160 160 <DATE><TIME>|<HOST>|I|testImageSubset 161 161 psImageFreeChildren shall deallocate any children images of a psImage structure … … 187 187 <DATE><TIME>|<HOST>|I|testImageCopy 188 188 An error should follow... 189 <DATE><TIME>|<HOST>|E|ps ImageCopy190 Can not copy image because input image or its pixel buffer is NULL.189 <DATE><TIME>|<HOST>|E|psLib.image.psImageCopy 190 Can not operate on a NULL psImage. 191 191 192 192 ---> TESTPOINT PASSED (psImage{psImageCopy} | tst_psImage.c) -
trunk/psLib/test/image/verified/tst_psImageExtraction.stderr
r1761 r1840 7 7 <DATE><TIME>|<HOST>|I|testImageSlice 8 8 Following should be an error. 9 <DATE><TIME>|<HOST>|E|ps ImageSlice10 Input image can not be NULL.9 <DATE><TIME>|<HOST>|E|psLib.image.psImageSlice 10 Can not operate on a NULL psImage. 11 11 <DATE><TIME>|<HOST>|I|testImageSlice 12 12 Following should be an error. 13 <DATE><TIME>|<HOST>|E|ps ImageSlice14 The stat options didn't specify a single supported statistic type.13 <DATE><TIME>|<HOST>|E|psLib.image.psImageSlice 14 Specified statistic can not be NULL. 15 15 <DATE><TIME>|<HOST>|I|testImageSlice 16 16 Following should be an error. 17 <DATE><TIME>|<HOST>|E|ps ImageSlice18 Invalid direction flag (5)17 <DATE><TIME>|<HOST>|E|psLib.image.psImageSlice 18 Specified slice direction, 5, is invalid. 19 19 <DATE><TIME>|<HOST>|I|testImageSlice 20 20 Following should be an error. 21 <DATE><TIME>|<HOST>|E|ps ImageSlice22 The specified region contains no data (0x0)21 <DATE><TIME>|<HOST>|E|psLib.image.psImageSlice 22 Specified subset, [200:<LINENO>,100:<LINENO>], contains no pixel data. 23 23 <DATE><TIME>|<HOST>|I|testImageSlice 24 24 Following should be an error. 25 <DATE><TIME>|<HOST>|E|ps ImageSlice26 The specified image region (2001,100 to 2001,100) is outside of image area (0,0 to 1999,999).25 <DATE><TIME>|<HOST>|E|psLib.image.psImageSlice 26 Specified subset range, [2001:<LINENO>,2002:<LINENO>], lies outside psImage's boundaries, [0:<LINENO>,0:<LINENO>]. 27 27 <DATE><TIME>|<HOST>|I|testImageSlice 28 28 Following should be an error. 29 <DATE><TIME>|<HOST>|E|ps ImageSlice30 The specified image region (200,1001 to 200,1001) is outside of image area (0,0 to 1999,999).29 <DATE><TIME>|<HOST>|E|psLib.image.psImageSlice 30 Specified subset range, [200:<LINENO>,201:<LINENO>], lies outside psImage's boundaries, [0:<LINENO>,0:<LINENO>]. 31 31 <DATE><TIME>|<HOST>|I|testImageSlice 32 32 Following should be an error. 33 <DATE><TIME>|<HOST>|E|ps ImageSlice34 The specified image region (200,100 to 2199,100) is outside of image area (0,0 to 1999,999).33 <DATE><TIME>|<HOST>|E|psLib.image.psImageSlice 34 Specified subset range, [200:<LINENO>,2200:<LINENO>], lies outside psImage's boundaries, [0:<LINENO>,0:<LINENO>]. 35 35 <DATE><TIME>|<HOST>|I|testImageSlice 36 36 Following should be an error. 37 <DATE><TIME>|<HOST>|E|ps ImageSlice38 The specified image region (200,100 to 200,1099) is outside of image area (0,0 to 1999,999).37 <DATE><TIME>|<HOST>|E|psLib.image.psImageSlice 38 Specified subset range, [200:<LINENO>,201:<LINENO>], lies outside psImage's boundaries, [0:<LINENO>,0:<LINENO>]. 39 39 <DATE><TIME>|<HOST>|I|testImageSlice 40 40 Following should be an error. 41 <DATE><TIME>|<HOST>|E|ps ImageSlice42 The stat options didn't specify a single supportedstatistic type.41 <DATE><TIME>|<HOST>|E|psLib.image.psImageSlice 42 Specified statistic option, 1, is not valid. Must specify one and only one statistic type. 43 43 44 44 ---> TESTPOINT PASSED (psImage{psImageSlice} | tst_psImageExtraction.c) -
trunk/psLib/test/image/verified/tst_psImageFFT.stderr
r1761 r1840 25 25 <DATE><TIME>|<HOST>|I|testImageComplex 26 26 Following should be an error (type mismatch). 27 <DATE><TIME>|<HOST>|E|ps ImageComplex28 The inputs to psImageComplex must be the same type.27 <DATE><TIME>|<HOST>|E|psLib.image.psImageComplex 28 Real psImage type (psF32) and imaginary psImage type (psF64) must be the same. 29 29 <DATE><TIME>|<HOST>|I|testImageComplex 30 30 Following should be an error (size mismatch). 31 <DATE><TIME>|<HOST>|E|ps ImageComplex32 The inputs to psImageComplex must be the same dimensions.31 <DATE><TIME>|<HOST>|E|psLib.image.psImageComplex 32 Real psImage size (128x64) and imaginary psImage size (64x64) must be the same. 33 33 34 34 ---> TESTPOINT PASSED (psFFT{psImageComplex} | tst_psImageFFT.c) -
trunk/psLib/test/image/verified/tst_psImageManip.stderr
r1761 r1840 29 29 <DATE><TIME>|<HOST>|I|testImageClip 30 30 Following should be an error (max<min) 31 <DATE><TIME>|<HOST>|E|ps ImageClip32 psImageClip can not be invoked with max < min.31 <DATE><TIME>|<HOST>|E|psLib.image.psImageClip 32 Specified min value, 256, can not be greater than the specified max value, 128. 33 33 34 34 ---> TESTPOINT PASSED (psImage{psImageClip} | tst_psImageManip.c) … … 59 59 <DATE><TIME>|<HOST>|I|testImageClipComplexRegion 60 60 Following should be an error: 61 <DATE><TIME>|<HOST>|E|ps ImageClipComplexRegion62 Can not perform clip on NULL image63 <DATE><TIME>|<HOST>|I|testImageClipComplexRegion 64 Following should be an error: 65 <DATE><TIME>|<HOST>|E|ps ImageClipComplexRegion66 psImageClipComplexRegion can not be invoked with max < min in the real image space.67 <DATE><TIME>|<HOST>|I|testImageClipComplexRegion 68 Following should be an error: 69 <DATE><TIME>|<HOST>|E|ps ImageClipComplexRegion70 psImageClipComplexRegion can not be invoked with max < min in the imaginary image space.71 <DATE><TIME>|<HOST>|I|testImageClipComplexRegion 72 Following should be an error: 73 <DATE><TIME>|<HOST>|E|ps ImageClipComplexRegion74 psImageClipComplexRegion can not be invoked with max < min in the real image space.75 <DATE><TIME>|<HOST>|I|testImageClipComplexRegion 76 Following should be an error: 77 <DATE><TIME>|<HOST>|E|ps ImageClipComplexRegion78 Specified vmin (-6.80565e+38+0i) is outside of image's psC32 pixel range79 <DATE><TIME>|<HOST>|I|testImageClipComplexRegion 80 Following should be an error: 81 <DATE><TIME>|<HOST>|E|ps ImageClipComplexRegion82 Specified vmin (6.80565e+38+0i) is outside of image's psC32 pixel range83 <DATE><TIME>|<HOST>|I|testImageClipComplexRegion 84 Following should be an error: 85 <DATE><TIME>|<HOST>|E|ps ImageClipComplexRegion86 Specified vmin (-0-6.80565e+38i) is outside of image's psC32 pixel range87 <DATE><TIME>|<HOST>|I|testImageClipComplexRegion 88 Following should be an error: 89 <DATE><TIME>|<HOST>|E|ps ImageClipComplexRegion90 Specified vmin (0+6.80565e+38i) is outside of image's psC32 pixel range91 <DATE><TIME>|<HOST>|I|testImageClipComplexRegion 92 Following should be an error: 93 <DATE><TIME>|<HOST>|E|ps ImageClipComplexRegion94 Specified vmax (-6.80565e+38+0i) is outside of image's psC32 pixel range95 <DATE><TIME>|<HOST>|I|testImageClipComplexRegion 96 Following should be an error: 97 <DATE><TIME>|<HOST>|E|ps ImageClipComplexRegion98 Specified vmax (6.80565e+38+0i) is outside of image's psC32 pixel range99 <DATE><TIME>|<HOST>|I|testImageClipComplexRegion 100 Following should be an error: 101 <DATE><TIME>|<HOST>|E|ps ImageClipComplexRegion102 Specified vmax (-0-6.80565e+38i) is outside of image's psC32 pixel range103 <DATE><TIME>|<HOST>|I|testImageClipComplexRegion 104 Following should be an error: 105 <DATE><TIME>|<HOST>|E|ps ImageClipComplexRegion106 Specified vmax (0+6.80565e+38i) is outside of image's psC32 pixel range61 <DATE><TIME>|<HOST>|E|psLib.image.psImageClipComplexRegion 62 Can not operate on a NULL psImage. 63 <DATE><TIME>|<HOST>|I|testImageClipComplexRegion 64 Following should be an error: 65 <DATE><TIME>|<HOST>|E|psLib.image.psImageClipComplexRegion 66 Specified real-portion of min value, 10, can not be greater than the real-portion of max value, 5. 67 <DATE><TIME>|<HOST>|I|testImageClipComplexRegion 68 Following should be an error: 69 <DATE><TIME>|<HOST>|E|psLib.image.psImageClipComplexRegion 70 Specified imaginary-portion of min value, 10, can not be greater than the imaginary-portion of max value, 5. 71 <DATE><TIME>|<HOST>|I|testImageClipComplexRegion 72 Following should be an error: 73 <DATE><TIME>|<HOST>|E|psLib.image.psImageClipComplexRegion 74 Specified real-portion of min value, 10, can not be greater than the real-portion of max value, 5. 75 <DATE><TIME>|<HOST>|I|testImageClipComplexRegion 76 Following should be an error: 77 <DATE><TIME>|<HOST>|E|psLib.image.psImageClipComplexRegion 78 Specified vmin value, -6.80565e+38+0i, is not the the range of input psImage's valid pixel values (psC32), i.e. [-3.40282e+38:<LINENO>.40282e+38]. 79 <DATE><TIME>|<HOST>|I|testImageClipComplexRegion 80 Following should be an error: 81 <DATE><TIME>|<HOST>|E|psLib.image.psImageClipComplexRegion 82 Specified vmin value, 6.80565e+38+0i, is not the the range of input psImage's valid pixel values (psC32), i.e. [-3.40282e+38:<LINENO>.40282e+38]. 83 <DATE><TIME>|<HOST>|I|testImageClipComplexRegion 84 Following should be an error: 85 <DATE><TIME>|<HOST>|E|psLib.image.psImageClipComplexRegion 86 Specified vmin value, -0-6.80565e+38i, is not the the range of input psImage's valid pixel values (psC32), i.e. [-3.40282e+38:<LINENO>.40282e+38]. 87 <DATE><TIME>|<HOST>|I|testImageClipComplexRegion 88 Following should be an error: 89 <DATE><TIME>|<HOST>|E|psLib.image.psImageClipComplexRegion 90 Specified vmin value, 0+6.80565e+38i, is not the the range of input psImage's valid pixel values (psC32), i.e. [-3.40282e+38:<LINENO>.40282e+38]. 91 <DATE><TIME>|<HOST>|I|testImageClipComplexRegion 92 Following should be an error: 93 <DATE><TIME>|<HOST>|E|psLib.image.psImageClipComplexRegion 94 Specified vmax value, -6.80565e+38+0i, is not the the range of input psImage's valid pixel values (psC32), i.e. [-3.40282e+38:<LINENO>.40282e+38]. 95 <DATE><TIME>|<HOST>|I|testImageClipComplexRegion 96 Following should be an error: 97 <DATE><TIME>|<HOST>|E|psLib.image.psImageClipComplexRegion 98 Specified vmax value, 6.80565e+38+0i, is not the the range of input psImage's valid pixel values (psC32), i.e. [-3.40282e+38:<LINENO>.40282e+38]. 99 <DATE><TIME>|<HOST>|I|testImageClipComplexRegion 100 Following should be an error: 101 <DATE><TIME>|<HOST>|E|psLib.image.psImageClipComplexRegion 102 Specified vmax value, -0-6.80565e+38i, is not the the range of input psImage's valid pixel values (psC32), i.e. [-3.40282e+38:<LINENO>.40282e+38]. 103 <DATE><TIME>|<HOST>|I|testImageClipComplexRegion 104 Following should be an error: 105 <DATE><TIME>|<HOST>|E|psLib.image.psImageClipComplexRegion 106 Specified vmax value, 0+6.80565e+38i, is not the the range of input psImage's valid pixel values (psC32), i.e. [-3.40282e+38:<LINENO>.40282e+38]. 107 107 108 108 ---> TESTPOINT PASSED (psImage{psImageClipComplexRegion} | tst_psImageManip.c) … … 116 116 <DATE><TIME>|<HOST>|I|testImageOverlay 117 117 Following should error as overlay isn't within image boundaries 118 <DATE><TIME>|<HOST>|E|ps ImageOverlaySection119 Overlay image (32,64 -> 159,319) is partially outside of the input image (128 x 256).118 <DATE><TIME>|<HOST>|E|psLib.image.psImageOverlaySection 119 Specified subset range, [32:<LINENO>,64:<LINENO>], lies outside psImage's boundaries, [0:<LINENO>,0:<LINENO>]. 120 120 <DATE><TIME>|<HOST>|I|testImageOverlay 121 121 Following should error as overlay is NULL 122 <DATE><TIME>|<HOST>|E|ps ImageOverlaySection123 one of the input images was NULL.122 <DATE><TIME>|<HOST>|E|psLib.image.psImageOverlaySection 123 Can not operate on a NULL psImage. 124 124 <DATE><TIME>|<HOST>|I|testImageOverlay 125 125 Following should error as image input is NULL 126 <DATE><TIME>|<HOST>|E|ps ImageOverlaySection127 one of the input images was NULL.126 <DATE><TIME>|<HOST>|E|psLib.image.psImageOverlaySection 127 Can not operate on a NULL psImage. 128 128 129 129 ---> TESTPOINT PASSED (psImage{psImageOverlay} | tst_psImageManip.c) … … 135 135 \**********************************************************************************/ 136 136 137 <DATE><TIME>|<HOST>|E|ps ImageRebin138 Input image is NULL.139 <DATE><TIME>|<HOST>|I|testImageRebin 140 Following should be an error. 141 <DATE><TIME>|<HOST>|E|ps ImageRebin142 The scale must be positive.143 <DATE><TIME>|<HOST>|I|testImageRebin 144 Following should be an error. 145 <DATE><TIME>|<HOST>|E|ps ImageRebin146 The stats inputcan not be NULL.147 <DATE><TIME>|<HOST>|I|testImageRebin 148 Following should be an error. 149 <DATE><TIME>|<HOST>|E|ps ImageRebin150 The stat options didn't specify a single supportedstatistic type.151 <DATE><TIME>|<HOST>|I|testImageRebin 152 Following should be an error. 153 <DATE><TIME>|<HOST>|E|ps ImageRebin154 The stat options didn't specify a single supportedstatistic type.155 <DATE><TIME>|<HOST>|I|testImageRebin 156 Following should be an error. 157 <DATE><TIME>|<HOST>|E|ps ImageRebin158 The stat options didn't specify a single supportedstatistic type.137 <DATE><TIME>|<HOST>|E|psLib.image.psImageRebin 138 Can not operate on a NULL psImage. 139 <DATE><TIME>|<HOST>|I|testImageRebin 140 Following should be an error. 141 <DATE><TIME>|<HOST>|E|psLib.image.psImageRebin 142 Specified scale value, 0, must be a positive value. 143 <DATE><TIME>|<HOST>|I|testImageRebin 144 Following should be an error. 145 <DATE><TIME>|<HOST>|E|psLib.image.psImageRebin 146 Specified statistic can not be NULL. 147 <DATE><TIME>|<HOST>|I|testImageRebin 148 Following should be an error. 149 <DATE><TIME>|<HOST>|E|psLib.image.psImageRebin 150 Specified statistic option, 0, is not valid. Must specify one and only one statistic type. 151 <DATE><TIME>|<HOST>|I|testImageRebin 152 Following should be an error. 153 <DATE><TIME>|<HOST>|E|psLib.image.psImageRebin 154 Specified statistic option, 8192, is not valid. Must specify one and only one statistic type. 155 <DATE><TIME>|<HOST>|I|testImageRebin 156 Following should be an error. 157 <DATE><TIME>|<HOST>|E|psLib.image.psImageRebin 158 Specified statistic option, 2049, is not valid. Must specify one and only one statistic type. 159 159 160 160 ---> TESTPOINT PASSED (psImage{psImageRebin} | tst_psImageManip.c) … … 168 168 <DATE><TIME>|<HOST>|I|testImageRoll 169 169 Following should generate an error. 170 <DATE><TIME>|<HOST>|E|ps ImageRoll171 Input image can not be NULL.170 <DATE><TIME>|<HOST>|E|psLib.image.psImageRoll 171 Can not operate on a NULL psImage. 172 172 173 173 ---> TESTPOINT PASSED (psImage{psImageRoll} | tst_psImageManip.c) … … 181 181 <DATE><TIME>|<HOST>|I|testImageRotate 182 182 Following should be an error 183 <DATE><TIME>|<HOST>|E|ps ImageRotate184 The input image was NULL.183 <DATE><TIME>|<HOST>|E|psLib.image.psImageRotate 184 Can not operate on a NULL psImage. 185 185 186 186 ---> TESTPOINT PASSED (psImage{psImageRotate} | tst_psImageManip.c) … … 228 228 <DATE><TIME>|<HOST>|I|testImageShift 229 229 Following should be an error... 230 <DATE><TIME>|<HOST>|E|ps ImageShift231 Input image can not be NULL.230 <DATE><TIME>|<HOST>|E|psLib.image.psImageShift 231 Can not operate on a NULL psImage. 232 232 233 233 ---> TESTPOINT PASSED (psImage{psImageShift} | tst_psImageManip.c) -
trunk/psLib/test/image/verified/tst_psImageStats01.stderr
r1761 r1840 1 <DATE><TIME>|<HOST>|E|ps ImageStats2 The input image can not be NULL.3 <DATE><TIME>|<HOST>|E|ps ImageStats4 The input psStats structcan not be NULL.5 <DATE><TIME>|<HOST>|E|ps ImageStats6 No statistic option/operation was specified.1 <DATE><TIME>|<HOST>|E|psLib.image.psImageStats 2 Can not operate on a NULL psImage. 3 <DATE><TIME>|<HOST>|E|psLib.image.psImageStats 4 Specified statistic can not be NULL. 5 <DATE><TIME>|<HOST>|E|psLib.image.psImageStats 6 Specified statistic option did not indicate any operation to perform.
Note:
See TracChangeset
for help on using the changeset viewer.
