Changeset 21183 for trunk/psastro/src/psastroMaskUpdates.c
- Timestamp:
- Jan 26, 2009, 8:40:07 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/psastro/src/psastroMaskUpdates.c (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psastro/src/psastroMaskUpdates.c
r21018 r21183 11 11 bool pmChipCoordsForCell (float *xChip, float *yChip, pmCell *cell, float xCell, float yCell); 12 12 13 bool psastroMaskCircle (psImage *mask, charvalue, float x0, float y0, float dX, float dY);14 bool psastroMaskBox (psImage *mask, charvalue, float x0, float y0, float dL, float dW, float theta);15 void psastroMaskLine (psImage *mask, charvalue, double x1, double y1, double x2, double y2, int dW);16 void psastroMaskLineBresen (psImage *mask, charvalue, int X1, int Y1, int X2, int Y2, int dW, int swapcoords);17 void psastroMaskRectangle (psImage *mask, charvalue, int x0, int y0, int x1, int y1);13 bool psastroMaskCircle (psImage *mask, psImageMaskType value, float x0, float y0, float dX, float dY); 14 bool psastroMaskBox (psImage *mask, psImageMaskType value, float x0, float y0, float dL, float dW, float theta); 15 void psastroMaskLine (psImage *mask, psImageMaskType value, double x1, double y1, double x2, double y2, int dW); 16 void psastroMaskLineBresen (psImage *mask, psImageMaskType value, int X1, int Y1, int X2, int Y2, int dW, int swapcoords); 17 void psastroMaskRectangle (psImage *mask, psImageMaskType value, int x0, int y0, int x1, int y1); 18 18 19 19 // create a mask or mask regions based on the collection of reference stars that are … … 27 27 float zeropt, exptime; 28 28 29 ps MaskType maskValue = pmConfigMaskGet("GHOST", config); // Mask value for ghost pixels30 31 // ps MaskType maskBlank = pmConfigMaskGet("BLANK", config); // Mask value for blank pixels29 psImageMaskType maskValue = pmConfigMaskGet("GHOST", config); // Mask value for ghost pixels 30 31 // psImageMaskType maskBlank = pmConfigMaskGet("BLANK", config); // Mask value for blank pixels 32 32 33 33 // select the current recipe … … 376 376 377 377 // XXX should be doing an OR 378 bool psastroMaskCircle (psImage *mask, charvalue, float x0, float y0, float dX, float dY) {378 bool psastroMaskCircle (psImage *mask, psImageMaskType value, float x0, float y0, float dX, float dY) { 379 379 380 380 // XXX need to worry about row0, col0 … … 391 391 if (r2 > 1.0) continue; 392 392 393 mask->data. U8[jy][jx] |= value;393 mask->data.PS_TYPE_IMAGE_MASK_DATA[jy][jx] |= value; 394 394 } 395 395 } … … 398 398 399 399 // XXX should be doing an OR 400 bool psastroMaskBox (psImage *mask, charvalue, float x0, float y0, float dL, float dW, float theta) {400 bool psastroMaskBox (psImage *mask, psImageMaskType value, float x0, float y0, float dL, float dW, float theta) { 401 401 402 402 // draw a series of lines (from -0.5*dW to +0.5*dW) of length dL, starting at x0, y0, angle theta … … 413 413 414 414 // identify the quadrant and draw the correct line 415 void psastroMaskLine (psImage *mask, charvalue, double x1, double y1, double x2, double y2, int dW) {415 void psastroMaskLine (psImage *mask, psImageMaskType value, double x1, double y1, double x2, double y2, int dW) { 416 416 417 417 int FlipDirect, FlipCoords; … … 442 442 // use the Bresenham line drawing technique 443 443 // integer-only Bresenham line-draw version which is fast 444 void psastroMaskLineBresen (psImage *mask, charvalue, int X1, int Y1, int X2, int Y2, int dW, int swapcoords) {444 void psastroMaskLineBresen (psImage *mask, psImageMaskType value, int X1, int Y1, int X2, int Y2, int dW, int swapcoords) { 445 445 446 446 int X, Y, dX, dY; … … 459 459 if (y < 0) continue; 460 460 if (y >= mask->numCols) continue; 461 mask->data. U8[X][y] |= value;461 mask->data.PS_TYPE_IMAGE_MASK_DATA[X][y] |= value; 462 462 } 463 463 } else { … … 466 466 if (y < 0) continue; 467 467 if (y >= mask->numRows) continue; 468 mask->data. U8[y][X] |= value;468 mask->data.PS_TYPE_IMAGE_MASK_DATA[y][X] |= value; 469 469 } 470 470 } … … 484 484 } 485 485 486 void psastroMaskRectangle (psImage *mask, charvalue, int x0, int y0, int x1, int y1) {486 void psastroMaskRectangle (psImage *mask, psImageMaskType value, int x0, int y0, int x1, int y1) { 487 487 488 488 int xs = PS_MAX (0, PS_MIN (mask->numCols, PS_MIN (x0, x1))); … … 493 493 for (int iy = ys; iy < ye; iy++) { 494 494 for (int ix = xs; ix < xe; ix++) { 495 mask->data. U8[iy][ix] |= value;496 } 497 } 498 } 499 495 mask->data.PS_TYPE_IMAGE_MASK_DATA[iy][ix] |= value; 496 } 497 } 498 } 499
Note:
See TracChangeset
for help on using the changeset viewer.
