Changeset 1930
- Timestamp:
- Sep 29, 2004, 11:23:30 AM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/image/tst_psImageManip.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/image/tst_psImageManip.c
r1929 r1930 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1.2 4$ $Name: not supported by cvs2svn $9 * @date $Date: 2004-09-29 2 0:17:58$8 * @version $Revision: 1.25 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2004-09-29 21:23:30 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 1088 1088 int rows = 64; 1089 1089 int cols = 64; 1090 1090 int rows1 = 8; 1091 int cols1 = 8; 1091 1092 1092 1093 /* … … 1229 1230 psFree(in); 1230 1231 psFree(out); 1232 1233 #define testRollType(DATATYPE) \ 1234 in = psImageAlloc(rows1,cols1,PS_TYPE_##DATATYPE); \ 1235 \ 1236 for (int row=0;row<rows1;row++) { \ 1237 ps##DATATYPE* inRow = in->data.DATATYPE[row]; \ 1238 for (int col=0;col<cols1;col++) { \ 1239 inRow[col] = (ps##DATATYPE)row+(ps##DATATYPE)col; \ 1240 } \ 1241 } \ 1242 \ 1243 out = psImageRoll(NULL,in,rows1/4,cols1/4); \ 1244 for (int row=0;row<rows1;row++) { \ 1245 ps##DATATYPE* inRow = in->data.DATATYPE[(row+rows1/4)%rows1]; \ 1246 ps##DATATYPE* outRow = out->data.DATATYPE[row]; \ 1247 for (int col=0;col<cols1;col++) { \ 1248 if (inRow[(col+cols1/4)%cols1] != outRow[col]) { \ 1249 psError(__func__,"psImageRoll didn't produce expected result " \ 1250 "at %d,%d (%f vs %f) for dx=0, dy=0.", \ 1251 col,row,(float)inRow[col],(float)outRow[col]); \ 1252 return 3; \ 1253 } \ 1254 } \ 1255 } \ 1256 psFree(in); \ 1257 psFree(out); 1258 1259 testRollType(U8); 1260 testRollType(U16); 1261 testRollType(S8); 1262 testRollType(S16); 1263 testRollType(F64); 1264 testRollType(C32); 1265 testRollType(C64); 1231 1266 1232 1267 return 0;
Note:
See TracChangeset
for help on using the changeset viewer.
