Changeset 11699
- Timestamp:
- Feb 7, 2007, 5:10:33 PM (19 years ago)
- Location:
- trunk/psLib/src/mathtypes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/mathtypes/psImage.c
r11668 r11699 9 9 * @author Ross Harman, MHPCC 10 10 * 11 * @version $Revision: 1.12 2$ $Name: not supported by cvs2svn $12 * @date $Date: 2007-02-0 6 21:36:09$11 * @version $Revision: 1.123 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2007-02-08 03:10:33 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 59 59 } 60 60 61 psImage* psImageAlloc(int numCols, 62 int numRows, 63 psElemType type) 61 psImage* p_psImageAlloc(const char *file, 62 unsigned int lineno, 63 const char *func, 64 int numCols, 65 int numRows, 66 psElemType type) 64 67 { 65 68 int elementSize = PSELEMTYPE_SIZEOF(type); // element size in bytes … … 81 84 long numBytes = numRows * numCols * elementSize; 82 85 83 psImage* image = (psImage* ) p sAlloc(sizeof(psImage));86 psImage* image = (psImage* ) p_psAlloc(file, lineno, func, sizeof(psImage)); 84 87 85 88 psMemSetDeallocator(image, (psFreeFunc) imageFree); … … 364 367 } 365 368 366 psImage* psImageRecycle(psImage* old, 369 psImage* p_psImageRecycle(const char *file, 370 unsigned int lineno, 371 const char *func, 372 psImage* old, 367 373 int numCols, 368 374 int numRows, … … 373 379 374 380 if (old == NULL) { 375 old = p sImageAlloc(numCols, numRows, type);381 old = p_psImageAlloc(file, lineno, func, numCols, numRows, type); 376 382 return old; 377 383 } -
trunk/psLib/src/mathtypes/psImage.h
r11680 r11699 7 7 * @author Robert DeSonia, MHPCC 8 8 * @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 $ 12 13 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii 13 14 */ … … 42 43 // PS_INTERPOLATE_NUM_MODES ///< enum end-marker; does not coorespond to a interpolation mode 43 44 } psImageInterpolateMode; 45 44 46 45 47 /** Basic image data structure. … … 79 81 psImage; 80 82 83 81 84 #define P_PSIMAGE_SET_NUMCOLS(img,nc) {*(int*)&img->numCols = nc;} 82 85 #define P_PSIMAGE_SET_NUMROWS(img,nr) {*(int*)&img->numRows = nr;} … … 91 94 * 92 95 */ 96 #ifdef DOXYGEN 93 97 psImage* psImageAlloc( 94 98 int numCols, ///< Number of columns in image. 95 99 int numRows, ///< Number of rows in image. 96 100 psElemType type ///< Type of data for image. 97 ) 98 ; 101 ); 102 #else // ifdef DOXYGEN 103 psImage* 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 99 115 100 116 /** Checks the type of a particular pointer. 101 117 * 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. 104 119 * @return bool: True if the pointer matches a psImage structure, false otherwise. 105 120 */ … … 118 133 ... ///< Variable argument list for initialization 119 134 ); 135 120 136 121 137 /** Sets the value of the image at the specified x,y position to value. … … 148 164 * @return psImage* Resized psImage. 149 165 */ 166 #ifdef DOXYGEN 150 167 psImage* psImageRecycle( 151 168 psImage* old, ///< the psImage to recycle by resizing image buffer … … 154 171 const psElemType type ///< the desired datatype of the image 155 172 ); 173 #else // ifdef DOXYGEN 174 psImage* 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 156 187 157 188 /** Copy an image to a new buffer … … 165 196 ); 166 197 198 167 199 /** Frees all children of a psImage. 168 200 * … … 172 204 psImage* image ///< psImage in which all children shall be deallocated 173 205 ); 206 174 207 175 208 /** get an element of an image as a psF64. … … 183 216 ); 184 217 218 185 219 /** print image pixel values. 186 220 * … … 192 226 char *name ///< name of the image (for title) 193 227 ); 228 194 229 195 230 /** Interpolate image pixel value given floating point coordinates. … … 207 242 psImageInterpolateMode mode ///< interpolation mode 208 243 ); 244 209 245 210 246 #define PIXEL_INTERPOLATE_FCN_PROTOTYPE(SUFFIX, RETURNTYPE) \
Note:
See TracChangeset
for help on using the changeset viewer.
