IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 16, 2006, 3:16:17 PM (20 years ago)
Author:
Paul Price
Message:

Documenting pmFPACopy.[ch]. Adding const where appropriate.

File:
1 edited

Legend:

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

    r8848 r9589  
    2222// Bin a region down by specified factors in x and y
    2323static void binRegion(psRegion *region, // Region to be binned
    24                       int xBin, int yBin// Binning in x and y
     24                      int xBin, int yBin // Binning in x and y
    2525                     )
    2626{
     
    3838
    3939// Find the blank (image-less) PHU, given a cell.
    40 static pmHDU *findBlankPHU(const pmCell *cell// The cell for which to find the PHU
     40static pmHDU *findBlankPHU(const pmCell *cell // The cell for which to find the PHU
    4141                          )
    4242{
     
    6363//////////////////////////////////////////////////////////////////////////////////////////////////////////////
    6464
     65// Common engine for pmCellCopy and pmCellCopyStructure
     66// Does the actual splitting/splicing that's required to copy an FPA to a different representation.
    6567static bool cellCopy(pmCell *target,     // The target cell
    66                      pmCell *source,    // The source cell, to be copied
     68                     const pmCell *source, // The source cell, to be copied
    6769                     bool pixels,        // Copy the pixels?
    6870                     int xBin, int yBin  // (Relative) binning factors in x and y
     
    249251        psTrace("psModules.camera", 3, "CELL.X0: Before: %d After: %d\n", xZero,
    250252                xZero - (readout->image->numCols - 1) * xParity * xBin);
    251         psTrace("psModules.camera", 9, "(xParity: %d xBin: %d numCols: %d)\n", xParity, xBin, readout->image->numCols);
     253        psTrace("psModules.camera", 9, "(xParity: %d xBin: %d numCols: %d)\n",
     254                xParity, xBin, readout->image->numCols);
    252255        xZero -= (readout->image->numCols - 1) * xParity * xBin; // Change the parity on the X0 position
    253256        psMetadataItem *newItem = psMetadataLookup(target->concepts, "CELL.X0"); // CELL.X0 from target
     
    261264        psTrace("psModules.camera", 3, "CELL.Y0: Before: %d After: %d\n", yZero,
    262265                yZero - (readout->image->numRows - 1) * yParity * yBin);
    263         psTrace("psModules.camera", 9, "(yParity: %d yBin: %d numRows: %d)\n", yParity, yBin, readout->image->numRows);
     266        psTrace("psModules.camera", 9, "(yParity: %d yBin: %d numRows: %d)\n",
     267                yParity, yBin, readout->image->numRows);
    264268        yZero -= (readout->image->numRows - 1) * yParity * yBin; // Change the parity on the Y0 position
    265269        psMetadataItem *newItem = psMetadataLookup(target->concepts, "CELL.Y0"); // CELL.Y0 from target
     
    294298}
    295299
     300// Common engine for pmChipCopy and pmChipCopyStructure
     301// Iterate on the components
    296302static bool chipCopy(pmChip *target,          // The target chip
    297                      pmChip *source,          // The source chip, to be copied
     303                     const pmChip *source, // The source chip, to be copied
    298304                     bool pixels,             // Copy the pixels?
    299305                     int xBin, int yBin       // (Relative) binning factors in x and y
     
    308314    psArray *sourceCells = source->cells; // The source cells
    309315    if (targetCells->n != sourceCells->n) {
    310         psError(PS_ERR_IO, true, "Number of source cells (%ld) differs from the number of target cells (%ld)\n",
     316        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
     317                "Number of source cells (%ld) differs from the number of target cells (%ld)\n",
    311318                sourceCells->n, targetCells->n);
    312319        return false;
     
    331338}
    332339
    333 static bool fpaCopy(pmFPA *target,            // The target FPA
    334                     pmFPA *source,            // The source FPA, to be copied
    335                     bool pixels,              // Copy the pixels?
    336                     int xBin, int yBin        // (Relative) binning factors in x and y
     340// Common engine for pmFPACopy and pmFPACopyStructure.
     341// Iterate on the components
     342static bool fpaCopy(pmFPA *target,      // The target FPA
     343                    const pmFPA *source, // The source FPA, to be copied
     344                    bool pixels,        // Copy the pixels?
     345                    int xBin, int yBin  // (Relative) binning factors in x and y
    337346                   )
    338347{
     
    345354    psArray *sourceChips = source->chips; // The source chips
    346355    if (targetChips->n != sourceChips->n) {
    347         psError(PS_ERR_IO, true, "Number of source chips (%ld) differs from the number of target chips (%ld)\n",
     356        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
     357                "Number of source chips (%ld) differs from the number of target chips (%ld)\n",
    348358                sourceChips->n, targetChips->n);
    349359        return false;
     
    371381//////////////////////////////////////////////////////////////////////////////////////////////////////////////
    372382
    373 bool pmFPACopy(pmFPA *target,            // The target FPA
    374                pmFPA *source             // The source FPA, to be copied
    375               )
     383bool pmFPACopy(pmFPA *target, const pmFPA *source)
    376384{
    377385    PS_ASSERT_PTR_NON_NULL(target, false);
     
    380388}
    381389
    382 bool pmChipCopy(pmChip *target,          // The target chip
    383                 pmChip *source           // The source chip, to be copied
    384                )
     390bool pmChipCopy(pmChip *target, const pmChip *source)
    385391{
    386392    PS_ASSERT_PTR_NON_NULL(target, false);
     
    389395}
    390396
    391 bool pmCellCopy(pmCell *target,          // The target cell
    392                 pmCell *source           // The source cell, to be copied
    393                )
     397bool pmCellCopy(pmCell *target, const pmCell *source)
    394398{
    395399    PS_ASSERT_PTR_NON_NULL(target, false);
     
    399403
    400404
    401 bool pmFPACopyStructure(pmFPA *target,   // The target FPA
    402                         pmFPA *source,   // The source FPA, to be copied
    403                         int xBin, int yBin // Binning factors in x and y
    404                        )
     405bool pmFPACopyStructure(pmFPA *target, const pmFPA *source, int xBin, int yBin)
    405406{
    406407    PS_ASSERT_PTR_NON_NULL(target, false);
     
    411412}
    412413
    413 bool pmChipCopyStructure(pmChip *target, // The target chip
    414                          pmChip *source, // The source chip, to be copied
    415                          int xBin, int yBin // Binning factors in x and y
    416                         )
     414bool pmChipCopyStructure(pmChip *target, const pmChip *source, int xBin, int yBin)
    417415{
    418416    PS_ASSERT_PTR_NON_NULL(target, false);
     
    423421}
    424422
    425 bool pmCellCopyStructure(pmCell *target, // The target cell
    426                          pmCell *source, // The source cell, to be copied
    427                          int xBin, int yBin // Binning factors in x and y
    428                         )
     423bool pmCellCopyStructure(pmCell *target, const pmCell *source, int xBin, int yBin)
    429424{
    430425    PS_ASSERT_PTR_NON_NULL(target, false);
Note: See TracChangeset for help on using the changeset viewer.