Changeset 1934
- Timestamp:
- Sep 30, 2004, 10:32:21 AM (22 years ago)
- Location:
- trunk/psLib/test/image
- Files:
-
- 2 edited
-
tst_psImageManip.c (modified) (7 diffs)
-
verified/tst_psImageManip.stderr (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/image/tst_psImageManip.c
r1931 r1934 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1.2 6$ $Name: not supported by cvs2svn $9 * @date $Date: 2004-09-30 18:47:23$8 * @version $Revision: 1.27 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2004-09-30 20:32:21 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 1611 1611 } 1612 1612 1613 // Verify the returned psImage structure is null and program execution 1614 // doesn't stop, if the specified interpolation mode is invalid. 1615 psLogMsg(__func__,PS_LOG_INFO,"Following should be an error for invalid interpolation mode."); 1616 fOut = psImageShift(fOut,fImg,8,8,NAN,-1); 1617 if (fOut != NULL ) { 1618 psError(__func__,"psImageShift didn't return NULL given an invalid interpolation mode."); 1619 return 12; 1620 } 1621 1613 1622 psFree(fImg); 1614 1623 … … 1629 1638 psImage* fImg = psImageAlloc(cols,rows,PS_TYPE_F32); 1630 1639 psImage* sImg = psImageAlloc(cols,rows,PS_TYPE_S16); 1640 psImage* fBiOut = psImageAlloc(cols,rows,PS_TYPE_F32); 1641 psImage* sBiOut = psImageAlloc(cols,rows,PS_TYPE_S16); 1631 1642 1632 1643 for(int row=0;row<rows;row++) { … … 1641 1652 fOut = psImageShift(fOut, fImg, colShift, rowShift, NAN, PS_INTERPOLATE_FLAT); 1642 1653 sOut = psImageShift(sOut, sImg, colShift, rowShift, -1, PS_INTERPOLATE_FLAT); 1654 fBiOut = psImageShift(fBiOut, fImg, colShift, rowShift, NAN, PS_INTERPOLATE_BILINEAR); 1655 sBiOut = psImageShift(sBiOut, sImg, colShift, rowShift, -1, PS_INTERPOLATE_BILINEAR); 1643 1656 1644 1657 for(int row=0;row<rows;row++) { 1645 1658 psF32* fRow = fOut->data.F32[row]; 1646 1659 psS16* sRow = sOut->data.S16[row]; 1660 psF32* fBiRow = fBiOut->data.F32[row]; 1661 psS16* sBiRow = sBiOut->data.S16[row]; 1662 1647 1663 for (int col=0;col<cols;col++) { 1648 1664 psF32 fValue = psImagePixelInterpolate(fImg,col+colShift, … … 1650 1666 psS16 sValue = (psS16)psImagePixelInterpolate(sImg,col+colShift, 1651 1667 row+rowShift,NULL,0,-1,PS_INTERPOLATE_FLAT); 1668 1669 psF32 fBiValue = psImagePixelInterpolate(fImg,col+colShift, 1670 row+rowShift,NULL,0,NAN,PS_INTERPOLATE_BILINEAR); 1671 psS16 sBiValue = (psS16)psImagePixelInterpolate(sImg,col+colShift, 1672 row+rowShift,NULL,0,-1,PS_INTERPOLATE_BILINEAR); 1652 1673 1653 1674 if (fabsf(fRow[col] - fValue) > FLT_EPSILON) { … … 1661 1682 return 2; 1662 1683 } 1684 if (fabsf(fBiRow[col] - fBiValue) > FLT_EPSILON) { 1685 psError(__func__,"Float image not shifted correctly at %d,%d (%g vs %g)", 1686 col,row,fBiRow[col],fBiValue); 1687 return 1; 1688 } 1689 if (sBiRow[col] != sBiValue) { 1690 psError(__func__,"Short image not shifted correctly at %d,%d (%d vs %d)", 1691 col,row,sBiRow[col],sBiValue); 1692 return 2; 1693 } 1663 1694 } 1664 1695 } … … 1668 1699 psFree(fOut); 1669 1700 psFree(sOut); 1701 psFree(fBiOut); 1702 psFree(sBiOut); 1670 1703 1671 1704 return 0; -
trunk/psLib/test/image/verified/tst_psImageManip.stderr
r1931 r1934 298 298 <DATE><TIME>|<HOST>|E|psLib.image.psImageShift 299 299 Can not operate on a NULL psImage. 300 <DATE><TIME>|<HOST>|I|testImageShift 301 Following should be an error for invalid interpolation mode. 302 <DATE><TIME>|<HOST>|E|psLib.image.psImageShift 303 Specified interpolation mode, -1, is unsupported. 300 304 301 305 ---> TESTPOINT PASSED (psImage{psImageShift} | tst_psImageManip.c)
Note:
See TracChangeset
for help on using the changeset viewer.
