Changeset 1440 for trunk/psLib/src/image
- Timestamp:
- Aug 9, 2004, 1:34:58 PM (22 years ago)
- Location:
- trunk/psLib/src/image
- Files:
-
- 10 edited
-
psImage.c (modified) (15 diffs)
-
psImage.h (modified) (8 diffs)
-
psImageExtraction.c (modified) (8 diffs)
-
psImageExtraction.h (modified) (5 diffs)
-
psImageIO.c (modified) (3 diffs)
-
psImageIO.h (modified) (3 diffs)
-
psImageManip.c (modified) (13 diffs)
-
psImageManip.h (modified) (7 diffs)
-
psImageStats.c (modified) (8 diffs)
-
psImageStats.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/image/psImage.c
r1407 r1440 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1.3 8$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-08-0 7 00:06:06$12 * @version $Revision: 1.39 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-08-09 23:34:58 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 32 32 #include "psImage.h" 33 33 34 static void imageFree(psImage * image);34 static void imageFree(psImage* image); 35 35 36 36 /*****************************************************************************/ … … 40 40 /*****************************************************************************/ 41 41 42 psImage *psImageAlloc(unsigned int numCols, unsigned int numRows, const psElemType type)42 psImage* psImageAlloc(unsigned int numCols, unsigned int numRows, const psElemType type) 43 43 { 44 44 int area = 0; … … 61 61 } 62 62 63 psImage *image = (psImage *) psAlloc(sizeof(psImage));63 psImage* image = (psImage* ) psAlloc(sizeof(psImage)); 64 64 65 65 if (image == NULL) { … … 87 87 *(unsigned int *)&image->numCols = numCols; 88 88 *(unsigned int *)&image->numRows = numRows; 89 *(psDimen *) & image->type.dimen = PS_DIMEN_IMAGE;90 *(psElemType *) & image->type.type = type;89 *(psDimen* ) & image->type.dimen = PS_DIMEN_IMAGE; 90 *(psElemType* ) & image->type.type = type; 91 91 image->parent = NULL; 92 92 image->nChildren = 0; … … 96 96 } 97 97 98 static void imageFree(psImage * image)98 static void imageFree(psImage* image) 99 99 { 100 100 if (image == NULL) { … … 107 107 unsigned int oldNumRows = image->numRows; 108 108 unsigned int oldNumCols = image->numCols; 109 psPTR *rowPtr;109 psPTR* rowPtr; 110 110 111 111 for (unsigned int row = 0; row < oldNumRows; row++) { … … 124 124 } 125 125 126 psImage *psImageRecycle(psImage* old, unsigned int numCols, unsigned int numRows, const psElemType type)126 psImage* psImageRecycle(psImage* old, unsigned int numCols, unsigned int numRows, const psElemType type) 127 127 { 128 128 int elementSize = PSELEMTYPE_SIZEOF(type); // element … … 151 151 unsigned int oldNumRows = old->numRows; 152 152 unsigned int oldNumCols = old->numCols; 153 psPTR *rowPtr;153 psPTR* rowPtr; 154 154 155 155 for (unsigned int row = 0; row < oldNumRows; row++) { … … 177 177 *(unsigned int *)&old->numCols = numCols; 178 178 *(unsigned int *)&old->numRows = numRows; 179 *(psElemType *) & old->type.type = type;179 *(psElemType* ) & old->type.type = type; 180 180 181 181 return old; 182 182 } 183 183 184 int psImageFreeChildren(psImage * image)184 int psImageFreeChildren(psImage* image) 185 185 { 186 186 int i = 0; 187 187 int nChildren = 0; 188 psImage **children = NULL;188 psImage* *children = NULL; 189 189 int numFreed = 0; 190 190 … … 216 216 linear interpolation is performed on the image. 217 217 *****************************************************************************/ 218 psF32 psImagePixelInterpolate(const psImage * input,218 psF32 psImagePixelInterpolate(const psImage* input, 219 219 float x, float y, psF32 unexposedValue, psImageInterpolateMode mode) 220 220 { … … 259 259 260 260 #define PSIMAGE_PIXEL_INTERPOLATE_FLAT(TYPE) \ 261 inline psF64 p_psImagePixelInterpolateFLAT_##TYPE(const psImage *input, \261 inline psF64 p_psImagePixelInterpolateFLAT_##TYPE(const psImage* input, \ 262 262 float x, \ 263 263 float y, \ … … 280 280 281 281 #define PSIMAGE_PIXEL_INTERPOLATE_FLAT_COMPLEX(TYPE) \ 282 inline psC64 p_psImagePixelInterpolateFLAT_##TYPE(const psImage *input, \282 inline psC64 p_psImagePixelInterpolateFLAT_##TYPE(const psImage* input, \ 283 283 float x, \ 284 284 float y, \ … … 313 313 PSIMAGE_PIXEL_INTERPOLATE_FLAT_COMPLEX(C64) 314 314 #define PSIMAGE_PIXEL_INTERPOLATE_BILINEAR(TYPE) \ 315 inline psF64 p_psImagePixelInterpolateBILINEAR_##TYPE(const psImage *input, \315 inline psF64 p_psImagePixelInterpolateBILINEAR_##TYPE(const psImage* input, \ 316 316 float x, \ 317 317 float y, \ … … 368 368 } 369 369 #define PSIMAGE_PIXEL_INTERPOLATE_BILINEAR_COMPLEX(TYPE) \ 370 inline psC64 p_psImagePixelInterpolateBILINEAR_##TYPE(const psImage *input, \370 inline psC64 p_psImagePixelInterpolateBILINEAR_##TYPE(const psImage* input, \ 371 371 float x, \ 372 372 float y, \ -
trunk/psLib/src/image/psImage.h
r1426 r1440 12 12 * @author Ross Harman, MHPCC 13 13 * 14 * @version $Revision: 1. 29$ $Name: not supported by cvs2svn $15 * @date $Date: 2004-08-09 2 2:44:25$14 * @version $Revision: 1.30 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2004-08-09 23:34:58 $ 16 16 * 17 17 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 50 50 51 51 union { 52 psU8 **U8; ///< Unsigned 8-bit integer data.53 psU16 **U16; ///< Unsigned 16-bit integer data.54 psU32 **U32; ///< Unsigned 32-bit integer data.55 psU64 **U64; ///< Unsigned 64-bit integer data.56 psS8 **S8; ///< Signed 8-bit integer data.57 psS16 **S16; ///< Signed 16-bit integer data.58 psS32 **S32; ///< Signed 32-bit integer data.59 psS64 **S64; ///< Signed 64-bit integer data.60 psF32 **F32; ///< Single-precision float data.61 psF64 **F64; ///< Double-precision float data.62 psC32 **C32; ///< Single-precision complex data.63 psC64 **C64; ///< Double-precision complex data.64 psPTR **PTR; ///< Void pointers.65 psPTR *V; ///< Pointer to data.52 psU8* *U8; ///< Unsigned 8-bit integer data. 53 psU16* *U16; ///< Unsigned 16-bit integer data. 54 psU32* *U32; ///< Unsigned 32-bit integer data. 55 psU64* *U64; ///< Unsigned 64-bit integer data. 56 psS8* *S8; ///< Signed 8-bit integer data. 57 psS16* *S16; ///< Signed 16-bit integer data. 58 psS32* *S32; ///< Signed 32-bit integer data. 59 psS64* *S64; ///< Signed 64-bit integer data. 60 psF32* *F32; ///< Single-precision float data. 61 psF64* *F64; ///< Double-precision float data. 62 psC32* *C32; ///< Single-precision complex data. 63 psC64* *C64; ///< Double-precision complex data. 64 psPTR* *PTR; ///< Void pointers. 65 psPTR* V; ///< Pointer to data. 66 66 } data; ///< Union for data types. 67 const struct psImage *parent; ///< Parent, if a subimage.67 const struct psImage* parent; ///< Parent, if a subimage. 68 68 int nChildren; ///< Number of subimages. 69 struct psImage **children; ///< Children of this region.69 struct psImage* *children; ///< Children of this region. 70 70 } 71 71 psImage; … … 82 82 * specified size and type. 83 83 * 84 * @return psImage* : Pointer to psImage.84 * @return psImage* : Pointer to psImage. 85 85 * 86 86 */ 87 psImage *psImageAlloc(unsigned int numCols, ///< Number of rows in image.87 psImage* psImageAlloc(unsigned int numCols, ///< Number of rows in image. 88 88 unsigned int numRows, ///< Number of columns in image. 89 89 const psElemType type ///< Type of data for image. … … 95 95 * 96 96 */ 97 psImage *psImageRecycle(psImage* old, ///< the psImage to recycle by resizing image buffer97 psImage* psImageRecycle(psImage* old, ///< the psImage to recycle by resizing image buffer 98 98 unsigned int numCols, ///< the desired number of columns in image 99 99 unsigned int numRows, ///< the desired number of rows in image … … 106 106 * 107 107 */ 108 int psImageFreeChildren(psImage * image108 int psImageFreeChildren(psImage* image 109 109 110 110 /**< psImage in which all children shall be deallocated */ 111 111 ); 112 112 113 psF32 psImagePixelInterpolate(const psImage * input,113 psF32 psImagePixelInterpolate(const psImage* input, 114 114 float x, float y, psF32 unexposedValue, psImageInterpolateMode mode); 115 115 116 116 # define p_psImagePixelInterpolateFcns(TYPE) \ 117 117 inline psF64 p_psImagePixelInterpolateFLAT_##TYPE( \ 118 const psImage *input, \118 const psImage* input, \ 119 119 float x, \ 120 120 float y, \ … … 122 122 ); \ 123 123 inline psF64 p_psImagePixelInterpolateBILINEAR_##TYPE( \ 124 const psImage *input, \124 const psImage* input, \ 125 125 float x, \ 126 126 float y, \ … … 130 130 # define p_psImagePixelInterpolateComplexFcns(TYPE) \ 131 131 inline psC64 p_psImagePixelInterpolateFLAT_##TYPE( \ 132 const psImage *input, \132 const psImage* input, \ 133 133 float x, \ 134 134 float y, \ … … 136 136 ); \ 137 137 inline psC64 p_psImagePixelInterpolateBILINEAR_##TYPE( \ 138 const psImage *input, \138 const psImage* input, \ 139 139 float x, \ 140 140 float y, \ -
trunk/psLib/src/image/psImageExtraction.c
r1407 r1440 10 10 * @author Robert DeSonia, MHPCC 11 11 * 12 * @version $Revision: 1. 8$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-08-0 7 00:06:06$12 * @version $Revision: 1.9 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-08-09 23:34:58 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 23 23 #include "psError.h" 24 24 25 psImage *psImageSubset(psImage* out,26 psImage * image,25 psImage* psImageSubset(psImage* out, 26 psImage* image, 27 27 unsigned int numCols, unsigned int numRows, unsigned int col0, unsigned int row0) 28 28 { … … 83 83 *(int *)&out->row0 = row0; 84 84 *(int *)&out->col0 = col0; 85 *(psImage **) & out->parent = (psImage *) image;85 *(psImage* *) & out->parent = (psImage* ) image; 86 86 87 87 // add output image as a child of the input 88 88 // image. 89 89 image->nChildren++; 90 image->children = (psImage **) psRealloc(image->children, image->nChildren * sizeof(psImage *));90 image->children = (psImage* *) psRealloc(image->children, image->nChildren * sizeof(psImage* )); 91 91 image->children[image->nChildren - 1] = out; 92 92 … … 101 101 } 102 102 103 psImage *psImageCopy(psImage * restrict output, const psImage* input, psElemType type)103 psImage* psImageCopy(psImage* restrict output, const psImage* input, psElemType type) 104 104 { 105 105 psElemType inDatatype; … … 242 242 } 243 243 244 psVector *psImageSlice(psVector* out,245 psVector * slicePositions,246 const psImage * restrict in,247 const psImage * restrict mask,244 psVector* psImageSlice(psVector* out, 245 psVector* slicePositions, 246 const psImage* restrict in, 247 const psImage* restrict mask, 248 248 unsigned int maskVal, 249 249 unsigned int col, 250 250 unsigned int row, 251 251 unsigned int numCols, 252 unsigned int numRows, psImageCutDirection direction, const psStats * stats)252 unsigned int numRows, psImageCutDirection direction, const psStats* stats) 253 253 { 254 254 double statVal; 255 psStats *myStats;255 psStats* myStats; 256 256 psElemType type; 257 257 int inRows; 258 258 int inCols; 259 259 int delta = 1; 260 psF64 *outData;260 psF64* outData; 261 261 262 262 if (in == NULL || in->data.V == NULL) { … … 328 328 329 329 if (direction == PS_CUT_X_POS || direction == PS_CUT_X_NEG) { 330 psVector *imgVec = psVectorAlloc(numRows, type);331 psVector *maskVec = NULL;332 psMaskType *maskData = NULL;333 psU32 *outPosition = NULL;330 psVector* imgVec = psVectorAlloc(numRows, type); 331 psVector* maskVec = NULL; 332 psMaskType* maskData = NULL; 333 psU32* outPosition = NULL; 334 334 335 335 // recycle output to make a proper … … 362 362 if (maskVec != NULL) { \ 363 363 maskVecData = maskVec->data.V; \ 364 maskData = (psMaskType* )(mask->data.V[row]) + col + c; \364 maskData = (psMaskType* )(mask->data.V[row]) + col + c; \ 365 365 } \ 366 366 for (int r=0;r<numRows;r++) { \ … … 417 417 // Y 418 418 // direction 419 psVector *imgVec = NULL;420 psVector *maskVec = NULL;419 psVector* imgVec = NULL; 420 psVector* maskVec = NULL; 421 421 int elementSize = PSELEMTYPE_SIZEOF(type); 422 psU32 *outPosition = NULL;422 psU32* outPosition = NULL; 423 423 424 424 // fill in psVectors to fake out the -
trunk/psLib/src/image/psImageExtraction.h
r1426 r1440 10 10 * @author Robert DeSonia, MHPCC 11 11 * 12 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-08-09 2 2:44:25$12 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-08-09 23:34:58 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 40 40 * one. 41 41 * 42 * @return psImage* : Pointer to psImage.42 * @return psImage* : Pointer to psImage. 43 43 * 44 44 */ … … 54 54 /** Makes a copy of a psImage 55 55 * 56 * @return psImage* Copy of the input psImage. This may not be equal to the56 * @return psImage* Copy of the input psImage. This may not be equal to the 57 57 * output parameter 58 58 * … … 78 78 * @return psVector the resulting vector 79 79 */ 80 psVector *psImageSlice(80 psVector* psImageSlice( 81 81 psVector* out, ///< psVector to recycle, or NULL. 82 82 psVector* slicePositions, … … 111 111 * @return psVector resulting vector 112 112 */ 113 psVector *psImageCut(113 psVector* psImageCut( 114 114 psVector* out, ///< psVector to recycle, or NULL. 115 115 const psImage* input, ///< the input image in which to perform the cut -
trunk/psLib/src/image/psImageIO.c
r1407 r1440 8 8 * @author Robert DeSonia, MHPCC 9 9 * 10 * @version $Revision: 1. 9$ $Name: not supported by cvs2svn $11 * @date $Date: 2004-08-0 7 00:06:06$10 * @version $Revision: 1.10 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2004-08-09 23:34:58 $ 12 12 * 13 13 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 22 22 #include "psMemory.h" 23 23 24 psImage *psImageReadSection(psImage* output,24 psImage* psImageReadSection(psImage* output, 25 25 int col, 26 26 int row, … … 199 199 } 200 200 201 bool psImageWriteSection(psImage * input, int col0, int row0, int z, char *extname, int extnum,201 bool psImageWriteSection(psImage* input, int col0, int row0, int z, char *extname, int extnum, 202 202 char *filename) 203 203 { -
trunk/psLib/src/image/psImageIO.h
r1407 r1440 10 10 * @author Robert DeSonia, MHPCC 11 11 * 12 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-08-0 7 00:06:06$12 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-08-09 23:34:58 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 27 27 /** Read an image or subimage from a FITS file specified by a filename. 28 28 * 29 * return psImage* The image read from the specified file. NULL29 * return psImage* The image read from the specified file. NULL 30 30 * signifies that a problem had occured. 31 31 */ 32 psImage *psImageReadSection(psImage* output,32 psImage* psImageReadSection(psImage* output, 33 33 34 34 /**< the output psImage to recycle, or NULL if new psImage desired */ … … 67 67 * return bool TRUE is successful, otherwise FALSE. 68 68 */ 69 bool psImageWriteSection(psImage * input,69 bool psImageWriteSection(psImage* input, 70 70 71 71 /**< the psImage to write */ -
trunk/psLib/src/image/psImageManip.c
r1407 r1440 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.1 1$ $Name: not supported by cvs2svn $14 * @date $Date: 2004-08-0 7 00:06:06$13 * @version $Revision: 1.12 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2004-08-09 23:34:58 $ 15 15 * 16 16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 31 31 #include "psImageExtraction.h" 32 32 33 int psImageClip(psImage * input, psF64 min, psF64 vmin, psF64 max, psF64 vmax)33 int psImageClip(psImage* input, psF64 min, psF64 vmin, psF64 max, psF64 vmax) 34 34 { 35 35 int numClipped = 0; … … 125 125 } 126 126 127 int psImageClipNaN(psImage * input, psF64 value)127 int psImageClipNaN(psImage* input, psF64 value) 128 128 { 129 129 int numClipped = 0; … … 164 164 } 165 165 166 int psImageOverlaySection(psImage * image, const psImage* overlay, int col0, int row0, const char *op)166 int psImageOverlaySection(psImage* image, const psImage* overlay, int col0, int row0, const char *op) 167 167 { 168 168 unsigned int imageNumRows; … … 267 267 } 268 268 269 int psImageClipComplexRegion(psImage * input, psC64 min, psC64 vmin, psC64 max, psC64 vmax)269 int psImageClipComplexRegion(psImage* input, psC64 min, psC64 vmin, psC64 max, psC64 vmax) 270 270 { 271 271 int numClipped = 0; … … 340 340 } 341 341 342 psImage *psImageRebin(psImage * out, const psImage * in, unsigned int scale, const psStats* stats)342 psImage* psImageRebin(psImage* out, const psImage* in, unsigned int scale, const psStats* stats) 343 343 { 344 344 int inRows; … … 346 346 int outRows; 347 347 int outCols; 348 psVector *vec; // vector to hold348 psVector* vec; // vector to hold 349 349 350 350 // the values of 351 351 // a single bin. 352 psStats *myStats;352 psStats* myStats; 353 353 double statVal; 354 354 … … 444 444 } 445 445 446 psImage *psImageResample(psImage * out, const psImage* in, int scale, psImageInterpolateMode mode)446 psImage* psImageResample(psImage* out, const psImage* in, int scale, psImageInterpolateMode mode) 447 447 { 448 448 int outRows; … … 496 496 } 497 497 498 psImage *psImageRoll(psImage * out, const psImage* in, int dx, int dy)498 psImage* psImageRoll(psImage* out, const psImage* in, int dx, int dy) 499 499 { 500 500 int outRows; … … 534 534 inRowNumber -= outRows; 535 535 } 536 psU8 *inRow = in->data.U8[inRowNumber]; // to536 psU8* inRow = in->data.U8[inRowNumber]; // to 537 537 538 538 // allow … … 542 542 543 543 // but for all types 544 psU8 *outRow = out->data.U8[row];544 psU8* outRow = out->data.U8[row]; 545 545 546 546 memcpy(outRow, inRow + segment2Size, segment1Size); … … 551 551 } 552 552 553 psImage *psImageRotate(psImage* out,554 const psImage * in, float angle, float unexposedValue, psImageInterpolateMode mode)553 psImage* psImageRotate(psImage* out, 554 const psImage* in, float angle, float unexposedValue, psImageInterpolateMode mode) 555 555 { 556 556 if (in == NULL) { … … 803 803 } 804 804 805 psImage *psImageShift(psImage* out,806 const psImage * in,805 psImage* psImageShift(psImage* out, 806 const psImage* in, 807 807 float dx, float dy, psF64 unexposedValue, psImageInterpolateMode mode) 808 808 { -
trunk/psLib/src/image/psImageManip.h
r1426 r1440 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1. 8$ $Name: not supported by cvs2svn $14 * @date $Date: 2004-08-09 2 2:44:25$13 * @version $Revision: 1.9 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2004-08-09 23:34:58 $ 15 15 * 16 16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 32 32 * @return int The number of clipped pixels 33 33 */ 34 int psImageClip(psImage * input, ///< the image to clip34 int psImageClip(psImage* input, ///< the image to clip 35 35 psF64 min, ///< the minimum image value allowed 36 36 psF64 vmin, ///< the value pixels < min are set to … … 48 48 * @return int The number of clipped pixels 49 49 */ 50 int psImageClipComplexRegion(psImage * input, ///< the image to clip50 int psImageClipComplexRegion(psImage* input, ///< the image to clip 51 51 psC64 min, ///< the minimum image value allowed 52 52 psC64 vmin, ///< the value pixels < min are set to … … 62 62 * @return int The number of clipped pixels 63 63 */ 64 int psImageClipNaN(psImage * input, ///< the image to clip64 int psImageClipNaN(psImage* input, ///< the image to clip 65 65 psF64 value ///< the value to set all NaN/Inf values to 66 66 ); … … 77 77 * @return int 0 if success, non-zero if failed. 78 78 */ 79 int psImageOverlaySection(psImage * image, ///< target image80 const psImage * overlay, ///< the overlay image79 int psImageOverlaySection(psImage* image, ///< target image 80 const psImage* overlay, ///< the overlay image 81 81 int col0, ///< the column to start overlay 82 82 int row0, ///< the row to start overlay … … 94 94 * @return psImage new image formed by rebinning input image. 95 95 */ 96 psImage *psImageRebin(psImage* out, ///< an psImage to recycle. If NULL, a new image is created97 const psImage * in, ///< input image96 psImage* psImageRebin(psImage* out, ///< an psImage to recycle. If NULL, a new image is created 97 const psImage* in, ///< input image 98 98 unsigned int scale, ///< the scale to rebin for each dimension 99 const psStats * stats ///< the statistic to perform when rebinning. Only one99 const psStats* stats ///< the statistic to perform when rebinning. Only one 100 100 // method should be set. 101 101 ); 102 102 103 psImage *psImageResample(psImage* out, ///< an psImage to recycle. If NULL, a new image is created104 const psImage * in, ///< input image103 psImage* psImageResample(psImage* out, ///< an psImage to recycle. If NULL, a new image is created 104 const psImage* in, ///< input image 105 105 int scale, psImageInterpolateMode mode); 106 106 107 psImage *psImageRotate(psImage* out, ///< an psImage to recycle. If NULL, a new image is created108 const psImage * in, ///< input image107 psImage* psImageRotate(psImage* out, ///< an psImage to recycle. If NULL, a new image is created 108 const psImage* in, ///< input image 109 109 float angle, float unexposedValue, psImageInterpolateMode mode); 110 110 111 psImage *psImageShift(psImage* out, ///< an psImage to recycle. If NULL, a new image is created112 const psImage * in, ///< input image111 psImage* psImageShift(psImage* out, ///< an psImage to recycle. If NULL, a new image is created 112 const psImage* in, ///< input image 113 113 float dx, float dy, float unexposedValue, psImageInterpolateMode mode); 114 114 … … 119 119 * defined for psU8, psS8, psS16, psF32, psF64, psC32, and psC64. 120 120 * 121 * @return psImage* the rolled version of the input image.121 * @return psImage* the rolled version of the input image. 122 122 */ 123 psImage *psImageRoll(psImage* out, ///< an psImage to recycle. If NULL, a new image is created124 const psImage * in, ///< input image123 psImage* psImageRoll(psImage* out, ///< an psImage to recycle. If NULL, a new image is created 124 const psImage* in, ///< input image 125 125 int dx, ///< number of pixels to roll in the x-dimension 126 126 int dy ///< number of pixels to roll in the y-dimension -
trunk/psLib/src/image/psImageStats.c
r1407 r1440 10 10 * @author George Gusciora, MHPCC 11 11 * 12 * @version $Revision: 1.3 0$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-08-0 7 00:06:06$12 * @version $Revision: 1.31 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-08-09 23:34:58 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 37 37 NOTE: verify that image/mask have the correct types, and sizes. 38 38 *****************************************************************************/ 39 psStats *psImageStats(psStats * stats, psImage * in, psImage* mask, int maskVal)40 { 41 psVector *junkData = NULL;42 psVector *junkMask = NULL;39 psStats* psImageStats(psStats* stats, psImage* in, psImage* mask, int maskVal) 40 { 41 psVector* junkData = NULL; 42 psVector* junkMask = NULL; 43 43 44 44 if (stats == NULL) { … … 95 95 NOTE: verify that image/mask have the, correct types and sizes. 96 96 *****************************************************************************/ 97 psHistogram *psImageHistogram(psHistogram * out, psImage * in, psImage* mask, unsigned int maskVal)98 { 99 psVector *junkData = NULL;100 psVector *junkMask = NULL;97 psHistogram* psImageHistogram(psHistogram* out, psImage* in, psImage* mask, unsigned int maskVal) 98 { 99 psVector* junkData = NULL; 100 psVector* junkMask = NULL; 101 101 102 102 // NOTE: Verify this action. … … 183 183 } 184 184 185 psPolynomial1D **p_psCreateChebyshevPolys(int maxChebyPoly)186 { 187 psPolynomial1D **chebPolys = NULL;185 psPolynomial1D* *p_psCreateChebyshevPolys(int maxChebyPoly) 186 { 187 psPolynomial1D* *chebPolys = NULL; 188 188 int i = 0; 189 189 int j = 0; 190 190 191 chebPolys = (psPolynomial1D **) psAlloc(maxChebyPoly * sizeof(psPolynomial1D *));191 chebPolys = (psPolynomial1D* *) psAlloc(maxChebyPoly * sizeof(psPolynomial1D* )); 192 192 for (i = 0; i < maxChebyPoly; i++) { 193 193 chebPolys[i] = psPolynomial1DAlloc(i + 1); … … 224 224 over all pixels (x,y) in the image. 225 225 *****************************************************************************/ 226 psPolynomial2D *psImageFitPolynomial(const psImage * input, psPolynomial2D* coeffs)226 psPolynomial2D* psImageFitPolynomial(const psImage* input, psPolynomial2D* coeffs) 227 227 { 228 228 int x = 0; … … 231 231 int j = 0; 232 232 float **sums = NULL; 233 psPolynomial1D **chebPolys = NULL;233 psPolynomial1D* *chebPolys = NULL; 234 234 int maxChebyPoly = 0; 235 235 float *cScalingFactors = NULL; … … 327 327 328 328 *****************************************************************************/ 329 int psImageEvalPolynomial(const psImage * input, const psPolynomial2D* coeffs)329 int psImageEvalPolynomial(const psImage* input, const psPolynomial2D* coeffs) 330 330 { 331 331 int x = 0; … … 334 334 int j = 0; 335 335 float **sums = NULL; 336 psPolynomial1D **chebPolys = NULL;336 psPolynomial1D* *chebPolys = NULL; 337 337 int maxChebyPoly = 0; 338 338 float *cScalingFactors = NULL; -
trunk/psLib/src/image/psImageStats.h
r1426 r1440 10 10 * @author George Gusciora, MHPCC 11 11 * 12 * @version $Revision: 1.1 2$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-08-09 2 2:44:25$12 * @version $Revision: 1.13 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-08-09 23:34:58 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 28 28 29 29 /// This routine must determine the various statistics for the image. 30 psStats *psImageStats(psStats* stats, ///< defines statistics to be calculated31 psImage * in, ///< image (or subimage) to calculate stats32 psImage * mask, ///< mask data for image (NULL ok)30 psStats* psImageStats(psStats* stats, ///< defines statistics to be calculated 31 psImage* in, ///< image (or subimage) to calculate stats 32 psImage* mask, ///< mask data for image (NULL ok) 33 33 int maskVal); ///< mask Mask for mask 34 34 35 psHistogram *psImageHistogram(psHistogram* out, ///< input histogram description & target36 psImage * in, ///< Image data to be histogramed.37 psImage * mask, ///< mask data for image (NULL ok)35 psHistogram* psImageHistogram(psHistogram* out, ///< input histogram description & target 36 psImage* in, ///< Image data to be histogramed. 37 psImage* mask, ///< mask data for image (NULL ok) 38 38 unsigned int maskVal); ///< mask Mask for mask 39 39 40 40 /// Fit a 2-D polynomial surface to an image. 41 psPolynomial2D *psImageFitPolynomial(const psImage* input, ///< image to fit42 psPolynomial2D * coeffs ///< coefficient structure carries in41 psPolynomial2D* psImageFitPolynomial(const psImage* input, ///< image to fit 42 psPolynomial2D* coeffs ///< coefficient structure carries in 43 43 // desired terms & target 44 44 ); 45 45 46 46 /// Evaluate a 2-D polynomial surface to image pixels. 47 int psImageEvalPolynomial(const psImage * input, ///< image to fit48 const psPolynomial2D * coeffs ///< coefficient structure carries in desired terms47 int psImageEvalPolynomial(const psImage* input, ///< image to fit 48 const psPolynomial2D* coeffs ///< coefficient structure carries in desired terms 49 49 ); 50 50
Note:
See TracChangeset
for help on using the changeset viewer.
