Changeset 4540 for trunk/psLib/src/mathtypes
- Timestamp:
- Jul 12, 2005, 9:12:01 AM (21 years ago)
- Location:
- trunk/psLib/src/mathtypes
- Files:
-
- 1 added
- 7 edited
-
Makefile.am (modified) (1 diff)
-
mathtypes.i (added)
-
psImage.c (modified) (5 diffs)
-
psImage.h (modified) (9 diffs)
-
psScalar.c (modified) (2 diffs)
-
psScalar.h (modified) (2 diffs)
-
psVector.c (modified) (8 diffs)
-
psVector.h (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/mathtypes/Makefile.am
r4446 r4540 1 #Makefile for collections functions of psLib1 #Makefile for mathtypes functions of psLib 2 2 # 3 noinst_LTLIBRARIES = libpslibmathtypes.la 3 4 4 INCLUDES = \ 5 -I$(top_srcdir)/src/astro \ 6 -I$(top_srcdir)/src/db \ 7 -I$(top_srcdir)/src/fft \ 8 -I$(top_srcdir)/src/fits \ 9 -I$(top_srcdir)/src/imageops \ 10 -I$(top_srcdir)/src/math \ 11 -I$(top_srcdir)/src/mathtypes \ 12 -I$(top_srcdir)/src/sys \ 13 -I$(top_srcdir)/src/types \ 14 -I$(top_srcdir)/src/xml \ 15 $(all_includes) 5 libpslibmathtypes_la_SOURCES = \ 6 psImage.c \ 7 psScalar.c \ 8 psVector.c 16 9 17 noinst_LTLIBRARIES = libpslibcollections.la 18 19 libpslibcollections_la_SOURCES = \ 20 psBitSet.c \ 21 psVector.c \ 22 psPixels.c \ 23 psList.c \ 24 psScalar.c \ 25 psCompare.c \ 26 psArray.c \ 27 psHash.c \ 28 psMetadata.c \ 29 psMetadataIO.c 30 31 BUILT_SOURCES = psCollectionsErrors.h 32 EXTRA_DIST = psCollectionsErrors.dat psCollectionsErrors.h collections.i 33 34 psCollectionsErrors.h:psCollectionsErrors.dat 35 $(top_srcdir)/src/psParseErrorCodes --data=$? $@ 10 EXTRA_DIST = mathtypes.i 36 11 37 12 pslibincludedir = $(includedir) 38 13 pslibinclude_HEADERS = \ 39 psBitSet.h \ 40 psVector.h \ 41 psPixels.h \ 42 psList.h \ 14 psImage.h \ 43 15 psScalar.h \ 44 psCompare.h \ 45 psArray.h \ 46 psHash.h \ 47 psMetadata.h \ 48 psMetadataIO.h 49 16 psVector.h -
trunk/psLib/src/mathtypes/psImage.c
r4409 r4540 9 9 * @author Ross Harman, MHPCC 10 10 * 11 * @version $Revision: 1.7 2$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-0 6-28 20:17:52$11 * @version $Revision: 1.73 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-07-12 19:12:01 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 48 48 } 49 49 50 psImage* psImageAlloc( psU32numCols,51 psU32numRows,50 psImage* psImageAlloc(int numCols, 51 int numRows, 52 52 psElemType type) 53 53 { … … 91 91 } 92 92 93 psRegion psRegionSet( psF32x0,94 psF32x1,95 psF32y0,96 psF32y1)93 psRegion psRegionSet(float x0, 94 float x1, 95 float y0, 96 float y1) 97 97 { 98 98 psRegion out; … … 149 149 150 150 psImage* psImageRecycle(psImage* old, 151 psU32numCols,152 psU32numRows,151 int numCols, 152 int numRows, 153 153 const psElemType type) 154 154 { … … 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/mathtypes/psImage.h
r4409 r4540 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1. 59$ $Name: not supported by cvs2svn $14 * @date $Date: 2005-0 6-28 20:17:52$13 * @version $Revision: 1.60 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2005-07-12 19:12:01 $ 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 … … 51 51 typedef struct psImage 52 52 { 53 const ps Type type;///< Image data type and dimension.54 const psU32 numCols;///< Number of columns in image55 const psU32 numRows;///< Number of rows in image.56 const psS32 col0;///< Column position relative to parent.57 const psS32 row0;///< Row position relative to parent.53 const psMathType type; ///< Image data type and dimension. 54 const int numCols; ///< Number of columns in image 55 const int numRows; ///< Number of rows in image. 56 const int col0; ///< Column position relative to parent. 57 const int row0; ///< Row position relative to parent. 58 58 59 59 union { … … 77 77 78 78 psPtr rawDataBuffer; ///< Raw data buffer for Allocating/Freeing Images 79 void *lock; ///< Optional lock for thread safety 79 80 } 80 81 psImage; … … 87 88 typedef struct 88 89 { 89 psF32x0; ///< the first column of the region.90 psF32x1; ///< the last column of the region.91 psF32y0; ///< the first row of the region.92 psF32y1; ///< the last row of the region.90 float x0; ///< the first column of the region. 91 float x1; ///< the last column of the region. 92 float y0; ///< the first row of the region. 93 float y1; ///< the last row of the region. 93 94 } 94 95 psRegion; … … 103 104 */ 104 105 psImage* psImageAlloc( 105 psU32 numCols,///< Number of rows in image.106 psU32 numRows,///< Number of columns in image.106 int numCols, ///< Number of rows in image. 107 int numRows, ///< Number of columns in image. 107 108 psElemType type ///< Type of data for image. 108 ); 109 ) 110 ; 109 111 110 112 /** Create a psRegion with the specified attributes. … … 113 115 */ 114 116 psRegion psRegionSet( 115 psF32 x0,///< the first column of the region.116 psF32 x1,///< the last column of the region + 1.117 psF32 y0,///< the first row of the region.118 psF32 y1///< the last row of the region + 1.117 float x0, ///< the first column of the region. 118 float x1, ///< the last column of the region + 1. 119 float y0, ///< the first row of the region. 120 float y1 ///< the last row of the region + 1. 119 121 ); 120 122 … … 146 148 psImage* psImageRecycle( 147 149 psImage* old, ///< the psImage to recycle by resizing image buffer 148 psU32 numCols,///< the desired number of columns in image149 psU32 numRows,///< the desired number of rows in image150 int numCols, ///< the desired number of columns in image 151 int numRows, ///< the desired number of rows in image 150 152 const psElemType type ///< the desired datatype of the image 151 153 ); 152 154 153 155 /** Copy an image to a new buffer 154 * 156 * 155 157 * @return True if image copied or false if error 156 158 */ … … 195 197 * given x,y doesn't coorespond to a valid image location 196 198 */ 197 psC64psImagePixelInterpolate(199 complex psImagePixelInterpolate( 198 200 const psImage* input, ///< input image for interpolation 199 201 float x, ///< column location to derive value of 200 202 float y, ///< row location ot derive value of 201 203 const psImage* mask, ///< if not NULL, the mask of the input image 202 ps U32 maskVal,///< the mask value203 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. 204 206 psImageInterpolateMode mode ///< interpolation mode 205 207 ); -
trunk/psLib/src/mathtypes/psScalar.c
r4409 r4540 8 8 * @author Ross Harman, MHPCC 9 9 * 10 * @version $Revision: 1.1 6$ $Name: not supported by cvs2svn $11 * @date $Date: 2005-0 6-28 20:17:52$10 * @version $Revision: 1.17 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2005-07-12 19:12:01 $ 12 12 * 13 13 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 20 20 #include "psAbort.h" 21 21 22 #include "ps CollectionsErrors.h"22 #include "psErrorText.h" 23 23 24 24 psScalar* psScalarAlloc(complex value, psElemType type) -
trunk/psLib/src/mathtypes/psScalar.h
r4409 r4540 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.1 4$ $Name: not supported by cvs2svn $14 * @date $Date: 2005-0 6-28 20:17:52$13 * @version $Revision: 1.15 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2005-07-12 19:12:01 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 32 32 typedef struct 33 33 { 34 ps Type type;///< Type of data.34 psMathType type; ///< Type of data. 35 35 36 36 union { -
trunk/psLib/src/mathtypes/psVector.c
r4409 r4540 9 9 * @author Robert DeSonia, MHPCC 10 10 * 11 * @version $Revision: 1.4 5$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-0 6-28 20:17:52$11 * @version $Revision: 1.46 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-07-12 19:12:01 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 26 26 #include "psCompare.h" 27 27 28 #include "ps CollectionsErrors.h"28 #include "psErrorText.h" 29 29 30 30 typedef struct … … 48 48 // FUNCTION IMPLEMENTATION - PUBLIC 49 49 50 psVector* psVectorAlloc( unsignedlong nalloc, psElemType type)50 psVector* psVectorAlloc( long nalloc, psElemType type) 51 51 { 52 52 psVector* psVec = NULL; … … 67 67 psVec->type.dimen = PS_DIMEN_VECTOR; 68 68 psVec->type.type = type; 69 *( int*)&psVec->nalloc = nalloc;69 *(long*)&psVec->nalloc = nalloc; 70 70 psVec->n = nalloc; 71 71 … … 76 76 } 77 77 78 psVector* psVectorRealloc(psVector* vector, unsignedlong nalloc)78 psVector* psVectorRealloc(psVector* vector, long nalloc) 79 79 { 80 80 psS32 elementSize = 0; … … 93 93 // Realloc after decrementation to avoid accessing freed array elements 94 94 vector->data.U8 = psRealloc(vector->data.U8, nalloc * elementSize); 95 *( int*)&vector->nalloc = nalloc;95 *(long*)&vector->nalloc = nalloc; 96 96 } 97 97 … … 99 99 } 100 100 101 psVector* psVectorRecycle(psVector* vector, unsignedlong nalloc, psElemType type)101 psVector* psVectorRecycle(psVector* vector, long nalloc, psElemType type) 102 102 { 103 103 psS32 byteSize; … … 120 120 if (byteSize > vector->nalloc*PSELEMTYPE_SIZEOF(vector->type.type)) { 121 121 vector->data.U8 = psRealloc(vector->data.U8, byteSize); 122 *( int*)&vector->nalloc = nalloc;122 *(long*)&vector->nalloc = nalloc; 123 123 } 124 124 -
trunk/psLib/src/mathtypes/psVector.h
r4409 r4540 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.3 7$ $Name: not supported by cvs2svn $14 * @date $Date: 2005-0 6-28 20:17:52$13 * @version $Revision: 1.38 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2005-07-12 19:12:01 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 51 51 typedef struct 52 52 { 53 ps Type type; ///< Type of data.54 int n;///< Number of elements in use.55 const int nalloc;///< Total number of elements available.53 psMathType type; ///< Type of data. 54 long n; ///< Number of elements in use. 55 const long nalloc; ///< Total number of elements available. 56 56 p_psVectorData data; ///< Union for data types. 57 void *lock; ///< Optional lock for thread safety. 57 58 } 58 59 psVector; … … 73 74 */ 74 75 psVector* psVectorAlloc( 75 unsigned long nalloc,///< Total number of elements to make available.76 long nalloc, ///< Total number of elements to make available. 76 77 psElemType type ///< Type of data to be held by vector. 77 ); 78 ) 79 ; 78 80 79 81 /** Reallocate a vector. … … 88 90 psVector* psVectorRealloc( 89 91 psVector* vector, ///< Vector to reallocate. 90 unsigned long nalloc///< Total number of elements to make available.92 long nalloc ///< Total number of elements to make available. 91 93 ); 92 94 … … 120 122 ///< taken to preserve the values. 121 123 122 unsigned long nalloc,///< Total number of elements to make available.124 long nalloc, ///< Total number of elements to make available. 123 125 psElemType type ///< the datatype of the returned vector 124 126 );
Note:
See TracChangeset
for help on using the changeset viewer.
