IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 6, 2009, 7:13:34 AM (18 years ago)
Author:
eugene
Message:

update to psImageMaskType and associated (psphot, psastro, ppImage, ppMerge, ppSim, ppStats, ppArith)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branch_20081230/psastro/src/psastroMaskUpdates.Mosaic.c

    r20650 r21087  
    99pmCell *pmCellInChip (pmChip *chip, float x, float y);
    1010bool pmCellCoordsForChip (float *xCell, float *yCell, pmCell *cell, float xChip, float yChip);
    11 bool psastroMaskCircle (psImage *mask, char value, float x0, float y0, float dX, float dY);
    12 bool psastroMaskBox (psImage *mask, char value, float x0, float y0, float dL, float dW, float theta);
    13 void psastroMaskLine (psImage *mask, char value, double x1, double y1, double x2, double y2, int dW);
    14 void psastroMaskLineBresen (psImage *mask, char value, int X1, int Y1, int X2, int Y2, int dW, int swapcoords);
    15 void psastroMaskRectangle (psImage *mask, char value, int x0, int y0, int x1, int y1);
     11bool psastroMaskCircle (psImage *mask, psImageMaskType value, float x0, float y0, float dX, float dY);
     12bool psastroMaskBox (psImage *mask, psImageMaskType value, float x0, float y0, float dL, float dW, float theta);
     13void psastroMaskLine (psImage *mask, psImageMaskType value, double x1, double y1, double x2, double y2, int dW);
     14void psastroMaskLineBresen (psImage *mask, psImageMaskType value, int X1, int Y1, int X2, int Y2, int dW, int swapcoords);
     15void psastroMaskRectangle (psImage *mask, psImageMaskType value, int x0, int y0, int x1, int y1);
    1616
    1717// create a mask or mask regions based on the collection of reference stars that are
     
    2525    float zeropt, exptime;
    2626
    27     psMaskType maskValue  = pmConfigMaskGet("GHOST", config); // Mask value for ghost pixels
    28     psMaskType maskBlank  = pmConfigMaskGet("BLANK", config); // Mask value for blank pixels
     27    psImageMaskType maskValue  = pmConfigMaskGet("GHOST", config); // Mask value for ghost pixels
     28    psImageMaskType maskBlank  = pmConfigMaskGet("BLANK", config); // Mask value for blank pixels
    2929
    3030    // select the current recipe
     
    342342
    343343// XXX should be doing an OR
    344 bool psastroMaskCircle (psImage *mask, char value, float x0, float y0, float dX, float dY) {
     344bool psastroMaskCircle (psImage *mask, psImageMaskType value, float x0, float y0, float dX, float dY) {
    345345
    346346    // XXX need to worry about row0, col0
     
    357357            if (r2 > 1.0) continue;
    358358           
    359             mask->data.U8[jy][jx] |= value;
     359            mask->data.PS_TYPE_IMAGE_MASK_DATA[jy][jx] |= value;
    360360        }
    361361    }
     
    364364
    365365// XXX should be doing an OR
    366 bool psastroMaskBox (psImage *mask, char value, float x0, float y0, float dL, float dW, float theta) {
     366bool psastroMaskBox (psImage *mask, psImageMaskType value, float x0, float y0, float dL, float dW, float theta) {
    367367
    368368    // draw a series of lines (from -0.5*dW to +0.5*dW) of length dL, starting at x0, y0, angle theta
     
    379379
    380380// identify the quadrant and draw the correct line
    381 void psastroMaskLine (psImage *mask, char value, double x1, double y1, double x2, double y2, int dW) {
     381void psastroMaskLine (psImage *mask, psImageMaskType value, double x1, double y1, double x2, double y2, int dW) {
    382382
    383383  int FlipDirect, FlipCoords;
     
    408408// use the Bresenham line drawing technique
    409409// integer-only Bresenham line-draw version which is fast
    410 void psastroMaskLineBresen (psImage *mask, char value, int X1, int Y1, int X2, int Y2, int dW, int swapcoords) {
     410void psastroMaskLineBresen (psImage *mask, psImageMaskType value, int X1, int Y1, int X2, int Y2, int dW, int swapcoords) {
    411411
    412412    int X, Y, dX, dY;
     
    425425                    if (y < 0) continue;
    426426                    if (y >= mask->numCols) continue;
    427                     mask->data.U8[X][y] |= value;
     427                    mask->data.PS_TYPE_IMAGE_MASK_DATA[X][y] |= value;
    428428                }
    429429            } else {
     
    432432                    if (y < 0) continue;
    433433                    if (y >= mask->numRows) continue;
    434                     mask->data.U8[y][X] |= value;
     434                    mask->data.PS_TYPE_IMAGE_MASK_DATA[y][X] |= value;
    435435                }
    436436            }
     
    450450}
    451451
    452 void psastroMaskRectangle (psImage *mask, char value, int x0, int y0, int x1, int y1) {
     452void psastroMaskRectangle (psImage *mask, psImageMaskType value, int x0, int y0, int x1, int y1) {
    453453    for (int iy = PS_MAX(0,y0); iy < PS_MIN(y1,mask->numRows); iy++) {
    454454        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.