Changeset 5137 for trunk/psLib/src/mathtypes
- Timestamp:
- Sep 26, 2005, 12:35:54 PM (21 years ago)
- Location:
- trunk/psLib/src/mathtypes
- Files:
-
- 3 edited
-
psImage.h (modified) (2 diffs)
-
psVector.c (modified) (2 diffs)
-
psVector.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/mathtypes/psImage.h
r5101 r5137 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.7 1$ $Name: not supported by cvs2svn $14 * @date $Date: 2005-09-2 3 00:04:36$13 * @version $Revision: 1.72 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2005-09-26 22:35:53 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 109 109 ; 110 110 111 112 111 /** Checks the type of a particular pointer. 113 112 * -
trunk/psLib/src/mathtypes/psVector.c
r5114 r5137 9 9 * @author Robert DeSonia, MHPCC 10 10 * 11 * @version $Revision: 1.5 6$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-09-2 4 00:17:44$11 * @version $Revision: 1.57 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-09-26 22:35:53 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 948 948 } 949 949 950 // count number of pixels with given mask value 951 long psVectorCountPixelMask (psVector *mask, 952 psMaskType value) 953 { 954 long Npixels = 0; 955 if (mask == NULL) { 956 psError(PS_ERR_BAD_PARAMETER_NULL, true, PS_ERRORTEXT_psVector_NULL); 957 Npixels = -1; 958 return Npixels; 959 } 960 961 psElemType type; 962 type = mask->type.type; 963 964 switch (type) { 965 case PS_TYPE_U8: 966 for (long i = 0; i < mask->n; i++) { 967 if (mask->data.U8[i] & value) { 968 Npixels ++; 969 } 970 } 971 break; 972 case PS_TYPE_S8: 973 case PS_TYPE_S16: 974 case PS_TYPE_S32: 975 case PS_TYPE_S64: 976 case PS_TYPE_U16: 977 case PS_TYPE_U32: 978 case PS_TYPE_U64: 979 case PS_TYPE_F32: 980 case PS_TYPE_F64: 981 case PS_TYPE_C32: 982 case PS_TYPE_C64: 983 default: 984 psError(PS_ERR_BAD_PARAMETER_TYPE, true, 985 PS_ERRORTEXT_psVector_UNSUPPORTED_TYPE, type); 986 return -1; 987 } 988 return (Npixels); 989 } 990 -
trunk/psLib/src/mathtypes/psVector.h
r5114 r5137 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.4 8$ $Name: not supported by cvs2svn $14 * @date $Date: 2005-09-2 4 00:17:44$13 * @version $Revision: 1.49 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2005-09-26 22:35:53 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 247 247 ); 248 248 249 /** Returns the number of pixels in the vector which satisfy any of the mask bits. 250 * 251 * An error (eg, invalid vector) results in a return value of -1. The vector must be U8. 252 * 253 * @return long: the number of pixels counted 254 */ 255 long psVectorCountPixelMask( 256 psVector *mask, ///< input vector to count 257 psMaskType value ///< the mask value to satisfy 258 ); 259 249 260 /// @} 250 261
Note:
See TracChangeset
for help on using the changeset viewer.
