IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 11, 2007, 3:34:12 PM (19 years ago)
Author:
magnier
Message:

fixing inconsistency between input and output image areas

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/imcombine/pmReadoutCombine.c

    r13756 r13766  
    104104    int xSize = 0, ySize = 0;           // The size of the output image
    105105
     106    int xMin = INT_MAX;
     107    int yMin = INT_MAX;
     108    int xMax = 0;
     109    int yMax = 0;
     110
    106111    bool valid = false;                 // Do we have a single valid input?
    107112    for (long i = 0; i < inputs->n; i++) {
     
    113118        }
    114119
    115 // XXX the use of trimsec here to judge the output size is inconsistent with the values of
    116 // minInputRows,etc below
    117 # if (0)
     120        // use the trimsec to define the max full range of the output pixels
    118121        pmCell *cell = readout->parent; // The parent cell
    119122        bool mdok = true;       // Status of MD lookup
     
    124127            xSize = PS_MAX(xSize, trimsec->x1 - trimsec->x0);
    125128            ySize = PS_MAX(ySize, trimsec->y1 - trimsec->y0);
    126         }
    127 # endif
     129            xMin  = PS_MIN(xMin,  trimsec->x0);
     130            xMax  = PS_MAX(xMax,  trimsec->x1);
     131            yMin  = PS_MIN(yMin,  trimsec->y0);
     132            yMax  = PS_MAX(yMax,  trimsec->y1);
     133        }
    128134
    129135        if (params->weights && !readout->weight) {
     
    136142
    137143        // Range of pixels on output image
    138         minInputRows = PS_MIN(minInputRows, readout->row0);
    139         maxInputRows = PS_MAX(maxInputRows, readout->row0 + readout->image->numRows);
    140         minInputCols = PS_MIN(minInputCols, readout->col0);
    141         maxInputCols = PS_MAX(maxInputCols, readout->col0 + readout->image->numCols);
     144        minInputRows = PS_MAX (xMin, PS_MIN(minInputRows, readout->row0));
     145        maxInputRows = PS_MIN (xMax, PS_MAX(maxInputRows, readout->row0 + readout->image->numRows));
     146        minInputCols = PS_MAX (yMin, PS_MIN(minInputCols, readout->col0));
     147        maxInputCols = PS_MIN (yMax, PS_MAX(maxInputCols, readout->col0 + readout->image->numCols));
    142148        psTrace("psModules.imcombine", 7, "Readout %ld: offset %d,%d; size %dx%d\n", i,
    143149                readout->col0, readout->row0, readout->image->numCols, readout->image->numRows);
    144150    }
    145 
    146     // full size of the output image
    147     xSize = maxInputCols - minInputCols;
    148     ySize = maxInputRows - minInputRows;
    149151
    150152    if (!valid) {
Note: See TracChangeset for help on using the changeset viewer.