Changeset 2835 for trunk/psLib/test/image/tst_psImageManip.c
- Timestamp:
- Dec 27, 2004, 3:43:17 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/image/tst_psImageManip.c (modified) (21 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/image/tst_psImageManip.c
r2754 r2835 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1.3 2$ $Name: not supported by cvs2svn $9 * @date $Date: 2004-12- 18 00:01:08$8 * @version $Revision: 1.33 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2004-12-28 01:43:17 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 331 331 1. Create a complex image with a wide range of complex values 332 332 333 2. call psImageClipComplexRegion with min and max where there is at least 333 2. call psImageClipComplexRegion with min and max where there is at least 334 334 2 pixels in the image above) that is: 335 335 a) real(p) < real(min) && complex(p) < complex(min), … … 347 347 4. verify that all pixels in case (d) are unchanged from input 348 348 349 5. verify that all pixels in case (e), (f), (g), (h), and (i) have the 349 5. verify that all pixels in case (e), (f), (g), (h), and (i) have the 350 350 value vmax 351 351 … … 606 606 */ 607 607 608 609 610 608 #define testOverlayTypeOP(DATATYPE,OP,OPSTRING) \ 611 609 img = psImageAlloc(c,r,PS_TYPE_##DATATYPE); \ … … 624 622 } \ 625 623 retVal = psImageOverlaySection(img,img2,c/4,r/4,OPSTRING); \ 626 if (retVal != 0) { \ 627 psError(PS_ERR_UNKNOWN, true,"psImageOverlaySection returned non-zero %s op",OPSTRING); \ 624 if (retVal == 0) { \ 625 psError(PS_ERR_UNKNOWN, true,"psImageOverlaySection returned zero with %s op", \ 626 OPSTRING); \ 628 627 return 1; \ 629 628 } \ … … 705 704 "within image boundaries"); 706 705 retVal = psImageOverlaySection(img,img2,c/4,r/4,"+"); 707 if (retVal == 0) {708 psError(PS_ERR_UNKNOWN, true,"psImageOverlaySection returned zero even though"709 " overlay too big");706 if (retVal != 0) { 707 psError(PS_ERR_UNKNOWN, true,"psImageOverlaySection did not return " 708 "zero even though overlay too big"); 710 709 return 3; 711 710 } … … 728 727 psLogMsg(__func__,PS_LOG_INFO,"Following should error as overlay is NULL"); 729 728 retVal = psImageOverlaySection(img,NULL,c/4,r/4,"+"); 730 if (retVal == 0) {731 psError(PS_ERR_UNKNOWN, true,"psImageOverlaySection returned zero even though"732 " overlay too big");729 if (retVal != 0) { 730 psError(PS_ERR_UNKNOWN, true,"psImageOverlaySection did not return " 731 "zero even though overlay too big"); 733 732 return 5; 734 733 } … … 750 749 psLogMsg(__func__,PS_LOG_INFO,"Following should error as image input is NULL"); 751 750 retVal = psImageOverlaySection(NULL,img2,c/4,r/4,"+"); 752 if (retVal == 0) {753 psError(PS_ERR_UNKNOWN, true,"psImageOverlaySection returned zero even though "751 if (retVal != 0) { 752 psError(PS_ERR_UNKNOWN, true,"psImageOverlaySection returned non-zero even though " 754 753 "overlay too big"); 755 754 return 7; … … 763 762 psLogMsg(__func__,PS_LOG_INFO,"Following should error as operator is invalid"); 764 763 retVal = psImageOverlaySection(img,img2,0,0,"$"); 765 if (retVal == 0) {766 psError(PS_ERR_UNKNOWN, true,"psImageOverlaySection returned zero even though "764 if (retVal != 0) { 765 psError(PS_ERR_UNKNOWN, true,"psImageOverlaySection returned non-zero even though " 767 766 "overlay operator is invalid"); 768 767 return 8; … … 776 775 psLogMsg(__func__,PS_LOG_INFO,"Following should error as operator is invalid"); 777 776 retVal = psImageOverlaySection(img,img2,0,0,NULL); 778 if(retVal == 0) {779 psError(PS_ERR_UNKNOWN, true,"psImageOverlaySection returned zero even though "777 if(retVal != 0) { 778 psError(PS_ERR_UNKNOWN, true,"psImageOverlaySection returned non-zero even though " 780 779 "overlay operator is NULL"); 781 780 return 9; … … 783 782 784 783 /* 785 Verify the return integer is equal to non-zero and program execution 784 Verify the return integer is equal to non-zero and program execution 786 785 doesn't stop, if overlay image is a different type than the input image 787 786 */ … … 789 788 "a different type"); 790 789 retVal = psImageOverlaySection(img,img3,0,0,"+"); 791 if(retVal == 0) {792 psError(PS_ERR_UNKNOWN, true,"psImageOverlaySection returned zero eventhough "790 if(retVal != 0) { 791 psError(PS_ERR_UNKNOWN, true,"psImageOverlaySection returned nonzero eventhough " 793 792 " overlay image type is different than input image."); 794 793 return 10; 795 }796 797 /*798 Verify the return integer is equal to non-zero and program execution799 doesn't stop, if invalid input and overlay images800 */801 psLogMsg(__func__,PS_LOG_INFO,"Following should error as overlay and "802 "image are not valid for the psImageOverlaySection function.");803 retVal = psImageOverlaySection(img3,img4,0,0,"+");804 if(retVal == 0) {805 psError(PS_ERR_UNKNOWN, true,"psImageOverlaySection returned zero eventhough "806 "overlay and image type are invalid type.");807 return 11;808 794 } 809 795 … … 819 805 } 820 806 retVal = psImageOverlaySection(img,img2,0,0,"/"); 821 if (retVal != 0) {822 psError(PS_ERR_UNKNOWN, true,"psImageOverlaySection returned non-zero when "807 if (retVal == 0) { 808 psError(PS_ERR_UNKNOWN, true,"psImageOverlaySection returned zero when " 823 809 "checking divide-by-zero."); 824 810 return 12; … … 837 823 838 824 /* 839 This function shall generate a rescaled version of a psImage structure 825 This function shall generate a rescaled version of a psImage structure 840 826 derived from a specified statistics method. 841 827 */ … … 852 838 853 839 /* 854 Verify the returned psImage structure contains expected values, if the 855 input parameter input contains known data, the input scale is a known 856 value with a known statistical method specified in stats. Cases should 857 include at least two different scales and statistical methods. Comparison 858 of expected values should include a delta to allow testing on different 840 Verify the returned psImage structure contains expected values, if the 841 input parameter input contains known data, the input scale is a known 842 value with a known statistical method specified in stats. Cases should 843 include at least two different scales and statistical methods. Comparison 844 of expected values should include a delta to allow testing on different 859 845 platforms. 860 846 */ … … 1094 1080 1095 1081 /* 1096 The function psImageRoll shall generate a new psImage structure by 1082 The function psImageRoll shall generate a new psImage structure by 1097 1083 rolling the input image the correponding number of pixels in the vertical 1098 1084 and/or horizontal direction. The image output image shall be the same size 1099 as the input image. Values which roll off the image are wrapped to the 1085 as the input image. Values which roll off the image are wrapped to the 1100 1086 other side. 1101 1087 1102 Verify the returned psImage structure contains expected values, if the 1103 input image contains known values and the roll performed is known. 1104 Cases should include no roll, vertical roll, horizontal roll and 1105 combination vertical/horizontal rolls. Positive and negative rolls 1088 Verify the returned psImage structure contains expected values, if the 1089 input image contains known values and the roll performed is known. 1090 Cases should include no roll, vertical roll, horizontal roll and 1091 combination vertical/horizontal rolls. Positive and negative rolls 1106 1092 should be performed. 1107 1093 */ … … 1274 1260 /* 1275 1261 1276 This function shall calculate a new psImage structure based upon the 1277 rotation of a given psImage structure. The center of rotation shall be the 1262 This function shall calculate a new psImage structure based upon the 1263 rotation of a given psImage structure. The center of rotation shall be the 1278 1264 center pixel of the input image. 1279 1265 1280 The following steps of the testpoint are done manually via inspection of 1266 The following steps of the testpoint are done manually via inspection of 1281 1267 temp/fOut.fits & temp/sOut.fits. 1282 1268 1283 * Verify the returned psImage structure contains expected values, if 1284 the input parameter psImage contains known values. Cases should 1285 include rotations of 0, 45, 90, 135, 180, 225, 270, 315, 360 and at leat one 1269 * Verify the returned psImage structure contains expected values, if 1270 the input parameter psImage contains known values. Cases should 1271 include rotations of 0, 45, 90, 135, 180, 225, 270, 315, 360 and at leat one 1286 1272 other arbitrary angle. Cases of the input image should include image 1287 1273 with a center pixel and an image without a center pixel. … … 1541 1527 /* psImageShift: 1542 1528 1543 This functions shall generate a new psImage structure by shifting the 1544 input psImage structure a specified number of pixels in the horizontal 1529 This functions shall generate a new psImage structure by shifting the 1530 input psImage structure a specified number of pixels in the horizontal 1545 1531 and/or vertical directions. 1546 1532 1547 Verify the returned psImage structure contains expected values, if the 1548 input psImage structure contains known values and a know shift in the 1549 vertical and/or horizontal directions. Cases should include no shift, 1550 vertical only(up,down), horizontal only(right, left), and combination 1551 shift. Cases should include fractional shifts. Comparison of expected 1552 values should include a delta to allow for testing on different 1533 Verify the returned psImage structure contains expected values, if the 1534 input psImage structure contains known values and a know shift in the 1535 vertical and/or horizontal directions. Cases should include no shift, 1536 vertical only(up,down), horizontal only(right, left), and combination 1537 shift. Cases should include fractional shifts. Comparison of expected 1538 values should include a delta to allow for testing on different 1553 1539 platforms. 1554 1540 1555 Verify the returned psImage structure contains values for pixels not in 1541 Verify the returned psImage structure contains values for pixels not in 1556 1542 the original image set to the input parameter exposed. 1557 1543 … … 1590 1576 1591 1577 /* 1592 Verify the returned psImage structure pointer is equal to the input 1578 Verify the returned psImage structure pointer is equal to the input 1593 1579 parameter out if provided. 1594 1580 */ … … 1603 1589 1604 1590 /* 1605 Verify the returned psImage structure pointer is null and program 1591 Verify the returned psImage structure pointer is null and program 1606 1592 execution doesn't stop, if the input psImage structure pointer is null. 1607 1593 */ … … 1820 1806 psErrorClear(); 1821 1807 psImage* invImage = psImageAlloc(cols,rows,PS_TYPE_PTR); 1808 memset(invImage->rawDataBuffer,0,cols*rows*sizeof(psPtr)); // make sure the image is of all NULLs 1822 1809 result = psImageResample(result,invImage,2,PS_INTERPOLATE_FLAT); 1823 1810 if (result != NULL) {
Note:
See TracChangeset
for help on using the changeset viewer.
