IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 19, 2004, 3:49:47 PM (22 years ago)
Author:
desonia
Message:

format tweaks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/image/psImage.c

    r745 r746  
    33 *  @brief Contains basic image definitions and operations.
    44 *
    5  *  This file defines the basic type for an image struct and functions useful in manupulating images.
     5 *  This file defines the basic type for an image struct and functions useful
     6 *  in manupulating images.
    67 *
    78 *  @author Robert DeSonia, MHPCC
    89 *  @author Ross Harman, MHPCC
    910 *
    10  *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2004-05-20 01:27:01 $
     11 *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2004-05-20 01:49:47 $
    1213 *
    1314 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2728/*****************************************************************************/
    2829
    29 psImage *psImageAlloc(unsigned int numCols, unsigned int numRows, const psElemType type)
     30psImage *psImageAlloc(unsigned int numCols, unsigned int numRows,
     31                      const psElemType type)
    3032{
    3133    int area = 0;
     
    3638
    3739    if (area < 1) {
    38         psError(__func__, "Invalid value for number of rows or columns (numRows=%d, numCols=%d).",
    39                 numRows, numCols);
     40        psError(__func__, "Invalid value for number of rows or columns "
     41                "(numRows=%d, numCols=%d).", numRows, numCols);
    4042        return NULL;
    4143    }
     
    7981}
    8082
    81 psImage* psImageRealloc(psImage* old,unsigned int numCols, unsigned int numRows, const psElemType type)
     83psImage* psImageRealloc(psImage* old,unsigned int numCols, unsigned int numRows,
     84                        const psElemType type)
    8285{
    8386    int elementSize = PSELEMTYPE_SIZEOF(type); // element size in bytes
     
    9598
    9699    /* image already the right size/type? */
    97     if (numCols == old->numCols && numRows == old->numRows && type == old->type.type) {
     100    if (numCols == old->numCols && numRows == old->numRows &&
     101            type == old->type.type) {
    98102        return old;
    99103    }
     
    116120
    117121psImage *psImageSubset(psImage *out,psImage *image,unsigned int numCols,
    118                        unsigned int numRows, unsigned int col0, unsigned int row0)
     122                       unsigned int numRows, unsigned int col0,
     123                       unsigned int row0)
    119124{
    120125    unsigned int elementSize;           // size of image element in bytes
     
    139144
    140145    if (col0 >= image->numCols || row0 >= image->numRows) {
    141         psError(__func__,"Can not subset image because col0,row0 (%d,%d) is not a valid pixel "
    142                 "location.", col0,row0);
     146        psError(__func__,"Can not subset image because col0,row0 (%d,%d) is not a valid pixel location.",
     147                col0,row0);
    143148        return NULL;
    144149    }
     
    164169    // add output image as a child of the input image.
    165170    image->nChildren++;
    166     image->children = (psImage **) psRealloc(image->children,image->nChildren*sizeof(psImage *));
     171    image->children = (psImage **) psRealloc(image->children,
     172                      image->nChildren * sizeof(psImage*) );
    167173    image->children[image->nChildren-1] = out;
    168174
     
    171177
    172178    for (int row = 0; row < numRows; row++) {
    173         memcpy(out->data.v[row],image->data.U8[row0+row] + inputColOffset,outputRowSize);
     179        memcpy(out->data.v[row],image->data.U8[row0+row] + inputColOffset,
     180               outputRowSize);
    174181    }
    175182
     
    201208}
    202209
    203 psImage *psImageCopy(psImage* restrict output, const psImage *input, psElemType type)
     210psImage *psImageCopy(psImage* restrict output, const psImage *input,
     211                     psElemType type)
    204212{
    205213    psElemType inDatatype;
     
    214222
    215223    if (input == output) {
    216         psError(__func__,"Can not copy image because given input and output parameter reference the same "
    217                 "psImage struct.");
     224        psError(__func__,"Can not copy image because given input and output "
     225                "parameter reference the same psImage struct.");
    218226        return NULL;
    219227    }
Note: See TracChangeset for help on using the changeset viewer.