Changeset 6750 for trunk/psLib/src/types
- Timestamp:
- Mar 31, 2006, 4:43:57 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/types/psPixels.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/types/psPixels.c
r6500 r6750 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1.2 2$ $Name: not supported by cvs2svn $10 * @date $Date: 2006-0 2-28 02:53:03$9 * @version $Revision: 1.23 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2006-04-01 02:43:57 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 168 168 float y1 = region.y1; 169 169 170 if ( (x0 < 0 || x1 < 0) || (y0 < 0 || y1 < 0) ) { 171 psError(PS_ERR_BAD_PARAMETER_VALUE, true, 172 PS_ERRORTEXT_psPixels_REGION_INVALID, 173 (int)y0,(int)y1,(int)x0,(int)x1); 174 psFree(out); 175 return NULL; 176 } 177 170 178 // determine the output image size 171 179 int numRows = y1-y0; 172 180 int numCols = x1-x0; 181 numRows += 1; 182 numCols += 1; 173 183 if (numRows < 1 || numCols < 1) { 174 184 psError(PS_ERR_BAD_PARAMETER_VALUE, true, … … 205 215 float y = data[p].y; 206 216 // pixel in region? 207 if (x >= x0 && x < x1 && y >= y0 && y <y1) {217 if (x >= x0 && x <= x1 && y >= y0 && y <= y1) { 208 218 outData[(int)(y-y0)][(int)(x-x0)] |= maskVal; 209 219 }
Note:
See TracChangeset
for help on using the changeset viewer.
