IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 26, 2009, 8:40:07 PM (17 years ago)
Author:
eugene
Message:

incorporating changes from 16bit mask upgrades (eam_branch_20081230)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psastro/src/psastroMaskUpdates.c

    r21018 r21183  
    1111bool pmChipCoordsForCell (float *xChip, float *yChip, pmCell *cell, float xCell, float yCell);
    1212
    13 bool psastroMaskCircle (psImage *mask, char value, float x0, float y0, float dX, float dY);
    14 bool psastroMaskBox (psImage *mask, char value, float x0, float y0, float dL, float dW, float theta);
    15 void psastroMaskLine (psImage *mask, char value, double x1, double y1, double x2, double y2, int dW);
    16 void psastroMaskLineBresen (psImage *mask, char value, int X1, int Y1, int X2, int Y2, int dW, int swapcoords);
    17 void psastroMaskRectangle (psImage *mask, char value, int x0, int y0, int x1, int y1);
     13bool psastroMaskCircle (psImage *mask, psImageMaskType value, float x0, float y0, float dX, float dY);
     14bool psastroMaskBox (psImage *mask, psImageMaskType value, float x0, float y0, float dL, float dW, float theta);
     15void psastroMaskLine (psImage *mask, psImageMaskType value, double x1, double y1, double x2, double y2, int dW);
     16void psastroMaskLineBresen (psImage *mask, psImageMaskType value, int X1, int Y1, int X2, int Y2, int dW, int swapcoords);
     17void psastroMaskRectangle (psImage *mask, psImageMaskType value, int x0, int y0, int x1, int y1);
    1818
    1919// create a mask or mask regions based on the collection of reference stars that are
     
    2727    float zeropt, exptime;
    2828
    29     psMaskType maskValue  = pmConfigMaskGet("GHOST", config); // Mask value for ghost pixels
    30 
    31     // psMaskType maskBlank  = pmConfigMaskGet("BLANK", config); // Mask value for blank pixels
     29    psImageMaskType maskValue  = pmConfigMaskGet("GHOST", config); // Mask value for ghost pixels
     30
     31    // psImageMaskType maskBlank  = pmConfigMaskGet("BLANK", config); // Mask value for blank pixels
    3232
    3333    // select the current recipe
     
    376376
    377377// XXX should be doing an OR
    378 bool psastroMaskCircle (psImage *mask, char value, float x0, float y0, float dX, float dY) {
     378bool psastroMaskCircle (psImage *mask, psImageMaskType value, float x0, float y0, float dX, float dY) {
    379379
    380380    // XXX need to worry about row0, col0
     
    391391            if (r2 > 1.0) continue;
    392392
    393             mask->data.U8[jy][jx] |= value;
     393            mask->data.PS_TYPE_IMAGE_MASK_DATA[jy][jx] |= value;
    394394        }
    395395    }
     
    398398
    399399// XXX should be doing an OR
    400 bool psastroMaskBox (psImage *mask, char value, float x0, float y0, float dL, float dW, float theta) {
     400bool psastroMaskBox (psImage *mask, psImageMaskType value, float x0, float y0, float dL, float dW, float theta) {
    401401
    402402    // draw a series of lines (from -0.5*dW to +0.5*dW) of length dL, starting at x0, y0, angle theta
     
    413413
    414414// identify the quadrant and draw the correct line
    415 void psastroMaskLine (psImage *mask, char value, double x1, double y1, double x2, double y2, int dW) {
     415void psastroMaskLine (psImage *mask, psImageMaskType value, double x1, double y1, double x2, double y2, int dW) {
    416416
    417417  int FlipDirect, FlipCoords;
     
    442442// use the Bresenham line drawing technique
    443443// integer-only Bresenham line-draw version which is fast
    444 void psastroMaskLineBresen (psImage *mask, char value, int X1, int Y1, int X2, int Y2, int dW, int swapcoords) {
     444void psastroMaskLineBresen (psImage *mask, psImageMaskType value, int X1, int Y1, int X2, int Y2, int dW, int swapcoords) {
    445445
    446446    int X, Y, dX, dY;
     
    459459                    if (y < 0) continue;
    460460                    if (y >= mask->numCols) continue;
    461                     mask->data.U8[X][y] |= value;
     461                    mask->data.PS_TYPE_IMAGE_MASK_DATA[X][y] |= value;
    462462                }
    463463            } else {
     
    466466                    if (y < 0) continue;
    467467                    if (y >= mask->numRows) continue;
    468                     mask->data.U8[y][X] |= value;
     468                    mask->data.PS_TYPE_IMAGE_MASK_DATA[y][X] |= value;
    469469                }
    470470            }
     
    484484}
    485485
    486 void psastroMaskRectangle (psImage *mask, char value, int x0, int y0, int x1, int y1) {
     486void psastroMaskRectangle (psImage *mask, psImageMaskType value, int x0, int y0, int x1, int y1) {
    487487
    488488    int xs = PS_MAX (0, PS_MIN (mask->numCols, PS_MIN (x0, x1)));
     
    493493    for (int iy = ys; iy < ye; iy++) {
    494494        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.