Changeset 5595
- Timestamp:
- Nov 25, 2005, 1:24:49 PM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_rel8_b2/psLib/src/imageops/psImageStats.c
r5558 r5595 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1.83.4.1 $ $Name: not supported by cvs2svn $12 * @date $Date: 2005-11- 16 22:50:22$11 * @version $Revision: 1.83.4.1.4.1 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-11-25 23:24:49 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 652 652 return -1; 653 653 } 654 if (region.x1 > mask->numCols || region.y1 > mask->numRows) { 655 psError(PS_ERR_BAD_PARAMETER_SIZE, true, 656 "psRegion input is outside of image boundary\n"); 657 return -1; 658 } 659 if (region.x0 <= 0 || region.x1 <= 0 || region.y0 <= 0 || region.y1 <= 0) { 660 region = psRegionForImage(mask, region); 661 } 662 if (region.x0 > region.x1 || region.y0 > region.y1) { 663 psError(PS_ERR_BAD_PARAMETER_VALUE, true, 664 "Invalid region. Lower boundary greater than upper boundary.\n"); 665 return -1; 666 } 654 655 // rationalize the region 656 region = psRegionForImage(mask, region); 657 658 // XXX EAM : should this really be an error, or simply return 0? 667 659 if (region.x0 == region.x1 || region.y0 == region.y1) { 668 660 psError(PS_ERR_BAD_PARAMETER_SIZE, true, … … 686 678 case PS_TYPE_U8: 687 679 case PS_TYPE_U16: 688 for (long i = x0; i < x1; i++) {689 for (long j = y0; j < y1; j++) {690 if (mask->data.PS_TYPE_MASK_DATA[ i][j] & value) {680 for (long j = y0; j < y1; j++) { 681 for (long i = x0; i < x1; i++) { 682 if (mask->data.PS_TYPE_MASK_DATA[j][i] & value) { 691 683 Npixels ++; 692 684 }
Note:
See TracChangeset
for help on using the changeset viewer.
