IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 29, 2009, 3:01:24 PM (17 years ago)
Author:
Paul Price
Message:

Convering 'weight' to 'variance' where appropriate. Mostly just propagating changes from psModules. Fixed some mask types as well.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/pap_branch_20090128/pswarp/src/pswarpSetMaskBits.c

    r18558 r21225  
    88// updated in the config metadata.
    99
    10 bool pswarpSetMaskBits (pmConfig *config) {
    11 
    12     psMaskType maskIn = 0x00;                   // mask for the input image
    13     psMaskType markIn = 0x00;                   // mark for the input image
    14     psMaskType maskOut = 0x00;                  // mask for the output image
    15     psMaskType markOut = 0x00;                  // mark for the output image
     10bool pswarpSetMaskBits (pmConfig *config)
     11{
     12    psImageMaskType maskIn = 0x00;      // mask for the input image
     13    psImageMaskType markIn = 0x00;      // mark for the input image
     14    psImageMaskType maskOut = 0x00;     // mask for the output image
     15    psImageMaskType markOut = 0x00;     // mark for the output image
    1616
    1717    // this function sets the required single-image mask bits
    1818    if (!pmConfigMaskSetBits (&maskIn, &markIn, config)) {
    19         psError (PS_ERR_UNKNOWN, true, "Unable to define the mask bit values");
    20         return false;
     19        psError (PS_ERR_UNKNOWN, true, "Unable to define the mask bit values");
     20        return false;
    2121    }
    2222
    2323    // mask for non-linear flat regions (default to DETECTOR if not defined)
    24     psMaskType badMask = pmConfigMaskGet("BAD.WARP", config); 
     24    psMaskType badMask = pmConfigMaskGet("BAD.WARP", config);
    2525    if (!badMask) {
    26         badMask = 0x01;
    27         pmConfigMaskSet (config, "BAD.WARP", badMask);
     26        badMask = 0x01;
     27        pmConfigMaskSet (config, "BAD.WARP", badMask);
    2828    }
    2929    maskOut |= badMask;
    3030
    3131    // mask for non-linear flat regions (default to DETECTOR if not defined)
    32     psMaskType poorMask = pmConfigMaskGet("POOR.WARP", config); 
     32    psMaskType poorMask = pmConfigMaskGet("POOR.WARP", config);
    3333    if (!poorMask) {
    34         poorMask = 0x02;
    35         pmConfigMaskSet (config, "POOR.WARP", poorMask);
     34        poorMask = 0x02;
     35        pmConfigMaskSet (config, "POOR.WARP", poorMask);
    3636    }
    3737    maskOut |= poorMask;
     
    4242    int nBits = sizeof(psMaskType) * 8;
    4343    for (int i = 0; !markOut && (i < nBits); i++) {
    44         if (maskOut & markOut) {
    45             markOut >>= 1;
    46         } else {
    47             markOut = markOut;
    48         }
     44        if (maskOut & markOut) {
     45            markOut >>= 1;
     46        } else {
     47            markOut = markOut;
     48        }
    4949    }
    5050
    5151    if (!markOut) {
    52         psError (PS_ERR_UNKNOWN, true, "Unable to define the MARK bit mask: all bits taken!");
    53         return false;
     52        psError (PS_ERR_UNKNOWN, true, "Unable to define the MARK bit mask: all bits taken!");
     53        return false;
    5454    }
    5555
Note: See TracChangeset for help on using the changeset viewer.