Changeset 1961
- Timestamp:
- Oct 5, 2004, 12:21:53 PM (22 years ago)
- Location:
- trunk/psLib/test/image
- Files:
-
- 2 edited
-
tst_psImageExtraction.c (modified) (5 diffs)
-
verified/tst_psImageExtraction.stderr (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/image/tst_psImageExtraction.c
r1957 r1961 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1. 9$ $Name: not supported by cvs2svn $9 * @date $Date: 2004-10-05 19:42:51$8 * @version $Revision: 1.10 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2004-10-05 22:21:53 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 43 43 psVector* out = NULL; 44 44 psImage* image = psImageAlloc( c, r, PS_TYPE_F32 ); 45 psImage* imgU8 = psImageAlloc( c, r, PS_TYPE_U8 ); 45 46 psVector* positions = psVectorAlloc( r, PS_TYPE_U32 ); 46 47 psImage* mask = psImageAlloc( c, r, PS_TYPE_MASK ); 48 psImage* maskS8 = psImageAlloc( c, r, PS_TYPE_S8 ); 49 psImage* maskSz = psImageAlloc( r, c, PS_TYPE_MASK ); 47 50 psStats* stat = psStatsAlloc( PS_STAT_SAMPLE_MEDIAN ); 48 51 … … 63 66 for ( int row = 0;row < r;row++ ) { 64 67 psF32* imageRow = image->data.F32[ row ]; 65 psMaskType* maskRow = image->data.V[ row ]; 68 psU8* imgU8Row = imgU8->data.U8[ row ]; 69 psMaskType* maskRow = mask->data.V[ row ]; 70 psMaskType* maskSzRow = maskSz->data.V[ row ]; 71 psS8* maskS8Row = maskS8->data.V[ row ]; 66 72 psF32 rowOffset = ( psF32 ) row / ( psF32 ) r; 67 73 for ( int col = 0;col < c;col++ ) { 68 74 imageRow[ col ] = ( psF32 ) col + rowOffset; 75 imgU8Row[ col ] = (psU8) col; 69 76 maskRow[ col ] = 0; 77 maskS8Row[ col ] = 0; 78 maskSzRow[ col ] = 0; 70 79 } 71 80 } … … 282 291 } 283 292 293 /* Verify that a mask of different size than the input image returns null and program 294 execution doesn't stop. 295 */ 296 psLogMsg( __func__, PS_LOG_INFO, "Following should be an error mask size != image size."); 297 stat->options = PS_STAT_SAMPLE_MEDIAN; 298 out = psImageSlice( out, NULL, 299 image, 300 maskSz, 1, 301 c/10, r/10, 302 c/10+1, r/10+1, 303 PS_CUT_X_POS, 304 stat); 305 if ( out != NULL ) { 306 psError( __func__, "Mask size different than image size didn't return NULL as expected" ); 307 return 110; 308 } 309 310 /* Verify the a invalid type mask returns null and program execution doesn't stop. 311 */ 312 psLogMsg( __func__, PS_LOG_INFO, "Following should be an error invalid mask type."); 313 out = psImageSlice( out, NULL, 314 image, 315 maskS8, 1, 316 c/10, r/10, 317 c/10+1, r/10+1, 318 PS_CUT_X_POS, 319 stat); 320 if ( out != NULL ) { 321 psError( __func__, "Mask invalid type didn't return NULL as expected."); 322 return 111; 323 } 324 325 /* Verify the input image is an invalid type */ 326 psLogMsg( __func__, PS_LOG_INFO, "Following should be an error invalid image type."); 327 out = psImageSlice( out, NULL, 328 imgU8, 329 mask, 1, 330 c/10, r/10, 331 c/10+1, r/10+1, 332 PS_CUT_X_POS, 333 stat); 334 if ( out != NULL ) { 335 psError( __func__, "Input image with invalid type didn't return NULL as expected."); 336 return 112; 337 } 338 284 339 psFree( image ); 285 340 psFree( positions ); … … 287 342 psFree( out ); 288 343 psFree( stat ); 344 psFree( imgU8 ); 345 psFree( maskS8 ); 346 psFree( maskSz ); 289 347 290 348 return 0; -
trunk/psLib/test/image/verified/tst_psImageExtraction.stderr
r1959 r1961 167 167 <DATE><TIME>|<HOST>|E|psLib.image.psImageSlice 168 168 Specified statistic option, 0, is not valid. Must specify one and only one statistic type. 169 <DATE><TIME>|<HOST>|I|testImageSlice 170 Following should be an error mask size != image size. 171 <DATE><TIME>|<HOST>|E|psLib.image.psImageSlice 172 Input psImage mask size, 1000x2000, does not match psImage input size, 2000x1000. 173 <DATE><TIME>|<HOST>|I|testImageSlice 174 Following should be an error invalid mask type. 175 <DATE><TIME>|<HOST>|E|psLib.image.psImageSlice 176 Input psImage mask type, psS8, is not the supported mask datatype of psU8. 177 <DATE><TIME>|<HOST>|I|testImageSlice 178 Following should be an error invalid image type. 179 <DATE><TIME>|<HOST>|E|psLib.image.psImageSlice 180 Specified psImage type, psU8, is not supported. 169 181 170 182 ---> TESTPOINT PASSED (psImage{psImageSlice} | tst_psImageExtraction.c)
Note:
See TracChangeset
for help on using the changeset viewer.
