Changeset 6806 for trunk/psLib/src/imageops/psImagePixelExtract.c
- Timestamp:
- Apr 6, 2006, 12:55:18 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/imageops/psImagePixelExtract.c (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/imageops/psImagePixelExtract.c
r6805 r6806 8 8 * @author Robert DeSonia, MHPCC 9 9 * 10 * @version $Revision: 1.1 7$ $Name: not supported by cvs2svn $11 * @date $Date: 2006-04-06 04:12:27$10 * @version $Revision: 1.18 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2006-04-06 22:55:18 $ 12 12 * 13 13 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 334 334 } 335 335 336 //If [0,0,0,0] specified, the whole image is to be included 337 if (row0 == 0 && col0 == 0 && row1 == 0 && col1 == 0) { 338 row0 = input->row0; 339 col0 = input->col0; 340 row1 = input->row0 + input->numRows - 1; 341 col1 = input->col0 + input->numCols - 1; 342 } 343 336 344 //Make sure x0 of region is inside image. If so, set col0 to corresponding index number. 337 345 if (col0 >= input->col0 && col0 < (input->col0 + input->numCols) ) { … … 341 349 "Specified psRegion parameter, x0=%f, is out of range [%d,%d].\n", 342 350 region.x0, input->col0, input->col0+input->numCols-1); 351 psFree(out); 343 352 return NULL; 344 353 } … … 350 359 "Specified psRegion parameter, y0=%f, is out of range [%d,%d].\n", 351 360 region.y0, input->row0, input->row0+input->numRows-1); 352 return NULL; 353 } 354 355 //If [0,0,0,0] specified, the whole image is to be included 356 if (row0 == 0 && col0 == 0 && row1 == 0 && col1 == 0) { 357 row0 = input->row0; 358 col0 = input->col0; 359 row1 = input->row0 + input->numRows; 360 col1 = input->col0 + input->numCols; 361 psFree(out); 362 return NULL; 361 363 } 362 364 … … 368 370 "Specified psRegion parameter, x1=%f=%d, is out of range [%d,%d].\n", 369 371 region.x1, col1+input->col0, input->col0, input->col0+input->numCols-1); 372 psFree(out); 370 373 return NULL; 371 374 } … … 376 379 "Specified psRegion parameter, x1=%f=%d, is out of range [%d,%d].\n", 377 380 region.x1, col1, input->col0, input->col0+input->numCols-1); 381 psFree(out); 378 382 return NULL; 379 383 } … … 385 389 "Specified psRegion parameter, y1=%f=%d, is out of range [%d,%d].\n", 386 390 region.y1, row1+input->row0, input->row0, input->row0+input->numRows-1); 391 psFree(out); 387 392 return NULL; 388 393 } … … 393 398 "Specified psRegion parameter, y1=%f=%d, is out of range [%d,%d].\n", 394 399 region.y1, row1, input->row0, input->row0+input->numRows-1); 400 psFree(out); 395 401 return NULL; 396 402 } … … 406 412 region.y0, row0, region.y1, row1); 407 413 } 414 psFree(out); 408 415 return NULL; 409 416 } else if (col0 == col1 && row0 == row1) { 410 417 psError(PS_ERR_BAD_PARAMETER_VALUE, true, 411 418 "Invalid psRegion specified. Region contains only 1 pixel.\n"); 419 psFree(out); 412 420 return NULL; 413 421 } … … 679 687 row0 = input->row0; 680 688 col0 = input->col0; 681 row1 = input->row0 + input->numRows ;682 col1 = input->col0 + input->numCols ;689 row1 = input->row0 + input->numRows - 1; 690 col1 = input->col0 + input->numCols - 1; 683 691 } 684 692
Note:
See TracChangeset
for help on using the changeset viewer.
