Changeset 2879
- Timestamp:
- Jan 3, 2005, 4:34:58 PM (22 years ago)
- Location:
- trunk/psLib
- Files:
-
- 9 edited
-
src/Makefile.Globals (modified) (2 diffs)
-
src/image/psImage.c (modified) (3 diffs)
-
src/image/psImage.h (modified) (3 diffs)
-
src/image/psImageErrors.dat (modified) (3 diffs)
-
src/image/psImageErrors.h (modified) (4 diffs)
-
src/mathtypes/psImage.c (modified) (3 diffs)
-
src/mathtypes/psImage.h (modified) (3 diffs)
-
test/image/tst_psImage.c (modified) (4 diffs)
-
test/image/verified/tst_psImage.stderr (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/Makefile.Globals
r2869 r2879 6 6 ## Assumptions: Variable "prefix" already defined 7 7 ## 8 ## $Revision: 1.3 7$ $Name: not supported by cvs2svn $9 ## $Date: 2005-01-0 3 23:37:52$8 ## $Revision: 1.38 $ $Name: not supported by cvs2svn $ 9 ## $Date: 2005-01-04 02:34:56 $ 10 10 ## 11 11 ## Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 61 61 62 62 XML2_CFLAGS := $(shell $(xml2config) --cflags) 63 XML2_CFLAGS = -I/usr/local/include/libxml264 63 65 64 # Set initial value for CFLAGS which will include all OS common flags for GCC -
trunk/psLib/src/image/psImage.c
r2762 r2879 9 9 * @author Ross Harman, MHPCC 10 10 * 11 * @version $Revision: 1.5 5$ $Name: not supported by cvs2svn $12 * @date $Date: 200 4-12-20 21:39:42$11 * @version $Revision: 1.56 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-01-04 02:34:57 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 23 23 #include "psError.h" 24 24 #include "psImage.h" 25 #include "psString.h" 25 26 26 27 #include "psImageErrors.h" … … 146 147 147 148 return psRegionAlloc(col0,col1,row0,row1); 149 } 150 151 char* psRegionToString(psRegion* region) 152 { 153 char tmpText[256]; // big enough to store any region as text 154 155 if (region == NULL) { 156 psError(PS_ERR_BAD_PARAMETER_NULL, true, 157 PS_ERRORTEXT_psImage_REGION_NULL); 158 return NULL; 159 } 160 161 snprintf(tmpText,256,"[%g:%g,%g:%g]", 162 region->x0, region->x1, 163 region->y0, region->y1); 164 165 return psStringCopy(tmpText); 148 166 } 149 167 -
trunk/psLib/src/image/psImage.h
r2375 r2879 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.4 3$ $Name: not supported by cvs2svn $14 * @date $Date: 200 4-11-16 20:00:21$13 * @version $Revision: 1.44 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2005-01-04 02:34:57 $ 15 15 * 16 16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 103 103 ); 104 104 105 /** Create a n image of the specified size and type.106 * 107 * Uses psLib memory allocation functions to create a n image struct ofthe108 * specified size and type.109 * 110 * @return ps Image* : Pointer to psImage.105 /** Create a psRegion with the specified attributes. 106 * 107 * Uses psLib memory allocation functions to create a psRegion the 108 * specified x0, x1, y0, and y1. 109 * 110 * @return psRegion* : Pointer to psRegion. 111 111 * 112 112 */ … … 118 118 ); 119 119 120 /** Create a psRegion with the attribute values given as a string. 121 * 122 * Create a psRegion with the attribute values given as a string. The format 123 * shall be of the standard IRAF form '[x0:x1,y0:y1]' 124 * 125 * @return psRegion*: A new psRegion struct, or NULL is not successful. 126 */ 120 127 psRegion* psRegionFromString( 121 128 char* region ///< image rectangular region in the form '[x0:x1,y0:y1]' 129 ); 130 131 /** Create a string of the standard IRAF form '[x0:x1,y0:y1]' from a psRegion. 132 * 133 * @return char*: A new string representing the psRegion as text, or NULL 134 * is not successful. 135 */ 136 char* psRegionToString( 137 psRegion* region ///< the psRegion to convert to a string 122 138 ); 123 139 -
trunk/psLib/src/image/psImageErrors.dat
r2093 r2879 13 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_REGION_NULL Specified psRegion is NULL. Operation could not be performed. 15 16 psImage_SUBSET_RANGE_INVALID Specified subset range, [%d:%d,%d:%d], is invalid or outside input psImage's boundaries, [0:%d,0:%d]. 16 17 psImage_SUBSET_RANGE_MALFORMED Specified subset range, [%d:%d,%d:%d], is invalid. Ranges must be incremental. … … 67 68 psImageManip_OPERATION_NULL Operation can not be NULL. 68 69 psImageManip_OVERLAY_TYPE_MISMATCH Input overlay psImage type, %s, must match input psImage type, %s. 69 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]. 70 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]. 70 71 psImageManip_OVERLAY_OPERATOR_INVALID Specified operation, '%s', is not supported. 71 72 psImageManip_SCALE_NOT_POSITIVE Specified scale value, %d, must be a positive value. … … 76 77 psImageConvolve_FFT_FAILED Failed to perform a fourier transform of input image. 77 78 psImageConvolve_KERNEL_FFT_FAILED Failed to perform a fourier transform of kernel. 78 psImageConvolve_KERNEL_TOO_LARGE Specified psKernel size, %dx%d, can not be larger than input psImage size, %dx%d. 79 psImage_COEFF_NULL Polynomial coefficients cannot be NULL. 79 psImageConvolve_KERNEL_TOO_LARGE Specified psKernel size, %dx%d, can not be larger than input psImage size, %dx%d. 80 psImage_COEFF_NULL Polynomial coefficients cannot be NULL. -
trunk/psLib/src/image/psImageErrors.h
r2375 r2879 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1.1 1$ $Name: not supported by cvs2svn $10 * @date $Date: 200 4-11-16 20:00:21$9 * @version $Revision: 1.12 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-01-04 02:34:57 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 35 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_REGION_NULL "Specified psRegion is NULL. Operation could not be performed." 37 38 #define PS_ERRORTEXT_psImage_SUBSET_RANGE_INVALID "Specified subset range, [%d:%d,%d:%d], is invalid or outside input psImage's boundaries, [0:%d,0:%d]." 38 39 #define PS_ERRORTEXT_psImage_SUBSET_RANGE_MALFORMED "Specified subset range, [%d:%d,%d:%d], is invalid. Ranges must be incremental." … … 86 87 #define PS_ERRORTEXT_psImageManip_OPERATION_NULL "Operation can not be NULL." 87 88 #define PS_ERRORTEXT_psImageManip_OVERLAY_TYPE_MISMATCH "Input overlay psImage type, %s, must match input psImage type, %s." 88 #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]. "89 #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]." 89 90 #define PS_ERRORTEXT_psImageManip_OVERLAY_OPERATOR_INVALID "Specified operation, '%s', is not supported." 90 91 #define PS_ERRORTEXT_psImageManip_SCALE_NOT_POSITIVE "Specified scale value, %d, must be a positive value." … … 95 96 #define PS_ERRORTEXT_psImageConvolve_FFT_FAILED "Failed to perform a fourier transform of input image." 96 97 #define PS_ERRORTEXT_psImageConvolve_KERNEL_FFT_FAILED "Failed to perform a fourier transform of kernel." 97 #define PS_ERRORTEXT_psImageConvolve_KERNEL_TOO_LARGE "Specified psKernel size, %dx%d, can not be larger than input psImage size, %dx%d. "98 #define PS_ERRORTEXT_psImage_COEFF_NULL "Polynomial coefficients cannot be NULL. "98 #define PS_ERRORTEXT_psImageConvolve_KERNEL_TOO_LARGE "Specified psKernel size, %dx%d, can not be larger than input psImage size, %dx%d." 99 #define PS_ERRORTEXT_psImage_COEFF_NULL "Polynomial coefficients cannot be NULL." 99 100 //~End 100 101 -
trunk/psLib/src/mathtypes/psImage.c
r2762 r2879 9 9 * @author Ross Harman, MHPCC 10 10 * 11 * @version $Revision: 1.5 5$ $Name: not supported by cvs2svn $12 * @date $Date: 200 4-12-20 21:39:42$11 * @version $Revision: 1.56 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-01-04 02:34:57 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 23 23 #include "psError.h" 24 24 #include "psImage.h" 25 #include "psString.h" 25 26 26 27 #include "psImageErrors.h" … … 146 147 147 148 return psRegionAlloc(col0,col1,row0,row1); 149 } 150 151 char* psRegionToString(psRegion* region) 152 { 153 char tmpText[256]; // big enough to store any region as text 154 155 if (region == NULL) { 156 psError(PS_ERR_BAD_PARAMETER_NULL, true, 157 PS_ERRORTEXT_psImage_REGION_NULL); 158 return NULL; 159 } 160 161 snprintf(tmpText,256,"[%g:%g,%g:%g]", 162 region->x0, region->x1, 163 region->y0, region->y1); 164 165 return psStringCopy(tmpText); 148 166 } 149 167 -
trunk/psLib/src/mathtypes/psImage.h
r2375 r2879 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.4 3$ $Name: not supported by cvs2svn $14 * @date $Date: 200 4-11-16 20:00:21$13 * @version $Revision: 1.44 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2005-01-04 02:34:57 $ 15 15 * 16 16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 103 103 ); 104 104 105 /** Create a n image of the specified size and type.106 * 107 * Uses psLib memory allocation functions to create a n image struct ofthe108 * specified size and type.109 * 110 * @return ps Image* : Pointer to psImage.105 /** Create a psRegion with the specified attributes. 106 * 107 * Uses psLib memory allocation functions to create a psRegion the 108 * specified x0, x1, y0, and y1. 109 * 110 * @return psRegion* : Pointer to psRegion. 111 111 * 112 112 */ … … 118 118 ); 119 119 120 /** Create a psRegion with the attribute values given as a string. 121 * 122 * Create a psRegion with the attribute values given as a string. The format 123 * shall be of the standard IRAF form '[x0:x1,y0:y1]' 124 * 125 * @return psRegion*: A new psRegion struct, or NULL is not successful. 126 */ 120 127 psRegion* psRegionFromString( 121 128 char* region ///< image rectangular region in the form '[x0:x1,y0:y1]' 129 ); 130 131 /** Create a string of the standard IRAF form '[x0:x1,y0:y1]' from a psRegion. 132 * 133 * @return char*: A new string representing the psRegion as text, or NULL 134 * is not successful. 135 */ 136 char* psRegionToString( 137 psRegion* region ///< the psRegion to convert to a string 122 138 ); 123 139 -
trunk/psLib/test/image/tst_psImage.c
r2273 r2879 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1. 29$ $Name: not supported by cvs2svn $9 * @date $Date: 200 4-11-04 01:05:00$8 * @version $Revision: 1.30 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2005-01-04 02:34:58 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 23 23 static psS32 testImageAlloc(void); 24 24 static psS32 testImageCopy(void); 25 static psS32 testRegion(void); 25 26 26 27 testDescription tests[] = { … … 28 29 {testImageAlloc,548,"psImageFree",0,true}, 29 30 {testImageCopy,551,"psImageCopy",0,false}, 31 {testRegion,790,"psRegionAlloc",0,false}, 32 {testRegion,791,"psRegionFromString",0,true}, 30 33 {NULL} 31 34 }; … … 394 397 } 395 398 399 static psS32 testRegion(void) 400 { 401 int testNum = 0; 402 403 404 // Testpoint #790 405 406 psRegion* region = psRegionAlloc(1,2,3,4); 407 408 testNum++; 409 if (region == NULL) { 410 psError(PS_ERR_UNKNOWN, false, 411 "psRegionAlloc returned a NULL pointer."); 412 return testNum; 413 } 414 415 testNum++; 416 if (region->x0 != 1 || region->x1 != 2 || region->y0 != 3 || region->y1 != 4) { 417 psError(PS_ERR_UNKNOWN, false, 418 "The region attributes are not set properly (%s)", 419 psRegionToString(region)); 420 return testNum; 421 } 422 423 psFree(region); 424 425 // Testpoint #791 426 427 region = psRegionFromString("[1:2,3:4]"); 428 429 testNum++; 430 if (region == NULL) { 431 psError(PS_ERR_UNKNOWN, false, 432 "psRegionFromString returned a NULL pointer."); 433 return testNum; 434 } 435 436 testNum++; 437 if (region->x0 != 1 || region->x1 != 2 || region->y0 != 3 || region->y1 != 4) { 438 psError(PS_ERR_UNKNOWN, false, 439 "The region attributes are not set properly (%s)", 440 psRegionToString(region)); 441 return testNum; 442 } 443 444 psFree(region); 445 region = psRegionFromString("[1:2,3:]"); 446 447 testNum++; 448 if (region != NULL) { 449 psError(PS_ERR_UNKNOWN, false, 450 "psRegionFromString returned a non-NULL pointer given a malformed string."); 451 return testNum; 452 } 453 454 return 0; 455 } -
trunk/psLib/test/image/verified/tst_psImage.stderr
r2279 r2879 117 117 ---> TESTPOINT PASSED (psImage{psImageCopy} | tst_psImage.c) 118 118 119 /***************************** TESTPOINT ******************************************\ 120 * TestFile: tst_psImage.c * 121 * TestPoint: psImage{psRegionAlloc} * 122 * TestType: Positive * 123 \**********************************************************************************/ 124 125 <DATE><TIME>|<HOST>|E|psRegionFromString (psImage.c:<LINENO>) 126 Specified subsection string, '[1:<LINENO>,3:]', can not be parsed. Must be in the form '[x1:x2,y1:y2]'. 127 128 ---> TESTPOINT PASSED (psImage{psRegionAlloc} | tst_psImage.c) 129
Note:
See TracChangeset
for help on using the changeset viewer.
