Changeset 1664 for trunk/psLib/test/image/tst_psImage.c
- Timestamp:
- Aug 31, 2004, 9:36:02 AM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/image/tst_psImage.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/image/tst_psImage.c
r1606 r1664 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1.2 3$ $Name: not supported by cvs2svn $9 * @date $Date: 2004-08- 23 22:36:03$8 * @version $Revision: 1.24 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2004-08-31 19:36:02 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 63 63 0,1,100,1,150,100 64 64 }; 65 unsigned int types = 1 2;65 unsigned int types = 13; 66 66 psElemType type[] = { PS_TYPE_S8, PS_TYPE_S16, PS_TYPE_S32, PS_TYPE_S64, 67 67 PS_TYPE_U8, PS_TYPE_U16, PS_TYPE_U32, PS_TYPE_U64, 68 PS_TYPE_F32, PS_TYPE_F64, PS_TYPE_C32, PS_TYPE_C64 }; 68 PS_TYPE_F32, PS_TYPE_F64, PS_TYPE_C32, PS_TYPE_C64, 69 PS_TYPE_PTR }; 69 70 70 71 psLogMsg(__func__,PS_LOG_INFO,"#546 - psImageAlloc shall allocate memory for a psImage structure"); … … 74 75 75 76 for (unsigned int i=0;i<sizes;i++) { 77 78 if (numRows[i] == 0 || numCols[i] == 0) { 79 psLogMsg(__func__,PS_LOG_INFO,"Following should be an error."); 80 } 76 81 77 82 image = psImageAlloc(numCols[i],numRows[i],type[t]); … … 206 211 } 207 212 } 213 } 214 break; 215 case PS_TYPE_PTR: { 216 unsigned int rows = numRows[i]; 217 unsigned int cols = numCols[i]; 218 psImage* temp = psImageAlloc(1,1,PS_TYPE_F32); 219 220 for (int r=0;r<rows;r++) { 221 for (int c=0;c<cols;c++) { 222 image->data.PTR[r][c] = psMemIncrRefCounter(temp); 223 } 224 } 225 for (int r=0;r<rows;r++) { 226 for (int c=0;c<cols;c++) { 227 if (image->data.PTR[r][c] != temp) { 228 psError(__func__, "Could not set pixel in pointer image at (%d,%d): %x %x", 229 c,r,image->data.PTR[r][c],temp); 230 psFree(image); 231 psFree(temp); 232 return 8; 233 } 234 } 235 } 236 psFree(temp); 208 237 } 209 238 break;
Note:
See TracChangeset
for help on using the changeset viewer.
