IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 22, 2008, 9:18:11 AM (18 years ago)
Author:
Paul Price
Message:

ppStack is now working with the incremental reads. Needed to modify a few things in pmStack*.c so that it would combine (and reject) subimages into a large image. Added weights to pmReadoutStack.

File:
1 edited

Legend:

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

    r15974 r16600  
    99
    1010bool pmReadoutUpdateSize(pmReadout *readout, int minCols, int minRows,
    11                          int numCols, int numRows, bool mask)
     11                         int numCols, int numRows, bool mask, bool weight,
     12                         psMaskType blank)
    1213{
    1314    PS_ASSERT_PTR_NON_NULL(readout, false);
    1415
    1516    if (readout->image) {
    16         *(psS32*) &(readout->col0) = PS_MIN(minCols, readout->col0);
    17         *(psS32*) &(readout->row0) = PS_MIN(minRows, readout->row0);
     17        readout->col0 = PS_MIN(minCols, readout->col0);
     18        readout->row0 = PS_MIN(minRows, readout->row0);
    1819    } else {
    19         *(psS32*) &(readout->col0) = minCols;
    20         *(psS32*) &(readout->row0) = minRows;
     20        readout->col0 = minCols;
     21        readout->row0 = minRows;
    2122    }
    2223
     
    2829        // Generate the new output image by extending the current one, or making a whole new one
    2930        psImage *newImage = psImageAlloc(numCols, numRows, PS_TYPE_F32);
    30         psImageInit(newImage, 0.0);
     31        psImageInit(newImage, NAN);
    3132        psImageOverlaySection(newImage, readout->image, readout->col0, readout->row0, "=");
    3233        psFree(readout->image);
     
    4041        if (readout->mask->numCols < numCols || readout->mask->numRows < numRows) {
    4142            psImage *newMask = psImageAlloc(numCols, numRows, PS_TYPE_MASK);
    42             psImageInit(newMask, 0);
     43            psImageInit(newMask, blank);
    4344            psImageOverlaySection(newMask, readout->mask, readout->col0, readout->row0, "=");
    4445            psFree(readout->mask);
    4546            readout->mask = newMask;
     47        }
     48    }
     49
     50    if (weight) {
     51        if (!readout->weight) {
     52            readout->weight = psImageAlloc(numCols, numRows, PS_TYPE_F32);
     53        }
     54        if (readout->weight->numCols < numCols || readout->weight->numRows < numRows) {
     55            psImage *newWeight = psImageAlloc(numCols, numRows, PS_TYPE_F32);
     56            psImageInit(newWeight, NAN);
     57            psImageOverlaySection(newWeight, readout->weight, readout->col0, readout->row0, "=");
     58            psFree(readout->weight);
     59            readout->weight = newWeight;
    4660        }
    4761    }
     
    5165
    5266bool pmReadoutStackValidate(int *minInputColsPtr, int *maxInputColsPtr, int *minInputRowsPtr,
    53                             int *maxInputRowsPtr, int *numColsPtr, int *numRowsPtr, 
     67                            int *maxInputRowsPtr, int *numColsPtr, int *numRowsPtr,
    5468                            const psArray *inputs)
    5569{
Note: See TracChangeset for help on using the changeset viewer.