Changeset 6805
- Timestamp:
- Apr 5, 2006, 6:12:27 PM (20 years ago)
- Location:
- trunk/psLib
- Files:
-
- 2 edited
-
src/imageops/psImagePixelExtract.c (modified) (4 diffs)
-
test/imageops/tst_psImageGeomManip.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/imageops/psImagePixelExtract.c
r6778 r6805 8 8 * @author Robert DeSonia, MHPCC 9 9 * 10 * @version $Revision: 1.1 6$ $Name: not supported by cvs2svn $11 * @date $Date: 2006-04-0 5 01:49:40$10 * @version $Revision: 1.17 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2006-04-06 04:12:27 $ 12 12 * 13 13 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 351 351 region.y0, input->row0, input->row0+input->numRows-1); 352 352 return NULL; 353 } 354 355 //If [0,0,0,0] specified, the whole image is to be included 356 if (row0 == 0 && col0 == 0 && row1 == 0 && col1 == 0) { 357 row0 = input->row0; 358 col0 = input->col0; 359 row1 = input->row0 + input->numRows; 360 col1 = input->col0 + input->numCols; 353 361 } 354 362 … … 667 675 float row1 = region.y1; 668 676 677 //If [0,0,0,0] specified, the whole image is to be included 678 if (row0 == 0 && col0 == 0 && row1 == 0 && col1 == 0) { 679 row0 = input->row0; 680 col0 = input->col0; 681 row1 = input->row0 + input->numRows; 682 col1 = input->col0 + input->numCols; 683 } 684 669 685 //Make sure x0 of region is inside image. If so, set col0 to corresponding index number. 670 686 if (col0 >= input->col0 && col0 < (input->col0 + input->numCols) ) { … … 831 847 } 832 848 833 if (x < 0 || x >= numCols || 834 y < 0 || y >= numRows) { 849 // if (x < 0 || x >= numCols || 850 // y < 0 || y >= numRows) { 851 if (x < input->col0 || x >= (input->col0 + numCols) || 852 y < input->row0 || y >= (input->row0 + numRows) ) { 835 853 psError(PS_ERR_BAD_PARAMETER_VALUE, true, 836 854 PS_ERRORTEXT_psImage_CENTER_NOT_IN_IMAGE, -
trunk/psLib/test/imageops/tst_psImageGeomManip.c
r6767 r6805 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $9 * @date $Date: 2006-04-0 4 19:52:54$8 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2006-04-06 04:12:27 $ 10 10 * 11 11 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 1089 1089 } 1090 1090 } 1091 1091 in->col0 = 1; 1092 1092 psImage* out = psImageTransform(NULL, 1093 1093 NULL, … … 1096 1096 0, 1097 1097 trans, 1098 psRegionSet( 0,cols*2,0,rows*2),1098 psRegionSet(1,1+cols*2,0,rows*2), 1099 1099 NULL, 1100 1100 PS_INTERPOLATE_FLAT, … … 1123 1123 for (psS32 col=0;col<cols;col++) { 1124 1124 float inValue = p_psImagePixelInterpolateFLAT_F32(in, 1125 col*trans->x->coeff[1][0]+trans->x->coeff[0][0] ,1125 col*trans->x->coeff[1][0]+trans->x->coeff[0][0]+1, 1126 1126 row*trans->y->coeff[0][1]+trans->y->coeff[0][0], 1127 1127 NULL, 0, 1128 1128 -1); 1129 if (fabsf(outRow[col] - inValue) > FLT_EPSILON*10) {1129 if (fabsf(outRow[col] - inValue) > 0.01) { 1130 1130 psError(PS_ERR_UNKNOWN, false, 1131 1131 "out at %d,%d was %g, expected %g",
Note:
See TracChangeset
for help on using the changeset viewer.
