Changeset 6940 for trunk/psLib/src/imageops/psImageStats.c
- Timestamp:
- Apr 21, 2006, 11:07:47 AM (20 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/imageops/psImageStats.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/imageops/psImageStats.c
r6874 r6940 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1.9 3$ $Name: not supported by cvs2svn $12 * @date $Date: 2006-04- 17 22:00:03$11 * @version $Revision: 1.94 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2006-04-21 21:07:47 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 679 679 if (col0 == 0 && col1 == 0 && row0 == 0 && row1 == 0) { 680 680 col0 = mask->col0; 681 col1 = mask->col0 + mask->numCols - 1;681 col1 = mask->col0 + mask->numCols; 682 682 row0 = mask->row0; 683 row1 = mask->row0 + mask->numRows - 1;683 row1 = mask->row0 + mask->numRows; 684 684 } 685 685 686 686 //Make sure x0 of region is inside image. If so, set col0 to corresponding index number. 687 if (col0 >= mask->col0 && col0 < (mask->col0 + mask->numCols) ) {687 if (col0 >= mask->col0 && col0 <= (mask->col0 + mask->numCols) ) { 688 688 col0 -= mask->col0; 689 689 } else { 690 690 psError(PS_ERR_BAD_PARAMETER_VALUE, true, 691 691 "Specified psRegion parameter, x0=%f, is out of range [%d,%d].\n", 692 region.x0, mask->col0, mask->col0+mask->numCols -1);692 region.x0, mask->col0, mask->col0+mask->numCols); 693 693 return -1; 694 694 } 695 695 //Make sure y0 of region is inside image. If so, set row0 to corresponding index number. 696 if (row0 >= mask->row0 && row0 < (mask->row0 + mask->numRows) ) {696 if (row0 >= mask->row0 && row0 <= (mask->row0 + mask->numRows) ) { 697 697 row0 -= mask->row0; 698 698 } else { 699 699 psError(PS_ERR_BAD_PARAMETER_VALUE, true, 700 700 "Specified psRegion parameter, y0=%f, is out of range [%d,%d].\n", 701 region.y0, mask->row0, mask->row0+mask->numRows -1);701 region.y0, mask->row0, mask->row0+mask->numRows); 702 702 return -1; 703 703 } … … 709 709 psError(PS_ERR_BAD_PARAMETER_VALUE, true, 710 710 "Specified psRegion parameter, x1=%f=%d, is out of range [%d,%d].\n", 711 region.x1, col1+mask->col0, mask->col0, mask->col0+mask->numCols -1);711 region.x1, col1+mask->col0, mask->col0, mask->col0+mask->numCols); 712 712 return -1; 713 713 } 714 } else if (col1 >= mask->col0 && col1 < (mask->col0 + mask->numCols) ) {714 } else if (col1 >= mask->col0 && col1 <= (mask->col0 + mask->numCols) ) { 715 715 col1 -= mask->col0; 716 716 } else { 717 717 psError(PS_ERR_BAD_PARAMETER_VALUE, true, 718 718 "Specified psRegion parameter, x1=%f=%d, is out of range [%d,%d].\n", 719 region.x1, col1, mask->col0, mask->col0+mask->numCols -1);719 region.x1, col1, mask->col0, mask->col0+mask->numCols); 720 720 return -1; 721 721 } … … 726 726 psError(PS_ERR_BAD_PARAMETER_VALUE, true, 727 727 "Specified psRegion parameter, y1=%f=%d, is out of range [%d,%d].\n", 728 region.y1, row1+mask->row0, mask->row0, mask->row0+mask->numRows -1);728 region.y1, row1+mask->row0, mask->row0, mask->row0+mask->numRows); 729 729 return -1; 730 730 } 731 } else if (row1 >= mask->row0 && row1 < (mask->row0 + mask->numRows) ) {731 } else if (row1 >= mask->row0 && row1 <= (mask->row0 + mask->numRows) ) { 732 732 row1 -= mask->row0; 733 733 } else { 734 734 psError(PS_ERR_BAD_PARAMETER_VALUE, true, 735 735 "Specified psRegion parameter, y1=%f=%d, is out of range [%d,%d].\n", 736 region.y1, row1, mask->row0, mask->row0+mask->numRows -1);736 region.y1, row1, mask->row0, mask->row0+mask->numRows); 737 737 return -1; 738 738 } … … 750 750 return -1; 751 751 }/* else if (col0 == col1 && row0 == row1) { 752 psError(PS_ERR_BAD_PARAMETER_VALUE, true,753 "Invalid psRegion specified. Region contains only 1 pixel.\n");754 return -1;755 }756 */752 psError(PS_ERR_BAD_PARAMETER_VALUE, true, 753 "Invalid psRegion specified. Region contains only 1 pixel.\n"); 754 return -1; 755 } 756 */ 757 757 x0 = col0; 758 758 x1 = col1;
Note:
See TracChangeset
for help on using the changeset viewer.
