Changeset 25082 for trunk/magic/remove/src/warpedpixels.c
- Timestamp:
- Aug 14, 2009, 3:58:07 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/magic/remove/src/warpedpixels.c (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/magic/remove/src/warpedpixels.c
r21438 r25082 23 23 24 24 psRegion *bounds = pmChipPixels(sf->chip); 25 25 26 26 int width = bounds->x1 - bounds->x0; 27 27 int height = bounds->y1 - bounds->y0; … … 83 83 84 84 /* now set up our wrapper to the chip astrometry to apply to the whole chip */ 85 sf->astrom = streakSetAstrometry(sf->astrom, sf->stage, sf->inAstrom->fpa, sf->chip, false, NULL, 85 sf->astrom = streakSetAstrometry(sf->astrom, sf->stage, sf->inAstrom->fpa, sf->chip, false, NULL, 86 86 sf->warpedPixels->numCols, sf->warpedPixels->numRows); 87 87 … … 106 106 // convert corner of skycell to sky coordinates 107 107 if (!pmAstromWCStoSky(&sky, wcs, &pt[i])) { 108 psError (PS_ERR_IO, false, "failed to convert pt %d of %s to sky coords: %s", fileName);108 psErrorStackPrint(stderr, "failed to convert pt %d of %s to sky coords", i, fileName); 109 109 streaksExit("", PS_EXIT_DATA_ERROR); 110 110 } … … 112 112 // convert to chip coordinates 113 113 if (!skyToCell(&p, sf->astrom, sky.r, sky.d)) { 114 psError (PS_ERR_IO, false, "failed to convert pt %d of %s to sky coords: %s", fileName);114 psErrorStackPrint(stderr, "failed to convert pt %d of %s to sky coords", i, fileName); 115 115 streaksExit("", PS_EXIT_DATA_ERROR); 116 116 } … … 171 171 } 172 172 173 // x as a function of y for the line between two points 173 // x as a function of y for the line between two points 174 174 // Note: the caller guarentees that the y's of the two points are different 175 175 static double xOfY(psPlane *pI, psPlane *pJ, int y) … … 212 212 * To compute the overlap of a quadrilateral with a set of 213 213 * points we transform the 4 corners to image coordinates 214 * and name the 4 points of the quad 214 * and name the 4 points of the quad 215 215 pt 0 is left most (bottom most corner) 216 216 pt 1 is bottom most (right most corner) … … 238 238 239 239 3 240 C 240 C 241 241 ---------------2 left boundary: line 0_1 y < pt0.y 242 242 B line 0_3 y >= pt0.y … … 249 249 C 250 250 0---------------- 251 B 251 B 252 252 ----------------2 253 253 A … … 258 258 259 259 3 2 260 260 261 261 B 262 262 … … 265 265 (region A and C are empty in the case where the points form a rectangle) 266 266 */ 267 267 268 268 /* 269 269 Name the corners 270 The following algorithm works for points that form a quadrilateral 270 The following algorithm works for points that form a quadrilateral 271 271 I think it also works for the situation where 3 points are co-linear 272 272 and we have a triangle, but that isn't important for our purposes … … 313 313 pt[i] = pt[i+1]; 314 314 } 315 315 316 316 // now find the right most (top most) of the remaining 2 points 317 317 if ((pt[0].x > pt[1].x) ||
Note:
See TracChangeset
for help on using the changeset viewer.
