Changeset 6375
- Timestamp:
- Feb 7, 2006, 7:43:56 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_rel9_b1/psLib/src/mathtypes/psImage.c
r5752 r6375 9 9 * @author Ross Harman, MHPCC 10 10 * 11 * @version $Revision: 1.92.4.1 $ $Name: not supported by cvs2svn $12 * @date $Date: 200 5-12-07 20:55:18$11 * @version $Revision: 1.92.4.1.2.1 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2006-02-08 05:43:56 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 168 168 // - flip x0,x1 if x0>x1 169 169 // - flip y0,y1 if y0>y1 170 // psRegion in refers to coordinates in the170 // XXX EAM : psRegion refers to coordinates in the *parent* image 171 171 psRegion psRegionForImage(psImage *image, 172 172 psRegion in) … … 178 178 179 179 // convert non-positive upper-limits 180 in.x1 = (in.x1 <= 0) ? (image->numCols + in.x1) : in.x1; 181 in.y1 = (in.y1 <= 0) ? (image->numRows + in.y1) : in.y1; 182 183 // force the upper-limits to be on the image 184 in.x1 = PS_MIN(image->numCols, in.x1); 185 in.y1 = PS_MIN(image->numRows, in.y1); 186 187 // force the lower-limits to be on the image 188 in.x0 = PS_MAX(0, in.x0); 189 in.y0 = PS_MAX(0, in.y0); 190 in.x0 = PS_MIN(image->numCols, in.x0); 191 in.y0 = PS_MIN(image->numRows, in.y0); 180 // XXX note that the upper limit in these cases is defined relative to the subimage 181 // also note that truncation limits to the valid subimage pixels 182 in.x1 = (in.x1 <= 0) ? (image->col0 + image->numCols + in.x1) : in.x1; 183 in.y1 = (in.y1 <= 0) ? (image->row0 + image->numRows + in.y1) : in.y1; 184 185 // force the upper-limits to be on the subimage 186 in.x1 = PS_MIN(image->col0 + image->numCols, in.x1); 187 in.y1 = PS_MIN(image->row0 + image->numRows, in.y1); 188 189 // force the lower-limits to be on the subimage 190 in.x0 = PS_MAX(image->col0, in.x0); 191 in.y0 = PS_MAX(image->row0, in.y0); 192 in.x0 = PS_MIN(image->col0 + image->numCols, in.x0); 193 in.y0 = PS_MIN(image->row0 + image->numRows, in.y0); 192 194 193 195 // flip start and end if out of order
Note:
See TracChangeset
for help on using the changeset viewer.
