IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 16, 2008, 4:38:46 PM (18 years ago)
Author:
Paul Price
Message:

Adding function to set image,weight pixels to NAN where they are masked.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/camera/pmFPAMaskWeight.c

    r17692 r17730  
    404404    return true;
    405405}
     406
     407
     408
     409bool pmSubtractionMaskApply(pmReadout *readout, psMaskType maskVal)
     410{
     411    PM_ASSERT_READOUT_NON_NULL(readout, false);
     412    PM_ASSERT_READOUT_IMAGE(readout, false);
     413    PM_ASSERT_READOUT_MASK(readout, false);
     414
     415    int numCols = image->numCols, numRows = image->numRows; // Size of image
     416    psMaskType **maskData = mask->data.PS_TYPE_MASK_DATA; // Dereference mask
     417    psF32 **imageData = image->data.F32;// Dereference image
     418    psF32 **weightData = weight->data.F32; // Dereference weight map
     419
     420    for (int y = 0; y < numRows; y++) {
     421        for (int x = 0; x < numCols; x++) {
     422            if (maskData[y][x] & maskVal) {
     423                imageData[y][x] = NAN;
     424                if (weight) {
     425                    weightData[y][x] = NAN;
     426                }
     427            }
     428        }
     429    }
     430
     431    return true;
     432}
Note: See TracChangeset for help on using the changeset viewer.