IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 4131


Ignore:
Timestamp:
Jun 7, 2005, 12:13:42 PM (21 years ago)
Author:
gusciora
Message:

Some comment changes, and fixed a bug with the numCols bound check code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/pmSubtractBias.c

    r4030 r4131  
    44 *  in place from an input image.
    55 *
    6  *  @author George Gusciora, MHPCC
     6 *  @author GLG, MHPCC
    77 *
    8  *  @version $Revision: 1.33 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2005-05-25 20:28:32 $
     8 *  @version $Revision: 1.34 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2005-06-07 22:13:42 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
    1212 *
    1313 */
    14 
    15 
    16 
    17 
    1814
    1915#if HAVE_CONFIG_H
     
    3127place from the input image.
    3228 *****************************************************************************/
    33 psReadout *psSubtractFrame(psReadout *in,
    34                            const psReadout *bias)
     29static psReadout *SubtractFrame(psReadout *in,
     30                                const psReadout *bias)
    3531{
    3632    psS32 i;
     
    3935    if (bias == NULL) {
    4036        psLogMsg(__func__, PS_LOG_WARN,
    41                  "WARNING: pmSubtractBias.c: psSubtractFrame(): bias frame is NULL.  Returning original image.\n");
    42         return(in);
    43     }
    44 
    45     if (((in->image)->numRows + in->row0 - bias->row0) > (bias->image)->numRows) {
     37                 "WARNING: pmSubtractBias.c: SubtractFrame(): bias frame is NULL.  Returning original image.\n");
     38        return(in);
     39    }
     40
     41
     42    if ((in->image->numRows + in->row0 - bias->row0) > bias->image->numRows) {
    4643        psError(PS_ERR_UNKNOWN,true, "bias image does not have enough rows.  Returning in image\n");
    4744        return(in);
    4845    }
    49     if (((in->image)->numCols + in->row0 - bias->row0) > (bias->image)->numCols) {
     46    if ((in->image->numCols + in->col0 - bias->col0) > bias->image->numCols) {
    5047        psError(PS_ERR_UNKNOWN,true, "bias image does not have enough columns.  Returning in image\n");
    5148        return(in);
    5249    }
    5350
    54     for (i=0;i<(in->image)->numRows;i++) {
    55         for (j=0;j<(in->image)->numCols;j++) {
    56             (in->image)->data.F32[i][j]-=
    57                 (bias->image)->data.F32[i+in->row0-bias->row0][j+in->col0-bias->col0];
     51    for (i=0;i<in->image->numRows;i++) {
     52        for (j=0;j<in->image->numCols;j++) {
     53            in->image->data.F32[i][j]-=
     54                bias->image->data.F32[i+in->row0-bias->row0][j+in->col0-bias->col0];
    5855            if ((in->mask != NULL) && (bias->mask != NULL)) {
    59                 ((in->mask)->data.U8[i][j])|=
    60                     (bias->mask)->data.U8[i+in->row0-bias->row0][j+in->col0-bias->col0];
     56                (in->mask->data.U8[i][j])|=
     57                    bias->mask->data.U8[i+in->row0-bias->row0][j+in->col0-bias->col0];
    6158            }
    6259        }
     
    6764
    6865/******************************************************************************
    69 p_psImageSubtractScalar(): subtract a scalar from the input image.
     66ImageSubtractScalar(): subtract a scalar from the input image.
     67 
     68XXX: Use a psLib function for this.
     69 
     70XXX: This should
    7071 *****************************************************************************/
    71 psImage *p_psImageSubtractScalar(psImage *image,
    72                                  psF32 scalar)
     72static psImage *ImageSubtractScalar(psImage *image,
     73                                    psF32 scalar)
    7374{
    7475    for (psS32 i=0;i<image->numRows;i++) {
    7576        for (psS32 j=0;j<image->numCols;j++) {
    76             (image->data.F32[i][j])-= scalar;
     77            image->data.F32[i][j]-= scalar;
    7778        }
    7879    }
     
    8788listed lower in the code.
    8889 *****************************************************************************/
    89 psStatsOptions GenNewStatOptions(const psStats *stat)
     90static psStatsOptions GenNewStatOptions(const psStats *stat)
    9091{
    9192    psS32 numOptions = 0;
     
    153154vector?
    154155 *****************************************************************************/
    155 psVector *ScaleOverscanVector(psVector *overscanVector,
    156                               psS32 n,
    157                               void *fitSpec,
    158                               pmFit fit)
     156static psVector *ScaleOverscanVector(psVector *overscanVector,
     157                                     psS32 n,
     158                                     void *fitSpec,
     159                                     pmFit fit)
    159160{
    160161    psTrace(".psModule.pmSubtracBias.ScaleOverscanVector", 4,
     
    170171    //
    171172    // If the new vector is the same size as the old, simply copy the data.
     173    //
    172174    if (n == overscanVector->n) {
    173175        for (psS32 i = 0 ; i < n ; i++) {
     
    320322
    321323
    322 
    323 
    324324    if (overScanAxis == PM_OVERSCAN_NONE) {
    325325        if (fit != PM_FIT_NONE) {
     
    332332                     "WARNING: pmSubtractBias.(): overScanAxis equals NONE and overscans does not equal NULL.  Proceeding to full fram subtraction.\n");
    333333        }
    334         return(psSubtractFrame(in, bias));
     334        return(SubtractFrame(in, bias));
    335335    }
    336336
     
    361361                return(in);
    362362            }
    363             p_psImageSubtractScalar(in->image, statValue);
     363            ImageSubtractScalar(in->image, statValue);
    364364
    365365            tmpOverscan = tmpOverscan->next;
     
    639639
    640640    if (bias != NULL) {
    641         return(psSubtractFrame(in, bias));
     641        return(SubtractFrame(in, bias));
    642642    }
    643643    return(in);
Note: See TracChangeset for help on using the changeset viewer.