Changeset 3786
- Timestamp:
- Apr 28, 2005, 4:25:10 PM (21 years ago)
- Location:
- trunk/psLib/src
- Files:
-
- 10 edited
-
collections/psVector.c (modified) (2 diffs)
-
collections/psVector.h (modified) (3 diffs)
-
image/psImage.c (modified) (2 diffs)
-
image/psImage.h (modified) (4 diffs)
-
image/psImageIO.c (modified) (2 diffs)
-
image/psImageIO.h (modified) (2 diffs)
-
mathtypes/psImage.c (modified) (2 diffs)
-
mathtypes/psImage.h (modified) (4 diffs)
-
mathtypes/psVector.c (modified) (2 diffs)
-
mathtypes/psVector.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/collections/psVector.c
r3740 r3786 9 9 * @author Robert DeSonia, MHPCC 10 10 * 11 * @version $Revision: 1.4 0$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-04-2 1 21:21:01$11 * @version $Revision: 1.41 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-04-29 02:25:09 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 526 526 } 527 527 } 528 529 bool p_psVectorPrint (FILE *f, psVector *a, char *name) 530 { 531 532 fprintf (f, "vector: %s\n", name); 533 534 for (int i = 0; i < a[0].n; i++) { 535 fprintf (f, "%f\n", p_psVectorGetElementF64(a, i)); 536 } 537 fprintf (f, "\n"); 538 return (true); 539 } -
trunk/psLib/src/collections/psVector.h
r3737 r3786 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.3 2$ $Name: not supported by cvs2svn $14 * @date $Date: 2005-04-2 1 21:18:23$13 * @version $Revision: 1.33 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2005-04-29 02:25:09 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 19 19 #ifndef PS_VECTOR_H 20 20 #define PS_VECTOR_H 21 22 #include<stdio.h> 21 23 22 24 #include "psType.h" … … 162 164 ); 163 165 166 /** Print a vector to a stream 167 * 168 * @return psBool TRUE is successful, otherwise FALSE. 169 */ 170 bool p_psVectorPrint ( 171 FILE *f, ///< output stream 172 psVector *a, ///< vector to print 173 char *name ///< name of vector (for title) 174 ); 164 175 165 176 /// @} -
trunk/psLib/src/image/psImage.c
r3702 r3786 9 9 * @author Ross Harman, MHPCC 10 10 * 11 * @version $Revision: 1.6 4$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-04- 15 00:12:08$11 * @version $Revision: 1.65 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-04-29 02:25:10 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 589 589 590 590 return unexposedValue; 591 } 592 593 psF64 p_psImageGetElementF64(psImage* image, 594 int col, 595 int row) 596 { 597 if (image == NULL) { 598 return NAN; 599 } 600 if (col < 0 || col >= image->numCols) { 601 return NAN; 602 } 603 if (row < 0 || row >= image->numRows) { 604 return NAN; 605 } 606 607 switch (image->type.type) { 608 case PS_TYPE_U8: 609 return image->data.U8[row][col]; 610 break; 611 case PS_TYPE_U16: 612 return image->data.U16[row][col]; 613 break; 614 case PS_TYPE_U32: 615 return image->data.U32[row][col]; 616 break; 617 case PS_TYPE_U64: 618 return image->data.U64[row][col]; 619 break; 620 case PS_TYPE_S8: 621 return image->data.S8[row][col]; 622 break; 623 case PS_TYPE_S16: 624 return image->data.S16[row][col]; 625 break; 626 case PS_TYPE_S32: 627 return image->data.S32[row][col]; 628 break; 629 case PS_TYPE_S64: 630 return image->data.S64[row][col]; 631 break; 632 case PS_TYPE_F32: 633 return image->data.F32[row][col]; 634 break; 635 case PS_TYPE_F64: 636 return image->data.F64[row][col]; 637 default: 638 return NAN; 639 } 591 640 } 592 641 -
trunk/psLib/src/image/psImage.h
r3702 r3786 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.5 0$ $Name: not supported by cvs2svn $14 * @date $Date: 2005-04- 15 00:12:08$13 * @version $Revision: 1.51 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2005-04-29 02:25:10 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 182 182 ); 183 183 184 /** get an element of an image as a psF64. 185 * 186 * @return psF64 pixel value at specified location 187 */ 188 psF64 p_psImageGetElementF64( 189 psImage* image, ///< input image 190 int col, ///< pixel column 191 int row ///< pixel row 192 ); 193 184 194 /** Interpolate image pixel value given floating point coordinates. 185 195 * … … 225 235 PIXEL_INTERPOLATE_FCNS(BILINEAR) 226 236 PIXEL_INTERPOLATE_FCNS(BILINEAR_VARIANCE) 227 #endif 237 #endif // ! SWIG 228 238 229 239 #undef PIXEL_INTERPOLATE_FCN_PROTOTYPE … … 232 242 /// @} 233 243 234 #endif 244 #endif // PS_IMAGE_H -
trunk/psLib/src/image/psImageIO.c
r3264 r3786 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1.1 8$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-0 2-17 19:26:24$9 * @version $Revision: 1.19 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-04-29 02:25:10 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 419 419 return true; 420 420 } 421 422 bool p_psImagePrint (FILE *f, psImage *a, char *name) 423 { 424 425 fprintf (f, "matrix: %s\n", name); 426 427 for (int j = 0; j < a[0].numRows; j++) { 428 for (int i = 0; i < a[0].numCols; i++) { 429 fprintf (f, "%f ", p_psImageGetElementF64(a, i, j)); 430 } 431 fprintf (f, "\n"); 432 } 433 fprintf (f, "\n"); 434 return (true); 435 } 436 -
trunk/psLib/src/image/psImageIO.h
r3264 r3786 10 10 * @author Robert DeSonia, MHPCC 11 11 * 12 * @version $Revision: 1. 9$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-0 2-17 19:26:24$12 * @version $Revision: 1.10 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-04-29 02:25:10 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 92 92 ); 93 93 94 /** print image pixel values. 95 * 96 * @return bool TRUE is successful, otherwise FALSE. 97 */ 98 bool p_psImagePrint( 99 FILE *f, ///< Destination stream 100 psImage *a, ///< image to print 101 char *name ///< name of the image (for title) 102 ); 103 94 104 /// @} 95 105 96 #endif 106 #endif // PS_IMAGEIO_H -
trunk/psLib/src/mathtypes/psImage.c
r3702 r3786 9 9 * @author Ross Harman, MHPCC 10 10 * 11 * @version $Revision: 1.6 4$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-04- 15 00:12:08$11 * @version $Revision: 1.65 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-04-29 02:25:10 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 589 589 590 590 return unexposedValue; 591 } 592 593 psF64 p_psImageGetElementF64(psImage* image, 594 int col, 595 int row) 596 { 597 if (image == NULL) { 598 return NAN; 599 } 600 if (col < 0 || col >= image->numCols) { 601 return NAN; 602 } 603 if (row < 0 || row >= image->numRows) { 604 return NAN; 605 } 606 607 switch (image->type.type) { 608 case PS_TYPE_U8: 609 return image->data.U8[row][col]; 610 break; 611 case PS_TYPE_U16: 612 return image->data.U16[row][col]; 613 break; 614 case PS_TYPE_U32: 615 return image->data.U32[row][col]; 616 break; 617 case PS_TYPE_U64: 618 return image->data.U64[row][col]; 619 break; 620 case PS_TYPE_S8: 621 return image->data.S8[row][col]; 622 break; 623 case PS_TYPE_S16: 624 return image->data.S16[row][col]; 625 break; 626 case PS_TYPE_S32: 627 return image->data.S32[row][col]; 628 break; 629 case PS_TYPE_S64: 630 return image->data.S64[row][col]; 631 break; 632 case PS_TYPE_F32: 633 return image->data.F32[row][col]; 634 break; 635 case PS_TYPE_F64: 636 return image->data.F64[row][col]; 637 default: 638 return NAN; 639 } 591 640 } 592 641 -
trunk/psLib/src/mathtypes/psImage.h
r3702 r3786 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.5 0$ $Name: not supported by cvs2svn $14 * @date $Date: 2005-04- 15 00:12:08$13 * @version $Revision: 1.51 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2005-04-29 02:25:10 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 182 182 ); 183 183 184 /** get an element of an image as a psF64. 185 * 186 * @return psF64 pixel value at specified location 187 */ 188 psF64 p_psImageGetElementF64( 189 psImage* image, ///< input image 190 int col, ///< pixel column 191 int row ///< pixel row 192 ); 193 184 194 /** Interpolate image pixel value given floating point coordinates. 185 195 * … … 225 235 PIXEL_INTERPOLATE_FCNS(BILINEAR) 226 236 PIXEL_INTERPOLATE_FCNS(BILINEAR_VARIANCE) 227 #endif 237 #endif // ! SWIG 228 238 229 239 #undef PIXEL_INTERPOLATE_FCN_PROTOTYPE … … 232 242 /// @} 233 243 234 #endif 244 #endif // PS_IMAGE_H -
trunk/psLib/src/mathtypes/psVector.c
r3740 r3786 9 9 * @author Robert DeSonia, MHPCC 10 10 * 11 * @version $Revision: 1.4 0$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-04-2 1 21:21:01$11 * @version $Revision: 1.41 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-04-29 02:25:09 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 526 526 } 527 527 } 528 529 bool p_psVectorPrint (FILE *f, psVector *a, char *name) 530 { 531 532 fprintf (f, "vector: %s\n", name); 533 534 for (int i = 0; i < a[0].n; i++) { 535 fprintf (f, "%f\n", p_psVectorGetElementF64(a, i)); 536 } 537 fprintf (f, "\n"); 538 return (true); 539 } -
trunk/psLib/src/mathtypes/psVector.h
r3737 r3786 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.3 2$ $Name: not supported by cvs2svn $14 * @date $Date: 2005-04-2 1 21:18:23$13 * @version $Revision: 1.33 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2005-04-29 02:25:09 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 19 19 #ifndef PS_VECTOR_H 20 20 #define PS_VECTOR_H 21 22 #include<stdio.h> 21 23 22 24 #include "psType.h" … … 162 164 ); 163 165 166 /** Print a vector to a stream 167 * 168 * @return psBool TRUE is successful, otherwise FALSE. 169 */ 170 bool p_psVectorPrint ( 171 FILE *f, ///< output stream 172 psVector *a, ///< vector to print 173 char *name ///< name of vector (for title) 174 ); 164 175 165 176 /// @}
Note:
See TracChangeset
for help on using the changeset viewer.
