Changeset 4534
- Timestamp:
- Jul 11, 2005, 11:38:19 AM (21 years ago)
- Location:
- trunk/psLib
- Files:
-
- 15 edited
-
pslib.kdevses (modified) (1 diff)
-
src/dataManip/psBinaryOp.c (modified) (2 diffs)
-
src/dataManip/psBinaryOp.h (modified) (2 diffs)
-
src/dataManip/psUnaryOp.c (modified) (2 diffs)
-
src/dataManip/psUnaryOp.h (modified) (2 diffs)
-
src/image/psImage.c (modified) (2 diffs)
-
src/image/psImage.h (modified) (3 diffs)
-
src/image/psImageConvolve.c (modified) (9 diffs)
-
src/image/psImageConvolve.h (modified) (3 diffs)
-
src/image/psImageFFT.h (modified) (3 diffs)
-
src/image/psImageGeomManip.c (modified) (2 diffs)
-
src/image/psImagePixelExtract.c (modified) (2 diffs)
-
src/image/psImagePixelManip.c (modified) (2 diffs)
-
src/image/psImagePixelManip.h (modified) (2 diffs)
-
test/image/tst_psImageConvolve.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/pslib.kdevses
r4526 r4534 2 2 <!DOCTYPE KDevPrjSession> 3 3 <KDevPrjSession> 4 <DocsAndViews NumberOfDocuments=" 5" >4 <DocsAndViews NumberOfDocuments="10" > 5 5 <Doc0 NumberOfViews="1" URL="file:/home/drobbin/panstarrs/psLib/src/image/psImage.h" > 6 <View0 line="53"Type="Source" />6 <View0 Type="Source" /> 7 7 </Doc0> 8 <Doc1 NumberOfViews="1" URL="file:/home/drobbin/panstarrs/psLib/src/image/psImage .c" >9 <View0 line="150"Type="Source" />8 <Doc1 NumberOfViews="1" URL="file:/home/drobbin/panstarrs/psLib/src/image/psImagePixelExtract.c" > 9 <View0 Type="Source" /> 10 10 </Doc1> 11 <Doc2 NumberOfViews="1" URL="file:/home/drobbin/panstarrs/psLib/ test/image/tst_psImageStructManip.c" >12 <View0 line="39"Type="Source" />11 <Doc2 NumberOfViews="1" URL="file:/home/drobbin/panstarrs/psLib/src/image/psImageGeomManip.c" > 12 <View0 Type="Source" /> 13 13 </Doc2> 14 <Doc3 NumberOfViews="1" URL="file:/home/drobbin/panstarrs/psLib/src/ dataIO/psDB.h" >15 <View0 line="22"Type="Source" />14 <Doc3 NumberOfViews="1" URL="file:/home/drobbin/panstarrs/psLib/src/image/psImageGeomManip.h" > 15 <View0 Type="Source" /> 16 16 </Doc3> 17 <Doc4 NumberOfViews="1" URL="file:/home/drobbin/panstarrs/psLib/src/ dataIO/psFits.h" >18 <View0 line="259"Type="Source" />17 <Doc4 NumberOfViews="1" URL="file:/home/drobbin/panstarrs/psLib/src/image/psImage.c" > 18 <View0 Type="Source" /> 19 19 </Doc4> 20 <Doc5 NumberOfViews="1" URL="file:/home/drobbin/panstarrs/psLib/src/collections/psPixels.h" > 21 <View0 Type="Source" /> 22 </Doc5> 23 <Doc6 NumberOfViews="1" URL="file:/home/drobbin/panstarrs/psLib/src/dataManip/psBinaryOp.h" > 24 <View0 Type="Source" /> 25 </Doc6> 26 <Doc7 NumberOfViews="1" URL="file:/home/drobbin/panstarrs/psLib/src/dataManip/psBinaryOp.c" > 27 <View0 Type="Source" /> 28 </Doc7> 29 <Doc8 NumberOfViews="1" URL="file:/home/drobbin/panstarrs/psLib/src/dataManip/psUnaryOp.h" > 30 <View0 Type="Source" /> 31 </Doc8> 32 <Doc9 NumberOfViews="1" URL="file:/home/drobbin/panstarrs/psLib/src/dataManip/psUnaryOp.c" > 33 <View0 line="305" Type="Source" /> 34 </Doc9> 20 35 </DocsAndViews> 21 36 <pluginList> -
trunk/psLib/src/dataManip/psBinaryOp.c
r4342 r4534 30 30 * @author Robert DeSonia, MHPCC 31 31 * 32 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $33 * @date $Date: 2005-0 6-22 02:05:41$32 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 33 * @date $Date: 2005-07-11 21:38:19 $ 34 34 * 35 35 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 426 426 } 427 427 428 ps PtrpsBinaryOp(psPtr out, const psPtr in1, const char *op, const psPtr in2)428 psMathType* psBinaryOp(psPtr out, const psPtr in1, const char *op, const psPtr in2) 429 429 { 430 430 -
trunk/psLib/src/dataManip/psBinaryOp.h
r4342 r4534 30 30 * @author Robert DeSonia, MHPCC 31 31 * 32 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $33 * @date $Date: 2005-0 6-22 02:05:41$32 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 33 * @date $Date: 2005-07-11 21:38:19 $ 34 34 * 35 35 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 55 55 * @return psType* : Pointer to either psImage or psVector. 56 56 */ 57 ps Type* psBinaryOp(57 psMathType* psBinaryOp( 58 58 psPtr out, ///< Output type, either psImage or psVector. 59 59 const psPtr in1, ///< First input, either psImage or psVector. -
trunk/psLib/src/dataManip/psUnaryOp.c
r4409 r4534 30 30 * @author Robert DeSonia, MHPCC 31 31 * 32 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $33 * @date $Date: 2005-0 6-28 20:17:52$32 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 33 * @date $Date: 2005-07-11 21:38:19 $ 34 34 * 35 35 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 304 304 } 305 305 306 ps PtrpsUnaryOp(psPtr out, const psPtr in, const char *op)306 psMathType* psUnaryOp(psPtr out, const psPtr in, const char *op) 307 307 { 308 308 #define psUnaryOp_EXIT { \ -
trunk/psLib/src/dataManip/psUnaryOp.h
r4409 r4534 30 30 * @author Robert DeSonia, MHPCC 31 31 * 32 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $33 * @date $Date: 2005-0 6-28 20:17:52$32 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 33 * @date $Date: 2005-07-11 21:38:19 $ 34 34 * 35 35 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 59 59 * @return psType* : Pointer to either psImage or psVector. 60 60 */ 61 ps Type* psUnaryOp(61 psMathType* psUnaryOp( 62 62 psPtr out, ///< Output type, either psImage or psVector. 63 63 const psPtr in, ///< Input, either psImage or psVector. -
trunk/psLib/src/image/psImage.c
r4526 r4534 9 9 * @author Ross Harman, MHPCC 10 10 * 11 * @version $Revision: 1.7 4$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-07- 09 01:24:30$11 * @version $Revision: 1.75 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-07-11 21:38:19 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 369 369 } 370 370 371 psC64psImagePixelInterpolate(const psImage* input,372 float x,373 float y,374 const psImage* mask,375 psU32maskVal,376 psC64unexposedValue,377 psImageInterpolateMode mode)371 complex psImagePixelInterpolate(const psImage* input, 372 float x, 373 float y, 374 const psImage* mask, 375 psMaskType maskVal, 376 complex unexposedValue, 377 psImageInterpolateMode mode) 378 378 { 379 379 -
trunk/psLib/src/image/psImage.h
r4526 r4534 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.6 1$ $Name: not supported by cvs2svn $14 * @date $Date: 2005-07- 09 01:24:30$13 * @version $Revision: 1.62 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2005-07-11 21:38:19 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 40 40 PS_INTERPOLATE_LANCZOS3_VARIANCE, ///< Variance version of PS_INTERPOLATE_LANCZOS3 41 41 PS_INTERPOLATE_LANCZOS4_VARIANCE, ///< Variance version of PS_INTERPOLATE_LANCZOS4 42 PS_INTERPOLATE_NUM_MODES ///< enum end-marker; does not coorespond to a interpolation mode42 // PS_INTERPOLATE_NUM_MODES ///< enum end-marker; does not coorespond to a interpolation mode 43 43 } psImageInterpolateMode; 44 44 … … 197 197 * given x,y doesn't coorespond to a valid image location 198 198 */ 199 psC64psImagePixelInterpolate(199 complex psImagePixelInterpolate( 200 200 const psImage* input, ///< input image for interpolation 201 201 float x, ///< column location to derive value of 202 202 float y, ///< row location ot derive value of 203 203 const psImage* mask, ///< if not NULL, the mask of the input image 204 ps U32 maskVal,///< the mask value205 psC64 unexposedValue,///< return value if x,y location is not in image.204 psMaskType maskVal, ///< the mask value 205 complex unexposedValue, ///< return value if x,y location is not in image. 206 206 psImageInterpolateMode mode ///< interpolation mode 207 207 ); -
trunk/psLib/src/image/psImageConvolve.c
r4392 r4534 5 5 * @author Robert DeSonia, MHPCC 6 6 * 7 * @version $Revision: 1.2 0$ $Name: not supported by cvs2svn $8 * @date $Date: 2005-0 6-25 02:02:05$7 * @version $Revision: 1.21 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2005-07-11 21:38:19 $ 9 9 * 10 10 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 65 65 result->image = psImageAlloc(numCols,numRows,PS_TYPE_KERNEL); 66 66 memset(result->image->rawDataBuffer,0,numCols*numRows*PSELEMTYPE_SIZEOF(PS_TYPE_KERNEL)); 67 result->p_kernelRows = psAlloc(sizeof( psKernelType*)*numRows);68 69 psKernelType** kernelRows = result->p_kernelRows;70 psKernelType** imageRows = result->image->data.PS_TYPE_KERNEL_DATA;67 result->p_kernelRows = psAlloc(sizeof(float*)*numRows); 68 69 float** kernelRows = result->p_kernelRows; 70 float** imageRows = result->image->data.PS_TYPE_KERNEL_DATA; 71 71 for (psS32 i = 0; i < numRows; i++) { 72 72 kernelRows[i] = imageRows[i] - xMin; … … 103 103 psS32 yMax = 0; 104 104 psS32 length = 0; 105 psKernelTypenormalizeTime = 1.0; // fraction of total time for each shift clock105 float normalizeTime = 1.0; // fraction of total time for each shift clock 106 106 psKernel* result = NULL; 107 psKernelType** kernel = NULL;107 float** kernel = NULL; 108 108 109 109 // got non-NULL vectors? … … 170 170 } \ 171 171 \ 172 normalizeTime = 1.0 / ( psKernelType)(tShiftData[length-1]); \172 normalizeTime = 1.0 / (float)(tShiftData[length-1]); \ 173 173 result = psKernelAlloc(xMin,xMax,yMin,yMax); \ 174 174 kernel = result->kernel; \ … … 180 180 y = lastY - yShiftData[i]; \ 181 181 \ 182 kernel[y][x] += ( psKernelType)t / (psKernelType)lastT; \182 kernel[y][x] += (float)t / (float)lastT; \ 183 183 prevT = tShiftData[i]; \ 184 184 } \ … … 216 216 kernel = result->kernel; \ 217 217 \ 218 normalizeTime = 1.0 / ( psKernelType)t; \218 normalizeTime = 1.0 / (float)t; \ 219 219 x = 0; \ 220 220 y = 0; \ 221 221 for (psS32 i = length-1; i >= 0; i--) { \ 222 kernel[y][x] += ( psKernelType)(tShiftData[i]) * normalizeTime; \222 kernel[y][x] += (float)(tShiftData[i]) * normalizeTime; \ 223 223 x -= xShiftData[i]; \ 224 224 y -= yShiftData[i]; \ … … 296 296 psS32 yMin = kernel->yMin; 297 297 psS32 yMax = kernel->yMax; 298 psKernelType** kData = kernel->kernel;298 float** kData = kernel->kernel; 299 299 300 300 // make the output image to the proper size and type … … 399 399 // pad the kernel to the same size of paddedImage 400 400 psImage* paddedKernel = psImageAlloc(paddedCols,paddedRows,PS_TYPE_KERNEL); 401 memset(paddedKernel->data.U8[0],0,sizeof( psKernelType)*numCols*numRows); // zero-out image401 memset(paddedKernel->data.U8[0],0,sizeof(float)*numCols*numRows); // zero-out image 402 402 psS32 yMax = kernel->yMax; 403 403 psS32 xMax = kernel->xMax; … … 407 407 padRow += paddedRows; 408 408 } 409 psKernelType* padData = paddedKernel->data.PS_TYPE_KERNEL_DATA[padRow];410 psKernelType* kernelRow = kernel->kernel[row];409 float* padData = paddedKernel->data.PS_TYPE_KERNEL_DATA[padRow]; 410 float* kernelRow = kernel->kernel[row]; 411 411 for (psS32 col = kernel->xMin; col <= xMax; col++) { 412 412 if (col < 0) { -
trunk/psLib/src/image/psImageConvolve.h
r4316 r4534 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1. 8$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-0 6-18 03:13:02$9 * @version $Revision: 1.9 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-07-11 21:38:19 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 25 25 26 26 /** Kernel Type 27 * 27 * 28 28 * A floating-point data type used for storing kernel data. 29 * 29 * 30 30 */ 31 typedef psF32psKernelType;31 //typedef float psKernelType; 32 32 33 33 /** A convolution kernel */ … … 35 35 { 36 36 psImage* image; ///< Kernel data, in the form of an image 37 psS32xMin; ///< Most negative x index38 psS32yMin; ///< Most negative y index39 psS32xMax; ///< Most positive x index40 psS32yMax; ///< Most positive y index41 psKernelType** kernel;///< Pointer to the kernel data42 psKernelType** p_kernelRows;///< Pointer to the rows of the kernel data; not intended for user use.37 int xMin; ///< Most negative x index 38 int yMin; ///< Most negative y index 39 int xMax; ///< Most positive x index 40 int yMax; ///< Most positive y index 41 float** kernel; ///< Pointer to the kernel data 42 float** p_kernelRows; ///< Pointer to the rows of the kernel data; not intended for user use. 43 43 } 44 44 psKernel; -
trunk/psLib/src/image/psImageFFT.h
r4316 r4534 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1. 5$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-0 6-18 03:13:02$9 * @version $Revision: 1.6 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-07-11 21:38:19 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 33 33 psImage* psImageFFT( 34 34 psImage* out, ///< a psImage to recycle. If NULL, a new psImage is made. 35 const psImage* image, ///< the psImage to apply transform to35 const psImage* image, ///< the psImage to apply transform to 36 36 psFFTFlags direction ///< the direction of the transform 37 37 ); … … 79 79 */ 80 80 psImage* psImagePowerSpectrum( 81 psImage* out, ///< a psImage to recycle. If NULL, a new psImage is made.82 const psImage* in ///< the psImage to power spectrum of81 psImage* out, ///< a psImage to recycle. If NULL, a new psImage is made. 82 const psImage* in ///< the psImage to power spectrum of 83 83 ); 84 84 -
trunk/psLib/src/image/psImageGeomManip.c
r4385 r4534 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1.1 1$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-0 6-25 00:51:28$12 * @version $Revision: 1.12 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-07-11 21:38:19 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 196 196 } 197 197 198 if (mode < PS_INTERPOLATE_FLAT || mode >= PS_INTERPOLATE_NUM_MODES) {198 if (mode > PS_INTERPOLATE_LANCZOS4_VARIANCE ) { 199 199 psError(PS_ERR_BAD_PARAMETER_VALUE, true, 200 200 PS_ERRORTEXT_psImageManip_INTERPOLATION_MODE_UNSUPPORTED, -
trunk/psLib/src/image/psImagePixelExtract.c
r4385 r4534 8 8 * @author Robert DeSonia, MHPCC 9 9 * 10 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $11 * @date $Date: 2005-0 6-25 00:51:28$10 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2005-07-11 21:38:19 $ 12 12 * 13 13 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 312 312 } 313 313 314 if (mode < PS_INTERPOLATE_FLAT || mode >= PS_INTERPOLATE_NUM_MODES) {314 if (mode < PS_INTERPOLATE_FLAT ) { 315 315 psError(PS_ERR_BAD_PARAMETER_VALUE, true, 316 316 PS_ERRORTEXT_psImageManip_INTERPOLATION_MODE_UNSUPPORTED, -
trunk/psLib/src/image/psImagePixelManip.c
r4385 r4534 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-0 6-25 00:51:28$12 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-07-11 21:38:19 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 185 185 } 186 186 187 psS32psImageOverlaySection(psImage* image,188 const psImage* overlay,189 psS32col0,190 psS32row0,191 const char *op)187 int psImageOverlaySection(psImage* image, 188 const psImage* overlay, 189 int col0, 190 int row0, 191 const char *op) 192 192 { 193 193 psU32 imageNumRows; -
trunk/psLib/src/image/psImagePixelManip.h
r4385 r4534 8 8 * @author Robert DeSonia, MHPCC 9 9 * 10 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $11 * @date $Date: 2005-0 6-25 00:51:28$10 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2005-07-11 21:38:19 $ 12 12 * 13 13 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 78 78 * function is defined for psU8, psS8, psS16, psF32, psF64, psC32, and psC64. 79 79 * 80 * @return psS320 if success, non-zero if failed.80 * @return int 0 if success, non-zero if failed. 81 81 */ 82 psS32psImageOverlaySection(82 int psImageOverlaySection( 83 83 psImage* image, ///< target image 84 84 const psImage* overlay, ///< the overlay image 85 psS32 col0,///< the column to start overlay86 psS32 row0,///< the row to start overlay85 int col0, ///< the column to start overlay 86 int row0, ///< the row to start overlay 87 87 const char *op ///< the operation to perform for overlay 88 88 ); -
trunk/psLib/test/image/tst_psImageConvolve.c
r3702 r4534 5 5 * @author Robert DeSonia, MHPCC 6 6 * 7 * @version $Revision: 1.1 0$ $Name: not supported by cvs2svn $8 * @date $Date: 2005-0 4-15 00:12:09 $7 * @version $Revision: 1.11 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2005-07-11 21:38:19 $ 9 9 * 10 10 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 121 121 psS32 x[] = { 0, 1, 0, -1, 0 }; 122 122 psS32 y[] = { 2, 1, -1, -2, 0 }; 123 psKernelTypesum;123 float sum; 124 124 125 125 psVector* xVec = psVectorAlloc(size,PS_TYPE_U32);
Note:
See TracChangeset
for help on using the changeset viewer.
