- Timestamp:
- Jan 6, 2009, 7:13:34 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branch_20081230/psastro/src/psastroMaskUpdates.Mosaic.c
r20650 r21087 9 9 pmCell *pmCellInChip (pmChip *chip, float x, float y); 10 10 bool pmCellCoordsForChip (float *xCell, float *yCell, pmCell *cell, float xChip, float yChip); 11 bool psastroMaskCircle (psImage *mask, charvalue, float x0, float y0, float dX, float dY);12 bool psastroMaskBox (psImage *mask, charvalue, float x0, float y0, float dL, float dW, float theta);13 void psastroMaskLine (psImage *mask, charvalue, double x1, double y1, double x2, double y2, int dW);14 void psastroMaskLineBresen (psImage *mask, charvalue, int X1, int Y1, int X2, int Y2, int dW, int swapcoords);15 void psastroMaskRectangle (psImage *mask, charvalue, int x0, int y0, int x1, int y1);11 bool psastroMaskCircle (psImage *mask, psImageMaskType value, float x0, float y0, float dX, float dY); 12 bool psastroMaskBox (psImage *mask, psImageMaskType value, float x0, float y0, float dL, float dW, float theta); 13 void psastroMaskLine (psImage *mask, psImageMaskType value, double x1, double y1, double x2, double y2, int dW); 14 void psastroMaskLineBresen (psImage *mask, psImageMaskType value, int X1, int Y1, int X2, int Y2, int dW, int swapcoords); 15 void psastroMaskRectangle (psImage *mask, psImageMaskType value, int x0, int y0, int x1, int y1); 16 16 17 17 // create a mask or mask regions based on the collection of reference stars that are … … 25 25 float zeropt, exptime; 26 26 27 ps MaskType maskValue = pmConfigMaskGet("GHOST", config); // Mask value for ghost pixels28 ps MaskType maskBlank = pmConfigMaskGet("BLANK", config); // Mask value for blank pixels27 psImageMaskType maskValue = pmConfigMaskGet("GHOST", config); // Mask value for ghost pixels 28 psImageMaskType maskBlank = pmConfigMaskGet("BLANK", config); // Mask value for blank pixels 29 29 30 30 // select the current recipe … … 342 342 343 343 // XXX should be doing an OR 344 bool psastroMaskCircle (psImage *mask, charvalue, float x0, float y0, float dX, float dY) {344 bool psastroMaskCircle (psImage *mask, psImageMaskType value, float x0, float y0, float dX, float dY) { 345 345 346 346 // XXX need to worry about row0, col0 … … 357 357 if (r2 > 1.0) continue; 358 358 359 mask->data. U8[jy][jx] |= value;359 mask->data.PS_TYPE_IMAGE_MASK_DATA[jy][jx] |= value; 360 360 } 361 361 } … … 364 364 365 365 // XXX should be doing an OR 366 bool psastroMaskBox (psImage *mask, charvalue, float x0, float y0, float dL, float dW, float theta) {366 bool psastroMaskBox (psImage *mask, psImageMaskType value, float x0, float y0, float dL, float dW, float theta) { 367 367 368 368 // draw a series of lines (from -0.5*dW to +0.5*dW) of length dL, starting at x0, y0, angle theta … … 379 379 380 380 // identify the quadrant and draw the correct line 381 void psastroMaskLine (psImage *mask, charvalue, double x1, double y1, double x2, double y2, int dW) {381 void psastroMaskLine (psImage *mask, psImageMaskType value, double x1, double y1, double x2, double y2, int dW) { 382 382 383 383 int FlipDirect, FlipCoords; … … 408 408 // use the Bresenham line drawing technique 409 409 // integer-only Bresenham line-draw version which is fast 410 void psastroMaskLineBresen (psImage *mask, charvalue, int X1, int Y1, int X2, int Y2, int dW, int swapcoords) {410 void psastroMaskLineBresen (psImage *mask, psImageMaskType value, int X1, int Y1, int X2, int Y2, int dW, int swapcoords) { 411 411 412 412 int X, Y, dX, dY; … … 425 425 if (y < 0) continue; 426 426 if (y >= mask->numCols) continue; 427 mask->data. U8[X][y] |= value;427 mask->data.PS_TYPE_IMAGE_MASK_DATA[X][y] |= value; 428 428 } 429 429 } else { … … 432 432 if (y < 0) continue; 433 433 if (y >= mask->numRows) continue; 434 mask->data. U8[y][X] |= value;434 mask->data.PS_TYPE_IMAGE_MASK_DATA[y][X] |= value; 435 435 } 436 436 } … … 450 450 } 451 451 452 void psastroMaskRectangle (psImage *mask, charvalue, int x0, int y0, int x1, int y1) {452 void psastroMaskRectangle (psImage *mask, psImageMaskType value, int x0, int y0, int x1, int y1) { 453 453 for (int iy = PS_MAX(0,y0); iy < PS_MIN(y1,mask->numRows); iy++) { 454 454 for (int ix = PS_MAX(0,x0); ix < PS_MIN(x1,mask->numCols); ix++) { 455 mask->data. U8[iy][ix] |= value;456 } 457 } 458 } 459 455 mask->data.PS_TYPE_IMAGE_MASK_DATA[iy][ix] |= value; 456 } 457 } 458 } 459
Note:
See TracChangeset
for help on using the changeset viewer.
