IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 13, 2010, 12:38:33 PM (16 years ago)
Author:
bills
Message:

minor changes to be compatible with streaksrelease

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/extras/pmCensor.c

    r29389 r29390  
    33
    44bool
    5 pmCensorGetMask(pmConfig *config, psU32 *pMaskMask)
     5pmCensorGetMasks(pmConfig *config, psU32 *pMaskCensor, psU32 *pMaskStreak)
    66{
    77    bool status;
     
    1212    }
    1313
    14     // first look for the value in the recipes
    15     psU32 maskMask = psMetadataLookupU32(&status, config->camera, "MASK.NO.CENSOR");
    16     if (status) {
    17         // All done
    18         *pMaskMask = ~maskMask;
    19         return true;
    20     }
    21     // Not defined. Now we must compute it.
    2214
    2315    // Older sets of mask values had SPIKE and STARCORE with the same value as STREAK
     
    2820        return false;
    2921    }
     22    *pMaskStreak = streak;
     23
     24    // first look for the value in the recipes
     25    psU32 maskNoCensor = psMetadataLookupU32(&status, config->camera, "MASK.NO.CENSOR");
     26    if (status) {
     27        // All done
     28        *pMaskCensor = ~maskNoCensor;
     29        return true;
     30    }
     31
     32    // Not defined. So we must compute it.
    3033
    3134    // preserve pixels that are only CONV.POOR
     
    6265    // That was true in older 8 bit mask configurations.
    6366
    64     *pMaskMask = ~(convPoor | suspect | starcore | spike) | streak;
     67    *pMaskCensor = ~(convPoor | suspect | starcore | spike) | streak;
    6568
    6669    return true;
     
    7174    *pNumCensored = 0;
    7275
    73     psU32 maskMask;
    74     if (!pmCensorGetMask(config, &maskMask)) {
     76    psU32 censorMask;
     77    psU32 streakMask;
     78    if (!pmCensorGetMasks(config, &censorMask, &streakMask)) {
    7579        psError(PS_ERR_UNKNOWN, false, "failed to lookup set of mask bits to censor.\n");
    7680        return false;
    7781    }
    7882
    79     if (~maskMask == 0) {
     83    if (~censorMask == 0) {
    8084        // censoring masked pixels is not required
    8185        return true;
     
    8488    double exciseValue;
    8589    if (image->type.type == PS_TYPE_U16) {
     90        exciseValue = 0x7fff;
     91    } else if (image->type.type == PS_TYPE_U16) {
    8692        exciseValue = 0xffff;
    8793    } else if (image->type.type == PS_TYPE_F32) {
     
    96102        for (int x=0; x<image->numCols; x++) {
    97103            psU16 maskVal = psImageGet(mask, x, y);
    98             if (maskVal & maskMask) {
     104            if (maskVal & censorMask) {
    99105                (*pNumCensored)++;
    100106                psImageSet(image, x, y, exciseValue);
Note: See TracChangeset for help on using the changeset viewer.