Changeset 1682 for trunk/psLib/test/image/tst_psImage.c
- Timestamp:
- Sep 2, 2004, 11:17:03 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
r1664 r1682 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1.2 4$ $Name: not supported by cvs2svn $9 * @date $Date: 2004-0 8-31 19:36:02$8 * @version $Revision: 1.25 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2004-09-02 21:17:03 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 526 526 psImage* img2 = NULL; 527 527 psImage* img3 = NULL; 528 psImage* img4 = NULL; 528 529 unsigned int c = 128; 529 530 unsigned int r = 256; … … 550 551 psError(__func__,"the image given for recycled wasn't"); 551 552 return 1; 553 } 554 555 // Verify the returned psImage structure is the same type as the input image structure 556 // if the specified output argument is NULL. 557 img4 = psImageCopy(NULL,img,PS_TYPE_F32); 558 if (img4 == NULL) { 559 psError(__func__,"output image doesn't exist"); 560 return 4; 561 } 562 if (img4->type.type != img->type.type) { 563 psError(__func__,"output image is not the same type as input image"); 564 return 4; 565 } 566 for (unsigned int row=0;row<r;row++) { 567 psF32* imgInRow = img->data.F32[row]; 568 psF32* imgOutRow = img4->data.F32[row]; 569 for (unsigned col=0;col<c;col++) { 570 if( imgInRow[col] != imgOutRow[col] ) { 571 psError(__func__,"Input image not equal to output image at %d,%d!", 572 col, row); 573 return 4; 574 } 575 } 552 576 } 553 577 … … 632 656 psFree(img); 633 657 psFree(img2); 658 psFree(img3); 659 psFree(img4); 634 660 635 661 return 0;
Note:
See TracChangeset
for help on using the changeset viewer.
