IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 11, 2006, 5:30:53 PM (20 years ago)
Author:
Paul Price
Message:

Only do tracing if tracing is enabled.

File:
1 edited

Legend:

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

    r7851 r7868  
    55 *  @author GLG, MHPCC
    66 *
    7  *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
    8  *  @date $Date: 2006-07-08 05:35:59 $
     7 *  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
     8 *  @date $Date: 2006-07-12 03:30:53 $
    99 *
    1010 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    176176    }
    177177
    178     // Apply scale and zero
    179     if (scale || zero) {
    180         for (int i = 0; i < inputs->n; i++) {
    181             pmReadout *readout = inputs->data[i]; // The particular readout
    182             if (zero) {
    183                 psBinaryOp(readout->image, readout->image, "-",
    184                            psScalarAlloc(zero->data.F32[i], PS_TYPE_F32));
    185             }
    186             if (scale) {
    187                 float scaleFactor = 1.0 / scale->data.F32[i]; // Scaling
    188                 psBinaryOp(readout->image, readout->image, "*", psScalarAlloc(scaleFactor, PS_TYPE_F32));
    189                 if (haveWeights) {
    190                     psBinaryOp(readout->weight, readout->weight, "*",
    191                                psScalarAlloc(scaleFactor * scaleFactor, PS_TYPE_F32));
    192                 }
    193             }
    194         }
    195     }
    196 
    197178    // Update the origin
    198179    if (output->image) {
     
    291272    psMaskType maskVal = params->maskVal; // The mask value
    292273
     274    #ifndef PS_NO_TRACE
     275
    293276    psTrace(__func__, 3, "Iterating output: %d --> %d, %d --> %d\n",
    294277            minInputCols - output->col0, maxInputCols - output->col0,
     
    302285        }
    303286    }
     287    #endif
    304288
    305289    // Dereference output products
     
    311295    }
    312296
     297    psVector *invScale = NULL;          // Inverse scale; pre-calculated for efficiency
     298    if (scale) {
     299        invScale = (psVector*)psBinaryOp(NULL, psScalarAlloc(1.0, PS_TYPE_F32), "/", (const psPtr)scale);
     300    }
     301
    313302    for (int i = minInputRows; i < maxInputRows; i++) {
    314303        int yOut = i - output->row0; // y position on output readout
     
    329318                int yIn = i - readout->row0; // y position on input readout
    330319                int xIn = j - readout->col0; // x position on input readout
    331 
    332320                psImage *image = readout->image; // The readout image
    333321
     322                #if 0
     323                // This should have been taken care of already:
    334324                // Check bounds
    335325                if (xIn < 0 || xIn >= image->numCols || yIn < 0 || yIn >= image->numRows) {
    336326                    continue;
    337327                }
    338 
     328                #endif
    339329                pixelsData[r] = image->data.F32[yIn][xIn];
     330                if (zero) {
     331                    pixelsData[r] -= zero->data.F32[r];
     332                }
     333                if (scale) {
     334                    pixelsData[r] *= invScale->data.F32[r];
     335                }
    340336
    341337                // Check mask
     
    398394    psFree(weights);
    399395    psFree(stats);
     396    psFree(invScale);
    400397
    401398    // Update the "concepts"
Note: See TracChangeset for help on using the changeset viewer.