Changeset 5254 for trunk/psLib/test/imageops/tst_psImageMaskOps.c
- Timestamp:
- Oct 7, 2005, 5:51:20 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/imageops/tst_psImageMaskOps.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/imageops/tst_psImageMaskOps.c
r5227 r5254 6 6 * @author David Robbins, MHPCC 7 7 * 8 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $9 * @date $Date: 2005-10-0 6 02:41:07$8 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2005-10-08 03:51:20 $ 10 10 * 11 11 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 152 152 return 1; 153 153 } 154 in = psImageAlloc( 3, 3, PS_TYPE_MASK);154 in = psImageAlloc(5, 5, PS_TYPE_MASK); 155 155 //return null for incompatible image size 156 156 test = psImageAlloc(2, 2, PS_TYPE_MASK); … … 161 161 return 2; 162 162 } 163 //return null for incompatible image type164 test = psImageRecycle(test, 3, 3, PS_TYPE_F32);163 //return null for incompatible out image type 164 test = psImageRecycle(test, 5, 5, PS_TYPE_F32); 165 165 out = psImageGrowMask(test, in, maskVal, growSize, growVal); 166 166 if (out != NULL) { 167 167 fprintf(stderr, 168 "psImageGrowMask failed to return NULL for incompatible image type.\n");168 "psImageGrowMask failed to return NULL for incompatible output image type.\n"); 169 169 return 3; 170 170 } 171 172 171 //return NULL for input image that doesn't match PS_TYPE_MASK 172 in = psImageRecycle(in, 5, 5, PS_TYPE_F32); 173 out = psImageGrowMask(test, in, maskVal, growSize, growVal); 174 if (out != NULL) { 175 fprintf(stderr, 176 "psImageGrowMask failed to return NULL for incompatible input image type.\n"); 177 return 4; 178 } 179 //Test for valid function (image growth) 180 in = psImageRecycle(in, 5, 5, PS_TYPE_MASK); 181 in->data.PS_TYPE_MASK_DATA[0][0] = 1; 182 in->data.PS_TYPE_MASK_DATA[0][1] = 1; 183 in->data.PS_TYPE_MASK_DATA[0][2] = 1; 184 in->data.PS_TYPE_MASK_DATA[0][3] = 1; 185 in->data.PS_TYPE_MASK_DATA[0][4] = 1; 186 in->data.PS_TYPE_MASK_DATA[1][0] = 1; 187 in->data.PS_TYPE_MASK_DATA[1][1] = 1; 188 in->data.PS_TYPE_MASK_DATA[1][2] = 2; 189 in->data.PS_TYPE_MASK_DATA[1][3] = 1; 190 in->data.PS_TYPE_MASK_DATA[1][4] = 1; 191 in->data.PS_TYPE_MASK_DATA[2][0] = 1; 192 in->data.PS_TYPE_MASK_DATA[2][1] = 1; 193 in->data.PS_TYPE_MASK_DATA[2][2] = 2; 194 in->data.PS_TYPE_MASK_DATA[2][3] = 1; 195 in->data.PS_TYPE_MASK_DATA[2][4] = 1; 196 in->data.PS_TYPE_MASK_DATA[3][0] = 1; 197 in->data.PS_TYPE_MASK_DATA[3][1] = 1; 198 in->data.PS_TYPE_MASK_DATA[3][2] = 1; 199 in->data.PS_TYPE_MASK_DATA[3][3] = 1; 200 in->data.PS_TYPE_MASK_DATA[3][4] = 2; 201 in->data.PS_TYPE_MASK_DATA[4][0] = 1; 202 in->data.PS_TYPE_MASK_DATA[4][1] = 1; 203 in->data.PS_TYPE_MASK_DATA[4][2] = 1; 204 in->data.PS_TYPE_MASK_DATA[4][3] = 1; 205 in->data.PS_TYPE_MASK_DATA[4][4] = 1; 206 maskVal = 2; 207 growSize = 1; 208 growVal = 2; 209 210 out = psImageGrowMask(out, in, maskVal, growSize, growVal); 211 //0,2 1,1 1,3 2,1 2,3 3,2 should all be 3. All other should be unchanged. 212 for (int i = 0; i < 5; i++) { 213 printf("\n "); 214 for (int j = 0; j < 5; j++) { 215 printf(" %d,%d= %d ", i, j, out->data.PS_TYPE_MASK_DATA[i][j]); 216 } 217 } 218 psFree(out); 173 219 psFree(in); 174 220 psFree(test);
Note:
See TracChangeset
for help on using the changeset viewer.
