Changeset 3880
- Timestamp:
- May 10, 2005, 4:29:39 PM (21 years ago)
- Location:
- trunk/psLib
- Files:
-
- 8 edited
-
pslib.kdevelop.pcs (modified) ( previous)
-
pslib.kdevses (modified) (1 diff)
-
src/dataManip/psConstants.h (modified) (3 diffs)
-
src/dataManip/psMatrix.c (modified) (3 diffs)
-
src/image/psImageManip.c (modified) (2 diffs)
-
src/image/psImageManip.h (modified) (4 diffs)
-
src/math/psConstants.h (modified) (3 diffs)
-
src/math/psMatrix.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/pslib.kdevses
r3866 r3880 3 3 <KDevPrjSession> 4 4 <DocsAndViews NumberOfDocuments="6" > 5 <Doc0 NumberOfViews="1" URL="file:///home/desonia/panstarrs/psLib/src/ dataIO/psFits.c" >6 <View0 line=" 1202" Type="Source" />5 <Doc0 NumberOfViews="1" URL="file:///home/desonia/panstarrs/psLib/src/image/psImageManip.h" > 6 <View0 line="32" Type="Source" /> 7 7 </Doc0> 8 <Doc1 NumberOfViews="1" URL="file:///home/desonia/panstarrs/psLib/ test/image/tst_psImage.c" >9 <View0 line=" 35" Type="Source" />8 <Doc1 NumberOfViews="1" URL="file:///home/desonia/panstarrs/psLib/src/image/psImageManip.c" > 9 <View0 line="1054" Type="Source" /> 10 10 </Doc1> 11 <Doc2 NumberOfViews="1" URL="file:///home/desonia/panstarrs/psLib/ configure.ac" >12 <View0 line=" 26" Type="Source" />11 <Doc2 NumberOfViews="1" URL="file:///home/desonia/panstarrs/psLib/src/dataManip/psMatrix.c" > 12 <View0 line="377" Type="Source" /> 13 13 </Doc2> 14 <Doc3 NumberOfViews="1" URL="file:///home/desonia/panstarrs/psLib/src/ sysUtils/psTrace.h" >15 <View0 line=" 87" Type="Source" />14 <Doc3 NumberOfViews="1" URL="file:///home/desonia/panstarrs/psLib/src/dataManip/psMatrix.h" > 15 <View0 line="0" Type="Source" /> 16 16 </Doc3> 17 <Doc4 NumberOfViews="1" URL="file:/// home/desonia/panstarrs/psLib/src/sysUtils/psTrace.c" >18 <View0 line="5 22" Type="Source" />17 <Doc4 NumberOfViews="1" URL="file:///usr/include/gsl/gsl_linalg.h" > 18 <View0 line="53" Type="Source" /> 19 19 </Doc4> 20 <Doc5 NumberOfViews="1" URL="file:///home/desonia/panstarrs/psLib/src/ collections/psMetadata.h" >21 <View0 line=" 65" Type="Source" />20 <Doc5 NumberOfViews="1" URL="file:///home/desonia/panstarrs/psLib/src/dataManip/psConstants.h" > 21 <View0 line="32" Type="Source" /> 22 22 </Doc5> 23 23 </DocsAndViews> -
trunk/psLib/src/dataManip/psConstants.h
r3700 r3880 6 6 * @author GLG, MHPCC 7 7 * 8 * @version $Revision: 1.6 4$ $Name: not supported by cvs2svn $9 * @date $Date: 2005-0 4-14 03:23:55$8 * @version $Revision: 1.65 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2005-05-11 02:29:39 $ 10 10 * 11 11 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 31 31 These are common mathimatical constants used by various functions in the psLib. 32 32 *****************************************************************************/ 33 #define PS_ONE 1.034 33 #define PS_PI 3.1415926535897932384626433832795029 /* pi */ 35 34 #define PS_PI_2 1.5707963267948966192313216916397514 /* pi/2 */ … … 38 37 #define PS_2_PI 0.6366197723675813430755350534900574 /* 2/pi */ 39 38 40 #define PS_COT(X) (1.0 / atan(X))41 39 #define DEG_TO_RAD(DEGREES) ((DEGREES) * PS_PI / 180.0) 42 40 #define MIN_TO_RAD(MINUTES) ((MINUTES) * PS_PI / (180.0 * 60.0)) -
trunk/psLib/src/dataManip/psMatrix.c
r3476 r3880 21 21 * @author Robert DeSonia, MHPCC 22 22 * 23 * @version $Revision: 1.2 7$ $Name: not supported by cvs2svn $24 * @date $Date: 2005-0 3-22 21:52:49 $23 * @version $Revision: 1.28 $ $Name: not supported by cvs2svn $ 24 * @date $Date: 2005-05-11 02:29:39 $ 25 25 * 26 26 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 376 376 psImage* psMatrixMultiply(psImage* outImage, psImage* inImage1, psImage* inImage2) 377 377 { 378 psS32 numRows = 0;379 psS32 numCols = 0;380 378 gsl_matrix *m1 = NULL; 381 379 gsl_matrix *m2 = NULL; … … 394 392 PS_CHECK_POINTERS(inImage1, inImage2, MULTIPLY_CLEANUP); 395 393 396 outImage = psImageRecycle(outImage, inImage2->numCols, inImage2->numRows, inImage2->type.type); 397 398 PS_CHECK_SQUARE(inImage1, MULTIPLY_CLEANUP); 399 PS_CHECK_SQUARE(inImage2, MULTIPLY_CLEANUP); 400 PS_CHECK_SQUARE(outImage, MULTIPLY_CLEANUP); 401 402 // Initialize data 403 numRows = inImage1->numRows; 404 numCols = inImage1->numCols; 394 if (inImage1->numRows != inImage2->numCols) { 395 psError(PS_ERR_BAD_PARAMETER_SIZE, true, "Invalid operation: number of rows of inImage1 != number of cols of inImage2."); 396 MULTIPLY_CLEANUP; 397 } 398 if (inImage1->type.type != inImage2->type.type) { 399 psError(PS_ERR_BAD_PARAMETER_SIZE, true, "Invalid operation: data types of inImage1 and inImage2 must match."); 400 MULTIPLY_CLEANUP; 401 } 402 403 outImage = psImageRecycle(outImage, inImage1->numCols, inImage2->numRows, inImage2->type.type); 405 404 406 405 // Initialize GSL data 407 m1 = gsl_matrix_alloc( numRows,numCols);406 m1 = gsl_matrix_alloc(inImage1->numRows, inImage1->numCols); 408 407 psImageToGslMatrix(m1, inImage1); 409 m2 = gsl_matrix_alloc( numRows,numCols);408 m2 = gsl_matrix_alloc(inImage2->numRows, inImage2->numCols); 410 409 psImageToGslMatrix(m2, inImage2); 411 m3 = gsl_matrix_alloc(numRows, numCols); 412 psImageToGslMatrix(m3, outImage); 410 m3 = gsl_matrix_alloc(outImage->numRows, outImage->numCols); 413 411 414 412 // Perform multiplication -
trunk/psLib/src/image/psImageManip.c
r3737 r3880 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1. 39$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-0 4-21 21:18:23$12 * @version $Revision: 1.40 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-05-11 02:29:39 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 1056 1056 // invert. Also, the next SDRS should have a different signature. 1057 1057 psImage* psImageTransform(psImage *output, 1058 psArray** blankPixels, 1058 1059 const psImage *input, 1059 1060 const psImage *inputMask, 1060 1061 int inputMaskVal, 1061 1062 const psPlaneTransform *outToIn, 1062 const psImage *combineMask, 1063 int combineMaskVal) 1063 const psRegion region, 1064 const psPixels* pixels, 1065 psImageInterpolateMode mode, 1066 int exposedValue) 1064 1067 { 1065 1068 if (input == NULL) { -
trunk/psLib/src/image/psImageManip.h
r3737 r3880 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1.2 0$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-0 4-21 21:18:23$12 * @version $Revision: 1.21 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-05-11 02:29:39 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 21 21 #include "psCoord.h" 22 22 #include "psStats.h" 23 #include "psPixels.h" 23 24 24 25 /// @addtogroup Image … … 183 184 /** Transform the input image according the supplied transformation. 184 185 * 185 * Transform the input image according the supplied transformation. In the186 * event that the output is NULL, the smallest possible image capable of187 * containing the entire transformed input image is to be returned; otherwise188 * only the image size specified in the output image is to be used. If the189 * inputMask is no tNULL, those pixels in the inputMask matching inputMaskVal186 * Transform the input image according the supplied transformation. The size 187 * of the transformed image is deï¬ned by the supplied output image, if 188 * non-NULL, or the region otherwise (size region.x1 - region.x0 by region.y1 189 * region.y0, with out->x0 = region.x0 and out->y0 = region.y0). If the 190 * inputMask is non-NULL, those pixels in the inputMask matching inputMaskVal 190 191 * are to be ignored in the transformation. The inputMask must be of type 191 192 * psU8, and of the same size as the input, otherwise the function shall 192 * generate an error and return NULL. The transformation outToIn specifies 193 * the coordinates in the input image of a pixel in the output image - note 194 * that this is the reverse of what might be naively expected, but it is what 195 * is required in order to use psImagePixelInterpolate. If combineMask is not 196 * NULL, then those pixels that match combineMaskVal are not transformed. 197 * combineMask must be of type psU8 and of the same size as the output, 198 * otherwise the function shall generate an error and return NULL. This 199 * function must be capable of handling the following types for the input 200 * (with corresponding types for the output): psF32, psF64. 193 * generate an error and return NULL. The transformation outToIn speciï¬es the 194 * coordinates in the input image of a pixel in the output image â note that 195 * this is the reverse of what might be naively expected, but it is what is 196 * required in order to use psImagePixelInterpolate. If the pixels array is 197 * non-NULL, it shall consist of psPixelCoords, and only those pixels in the 198 * output image shall be transformed; otherwise, the entire image is 199 * generated. The interpolation is performed using the speciï¬ed interpolation 200 * mode. Where a pixel in the output image does not correspond to a pixel in 201 * the input image (or all appropriate pixels in the input image are 202 * masked), the value shall be set to exposed, and the pixel added to the 203 * appropriate list of pixels (psPixels) in the array of blankPixels for 204 * return to the user. This function must be capable of handling the following 205 * types for the input (with corresponding types for the output): psF32, psF64. 206 201 207 * 202 208 * @return psImage* The transformed image. … … 204 210 psImage* psImageTransform( 205 211 psImage *output, ///< psImage to recycle, or NULL 212 psArray** blankPixels, ///< 206 213 const psImage *input, ///< psImage to apply transform to 207 214 const psImage *inputMask, ///< if not NULL, mask of input psImage 208 215 int inputMaskVal, ///< masking value for inputMask 209 216 const psPlaneTransform *outToIn, ///< the transform to apply 210 const psImage *combineMask, ///< if not NULL, mask of pixels not to be transformed 211 int combineMaskVal ///< masking value for combineMask 217 const psRegion region, ///< 218 const psPixels* pixels, ///< 219 psImageInterpolateMode mode, ///< 220 int exposedValue ///< 212 221 ); 213 222 -
trunk/psLib/src/math/psConstants.h
r3700 r3880 6 6 * @author GLG, MHPCC 7 7 * 8 * @version $Revision: 1.6 4$ $Name: not supported by cvs2svn $9 * @date $Date: 2005-0 4-14 03:23:55$8 * @version $Revision: 1.65 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2005-05-11 02:29:39 $ 10 10 * 11 11 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 31 31 These are common mathimatical constants used by various functions in the psLib. 32 32 *****************************************************************************/ 33 #define PS_ONE 1.034 33 #define PS_PI 3.1415926535897932384626433832795029 /* pi */ 35 34 #define PS_PI_2 1.5707963267948966192313216916397514 /* pi/2 */ … … 38 37 #define PS_2_PI 0.6366197723675813430755350534900574 /* 2/pi */ 39 38 40 #define PS_COT(X) (1.0 / atan(X))41 39 #define DEG_TO_RAD(DEGREES) ((DEGREES) * PS_PI / 180.0) 42 40 #define MIN_TO_RAD(MINUTES) ((MINUTES) * PS_PI / (180.0 * 60.0)) -
trunk/psLib/src/math/psMatrix.c
r3476 r3880 21 21 * @author Robert DeSonia, MHPCC 22 22 * 23 * @version $Revision: 1.2 7$ $Name: not supported by cvs2svn $24 * @date $Date: 2005-0 3-22 21:52:49 $23 * @version $Revision: 1.28 $ $Name: not supported by cvs2svn $ 24 * @date $Date: 2005-05-11 02:29:39 $ 25 25 * 26 26 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 376 376 psImage* psMatrixMultiply(psImage* outImage, psImage* inImage1, psImage* inImage2) 377 377 { 378 psS32 numRows = 0;379 psS32 numCols = 0;380 378 gsl_matrix *m1 = NULL; 381 379 gsl_matrix *m2 = NULL; … … 394 392 PS_CHECK_POINTERS(inImage1, inImage2, MULTIPLY_CLEANUP); 395 393 396 outImage = psImageRecycle(outImage, inImage2->numCols, inImage2->numRows, inImage2->type.type); 397 398 PS_CHECK_SQUARE(inImage1, MULTIPLY_CLEANUP); 399 PS_CHECK_SQUARE(inImage2, MULTIPLY_CLEANUP); 400 PS_CHECK_SQUARE(outImage, MULTIPLY_CLEANUP); 401 402 // Initialize data 403 numRows = inImage1->numRows; 404 numCols = inImage1->numCols; 394 if (inImage1->numRows != inImage2->numCols) { 395 psError(PS_ERR_BAD_PARAMETER_SIZE, true, "Invalid operation: number of rows of inImage1 != number of cols of inImage2."); 396 MULTIPLY_CLEANUP; 397 } 398 if (inImage1->type.type != inImage2->type.type) { 399 psError(PS_ERR_BAD_PARAMETER_SIZE, true, "Invalid operation: data types of inImage1 and inImage2 must match."); 400 MULTIPLY_CLEANUP; 401 } 402 403 outImage = psImageRecycle(outImage, inImage1->numCols, inImage2->numRows, inImage2->type.type); 405 404 406 405 // Initialize GSL data 407 m1 = gsl_matrix_alloc( numRows,numCols);406 m1 = gsl_matrix_alloc(inImage1->numRows, inImage1->numCols); 408 407 psImageToGslMatrix(m1, inImage1); 409 m2 = gsl_matrix_alloc( numRows,numCols);408 m2 = gsl_matrix_alloc(inImage2->numRows, inImage2->numCols); 410 409 psImageToGslMatrix(m2, inImage2); 411 m3 = gsl_matrix_alloc(numRows, numCols); 412 psImageToGslMatrix(m3, outImage); 410 m3 = gsl_matrix_alloc(outImage->numRows, outImage->numCols); 413 411 414 412 // Perform multiplication
Note:
See TracChangeset
for help on using the changeset viewer.
