Changeset 5213 for trunk/psLib/src/imageops
- Timestamp:
- Sep 30, 2005, 1:09:13 PM (21 years ago)
- Location:
- trunk/psLib/src/imageops
- Files:
-
- 3 edited
-
psImagePixelExtract.c (modified) (5 diffs)
-
psImagePixelExtract.h (modified) (3 diffs)
-
psImageStats.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/imageops/psImagePixelExtract.c
r5174 r5213 8 8 * @author Robert DeSonia, MHPCC 9 9 * 10 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $11 * @date $Date: 2005-09- 29 01:15:38$10 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2005-09-30 23:09:13 $ 12 12 * 13 13 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 50 50 psVector *psImageRow(psVector *out, 51 51 const psImage *input, 52 psU32row)52 int row) 53 53 { 54 54 if (input == NULL) { … … 60 60 "Specified row number is out of range for specified image.\n"); 61 61 return NULL; 62 } 63 if (row < 0) { 64 row += input->numRows; 65 if (row < 0) { 66 psError(PS_ERR_BAD_PARAMETER_VALUE, true, 67 "Specified row number is out of range for specified image.\n"); 68 return NULL; 69 } 62 70 } 63 71 psVectorRecycle(out, input->numCols, input->type.type); … … 137 145 psVector *psImageCol(psVector *out, 138 146 const psImage *input, 139 psU32column)147 int column) 140 148 { 141 149 if (input == NULL) { … … 143 151 return NULL; 144 152 } 145 if (column >= input->num Rows) {153 if (column >= input->numCols) { 146 154 psError(PS_ERR_BAD_PARAMETER_NULL, true, 147 155 "Specified column number is out of range for specified image.\n"); 148 156 return NULL; 149 157 } 150 psVectorRecycle(out, input->numCols, input->type.type); 158 if (column < 0) { 159 column += input->numCols; 160 if (column < 0) { 161 psError(PS_ERR_BAD_PARAMETER_VALUE, true, 162 "Specified column number is out of range for specified image.\n"); 163 return NULL; 164 } 165 } 166 167 168 psVectorRecycle(out, input->numRows, input->type.type); 151 169 152 170 switch (input->type.type) { -
trunk/psLib/src/imageops/psImagePixelExtract.h
r5174 r5213 8 8 * @author Robert DeSonia, MHPCC 9 9 * 10 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $11 * @date $Date: 2005-09- 29 01:15:38$10 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2005-09-30 23:09:13 $ 12 12 * 13 13 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 41 41 psVector *out, ///< specified vector to return 42 42 const psImage *input, ///< input image 43 psU32 row///< row number to extract43 int row ///< row number to extract 44 44 ); 45 45 … … 52 52 psVector *out, ///< specified vector to return 53 53 const psImage *input, ///< input image 54 psU32 column///< column number to extract54 int column ///< column number to extract 55 55 ); 56 56 -
trunk/psLib/src/imageops/psImageStats.c
r5137 r5213 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1.8 1$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-09- 26 22:35:53 $11 * @version $Revision: 1.82 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-09-30 23:09:13 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 677 677 678 678 type = mask->type.type; 679 if (type != PS_TYPE_MASK) { 680 psError(PS_ERR_BAD_PARAMETER_TYPE, true, 681 "psImage type does not match the specified psMaskType!\n"); 682 return -1; 683 } 679 684 680 685 switch (type) { 681 686 case PS_TYPE_U8: 687 case PS_TYPE_U16: 682 688 for (long i = x0; i < x1; i++) { 683 689 for (long j = y0; j < y1; j++) { 684 if (mask->data. U8[i][j] & value) {690 if (mask->data.PS_TYPE_MASK_DATA[i][j] & value) { 685 691 Npixels ++; 686 692 } … … 692 698 case PS_TYPE_S32: 693 699 case PS_TYPE_S64: 694 case PS_TYPE_U16:695 700 case PS_TYPE_U32: 696 701 case PS_TYPE_U64:
Note:
See TracChangeset
for help on using the changeset viewer.
