IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 11699


Ignore:
Timestamp:
Feb 7, 2007, 5:10:33 PM (19 years ago)
Author:
jhoblitt
Message:

change psImageAlloc() & psImageRecycle() into wrappers so file/lineo/func can be recorded in the memBlock
whitespace cleanup

Location:
trunk/psLib/src/mathtypes
Files:
2 edited

Legend:

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

    r11668 r11699  
    99 *  @author Ross Harman, MHPCC
    1010 *
    11  *  @version $Revision: 1.122 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2007-02-06 21:36:09 $
     11 *  @version $Revision: 1.123 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2007-02-08 03:10:33 $
    1313 *
    1414 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    5959}
    6060
    61 psImage* psImageAlloc(int numCols,
    62                       int numRows,
    63                       psElemType type)
     61psImage* p_psImageAlloc(const char *file,
     62                        unsigned int lineno,
     63                        const char *func,
     64                        int numCols,
     65                        int numRows,
     66                        psElemType type)
    6467{
    6568    int elementSize = PSELEMTYPE_SIZEOF(type);  // element size in bytes
     
    8184    long numBytes = numRows * numCols * elementSize;
    8285
    83     psImage* image = (psImage* ) psAlloc(sizeof(psImage));
     86    psImage* image = (psImage* ) p_psAlloc(file, lineno, func, sizeof(psImage));
    8487
    8588    psMemSetDeallocator(image, (psFreeFunc) imageFree);
     
    364367}
    365368
    366 psImage* psImageRecycle(psImage* old,
     369psImage* p_psImageRecycle(const char *file,
     370                        unsigned int lineno,
     371                        const char *func,
     372                        psImage* old,
    367373                        int numCols,
    368374                        int numRows,
     
    373379
    374380    if (old == NULL) {
    375         old = psImageAlloc(numCols, numRows, type);
     381        old = p_psImageAlloc(file, lineno, func, numCols, numRows, type);
    376382        return old;
    377383    }
  • trunk/psLib/src/mathtypes/psImage.h

    r11680 r11699  
    77 * @author Robert DeSonia, MHPCC
    88 * @author Ross Harman, MHPCC
    9  *
    10  * @version $Revision: 1.86 $ $Name: not supported by cvs2svn $
    11  * @date $Date: 2007-02-07 02:53:47 $
     9 * @author Joshua Hoblitt, University of Hawaii
     10 *
     11 * @version $Revision: 1.87 $ $Name: not supported by cvs2svn $
     12 * @date $Date: 2007-02-08 03:10:33 $
    1213 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
    1314 */
     
    4243    //    PS_INTERPOLATE_NUM_MODES           ///< enum end-marker; does not coorespond to a interpolation mode
    4344} psImageInterpolateMode;
     45
    4446
    4547/** Basic image data structure.
     
    7981psImage;
    8082
     83
    8184#define P_PSIMAGE_SET_NUMCOLS(img,nc) {*(int*)&img->numCols = nc;}
    8285#define P_PSIMAGE_SET_NUMROWS(img,nr) {*(int*)&img->numRows = nr;}
     
    9194 *
    9295 */
     96#ifdef DOXYGEN
    9397psImage* psImageAlloc(
    9498    int numCols,                       ///< Number of columns in image.
    9599    int numRows,                       ///< Number of rows in image.
    96100    psElemType type                    ///< Type of data for image.
    97 )
    98 ;
     101);
     102#else // ifdef DOXYGEN
     103psImage* p_psImageAlloc(
     104    const char *file,                   ///< File of caller
     105    unsigned int lineno,                ///< Line number of caller
     106    const char *func,                   ///< Function name of caller
     107    int numCols,                       ///< Number of columns in image.
     108    int numRows,                       ///< Number of rows in image.
     109    psElemType type                    ///< Type of data for image.
     110);
     111#define psImageAlloc(numCols, numRows, type) \
     112      p_psImageAlloc(__FILE__, __LINE__, __func__, numCols, numRows, type)
     113#endif // ifdef DOXYGEN
     114
    99115
    100116/** Checks the type of a particular pointer.
    101117 *
    102  *  Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.
    103  *
     118 *  Uses the appropriate deallocation function in psMemBlock to check the ptr * datatype.
    104119 *  @return bool:       True if the pointer matches a psImage structure, false otherwise.
    105120 */
     
    118133    ...                                ///< Variable argument list for initialization
    119134);
     135
    120136
    121137/** Sets the value of the image at the specified x,y position to value.
     
    148164 *  @return psImage* Resized psImage.
    149165 */
     166#ifdef DOXYGEN
    150167psImage* psImageRecycle(
    151168    psImage* old,                      ///< the psImage to recycle by resizing image buffer
     
    154171    const psElemType type              ///< the desired datatype of the image
    155172);
     173#else // ifdef DOXYGEN
     174psImage* psImageRecycle(
     175    const char *file,                   ///< File of caller
     176    unsigned int lineno,                ///< Line number of caller
     177    const char *func,                   ///< Function name of caller
     178    psImage* old,                      ///< the psImage to recycle by resizing image buffer
     179    int numCols,                       ///< the desired number of columns in image
     180    int numRows,                       ///< the desired number of rows in image
     181    const psElemType type              ///< the desired datatype of the image
     182);
     183#define psImageRecycle(old, numCols, numRows, type) \
     184      p_psImageRecycle(__FILE__, __LINE__, __func__, old, numCols, numRows, type)
     185#endif // ifdef DOXYGEN
     186
    156187
    157188/** Copy an image to a new buffer
     
    165196);
    166197
     198
    167199/** Frees all children of a psImage.
    168200 *
     
    172204    psImage* image                     ///< psImage in which all children shall be deallocated
    173205);
     206
    174207
    175208/** get an element of an image as a psF64.
     
    183216);
    184217
     218
    185219/** print image pixel values.
    186220 *
     
    192226    char *name                         ///< name of the image (for title)
    193227);
     228
    194229
    195230/** Interpolate image pixel value given floating point coordinates.
     
    207242    psImageInterpolateMode mode        ///< interpolation mode
    208243);
     244
    209245
    210246#define PIXEL_INTERPOLATE_FCN_PROTOTYPE(SUFFIX, RETURNTYPE) \
Note: See TracChangeset for help on using the changeset viewer.