IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ticket #176: tst_psImage.patch

File tst_psImage.patch, 2.9 KB (added by Paul Price, 22 years ago)

Patch for PS_TYPE_PTR test

Line 
1Index: tst_psImage.c
2===================================================================
3RCS file: /data/panstarrs/cvsroot/psLib/test/image/tst_psImage.c,v
4retrieving revision 1.22
5diff -p -r1.22 tst_psImage.c
6*** tst_psImage.c 6 Aug 2004 22:34:06 -0000 1.22
7--- tst_psImage.c 31 Aug 2004 03:19:52 -0000
8***************
9*** 5,11 ****
10 *
11 * @author Robert DeSonia, MHPCC
12 *
13! * @version $Revision: 1.22 $ $Name: $
14 * @date $Date: 2004/08/06 22:34:06 $
15 *
16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii
17--- 5,11 ----
18 *
19 * @author Robert DeSonia, MHPCC
20 *
21! * @version $Revision: 1.22 $ $Name: rel2 $
22 * @date $Date: 2004/08/06 22:34:06 $
23 *
24 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii
25*************** int testImageAlloc(void)
26*** 66,75 ****
27 unsigned int numRows[] = {
28 0,1,100,1,150,100
29 };
30! unsigned int types = 12;
31 psElemType type[] = { PS_TYPE_S8, PS_TYPE_S16, PS_TYPE_S32, PS_TYPE_S64,
32 PS_TYPE_U8, PS_TYPE_U16, PS_TYPE_U32, PS_TYPE_U64,
33! PS_TYPE_F32, PS_TYPE_F64, PS_TYPE_C32, PS_TYPE_C64 };
34
35 psLogMsg(__func__,PS_LOG_INFO,"#546 - psImageAlloc shall allocate memory for a psImage structure");
36
37--- 66,76 ----
38 unsigned int numRows[] = {
39 0,1,100,1,150,100
40 };
41! unsigned int types = 13;
42 psElemType type[] = { PS_TYPE_S8, PS_TYPE_S16, PS_TYPE_S32, PS_TYPE_S64,
43 PS_TYPE_U8, PS_TYPE_U16, PS_TYPE_U32, PS_TYPE_U64,
44! PS_TYPE_F32, PS_TYPE_F64, PS_TYPE_C32, PS_TYPE_C64,
45! PS_TYPE_PTR };
46
47 psLogMsg(__func__,PS_LOG_INFO,"#546 - psImageAlloc shall allocate memory for a psImage structure");
48
49*************** int testImageAlloc(void)
50*** 211,216 ****
51--- 212,242 ----
52 }
53 }
54 break;
55+ case PS_TYPE_PTR: {
56+ unsigned int rows = numRows[i];
57+ unsigned int cols = numCols[i];
58+ psImage *temp = psImageAlloc(1,1,PS_TYPE_F32);
59+
60+ fprintf(stderr,"Checking PTR type, %dx%d\n",cols,rows);
61+
62+ for (int r=0;r<rows;r++) {
63+ for (int c=0;c<cols;c++) {
64+ image->data.PTR[r][c] = psMemIncrRefCounter(temp);
65+ }
66+ }
67+ for (int r=0;r<rows;r++) {
68+ for (int c=0;c<cols;c++) {
69+ if (image->data.PTR[r][c] != temp) {
70+ psError(__func__, "Could not set pixel in pointer image at (%d,%d): %x %x",
71+ c,r,image->data.PTR[r][c],temp);
72+ fflush(stdout);
73+ psFree(image);
74+ return 8;
75+ }
76+ }
77+ }
78+ psFree(temp);
79+ }
80 default: {
81 // ignore type and just use as byte bucket.
82 unsigned int rows = numRows[i];