Changeset 2204 for trunk/psLib/test/image/tst_psImageIO.c
- Timestamp:
- Oct 26, 2004, 2:57:34 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/image/tst_psImageIO.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/image/tst_psImageIO.c
r1942 r2204 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1. 9$ $Name: not supported by cvs2svn $9 * @date $Date: 2004-10- 02 02:09:21$8 * @version $Revision: 1.10 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2004-10-27 00:57:33 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 25 25 #define GENIMAGE(img,c,r,TYP, valueFcn) \ 26 26 img = psImageAlloc(c,r,PS_TYPE_##TYP); \ 27 for ( unsigned introw=0;row<r;row++) { \27 for (psU32 row=0;row<r;row++) { \ 28 28 ps##TYP* imgRow = img->data.TYP[row]; \ 29 for ( unsigned intcol=0;col<c;col++) { \29 for (psU32 col=0;col<c;col++) { \ 30 30 imgRow[col] = (ps##TYP)(valueFcn); \ 31 31 } \ 32 32 } 33 33 34 static inttestImageRead(void);35 static inttestImageWrite(void);34 static psS32 testImageRead(void); 35 static psS32 testImageWrite(void); 36 36 37 37 testDescription tests[] = { … … 47 47 }; 48 48 49 int main(intargc, char* argv[])49 psS32 main(psS32 argc, char* argv[]) 50 50 { 51 51 psLogSetLevel(PS_LOG_INFO); … … 57 57 } 58 58 59 inttestImageRead(void)59 psS32 testImageRead(void) 60 60 { 61 intN = 256;62 intM = 128;61 psS32 N = 256; 62 psS32 M = 128; 63 63 psImage* image = NULL; 64 64 … … 127 127 return 6; \ 128 128 } \ 129 for ( unsigned introw = readN0; row < readN; row++) { \129 for (psU32 row = readN0; row < readN; row++) { \ 130 130 ps##TYP* imgRow = img->data.TYP[row-readN0]; \ 131 131 ps##TYP* img2Row = img2->data.TYP[row]; \ 132 132 ps##TYP* img3Row = img3->data.TYP[row-readN0]; \ 133 133 ps##TYP* img4Row = img4->data.TYP[row]; \ 134 for ( unsigned intcol = readM0; col < readM; col++) { \134 for (psU32 col = readM0; col < readM; col++) { \ 135 135 if (fabsf(imgRow[col-readM0]-img2Row[col]) > FLT_EPSILON) { \ 136 136 psError(__func__,"Image changed in I/O operation at %d,%d,0 (%.2f vs %.2f) for %s", \ … … 155 155 return 9; \ 156 156 } \ 157 for ( unsigned introw = readN0; row < readN; row++) { \157 for (psU32 row = readN0; row < readN; row++) { \ 158 158 ps##TYP* imgRow = img->data.TYP[row-readN0]; \ 159 159 ps##TYP* img2Row = img2->data.TYP[row]; \ 160 160 ps##TYP* img3Row = img3->data.TYP[row-readN0]; \ 161 161 ps##TYP* img4Row = img4->data.TYP[row]; \ 162 for ( unsigned intcol = readM0; col < readM; col++) { \162 for (psU32 col = readM0; col < readM; col++) { \ 163 163 if (fabsf(imgRow[col-readM0]-img2Row[col]) > FLT_EPSILON) { \ 164 164 psError(__func__,"Image changed in I/O operation at %d,%d,0 (%.2f vs %.2f) for %s", \ … … 258 258 } 259 259 260 inttestImageWrite(void)260 psS32 testImageWrite(void) 261 261 { 262 262 psImage* img = NULL; 263 263 psImage* img2 = NULL; 264 intm = 64;265 intn = 96;264 psS32 m = 64; 265 psS32 n = 96; 266 266 267 267 /* … … 318 318 return 16; 319 319 } 320 for ( unsigned introw=0;row<n;row++) {320 for (psU32 row=0;row<n;row++) { 321 321 psF32* imgRow = img->data.F32[row]; 322 for ( unsigned intcol=0;col<m;col++) {322 for (psU32 col=0;col<m;col++) { 323 323 if (fabsf(imgRow[col] - (row+2*col)) > FLT_EPSILON) { 324 324 psError(__func__,"The image values were not overwritten at %d,%d (%.2f vs %.2f)",
Note:
See TracChangeset
for help on using the changeset viewer.
