Changeset 2105 for trunk/psLib/src/image
- Timestamp:
- Oct 13, 2004, 3:22:59 PM (22 years ago)
- Location:
- trunk/psLib/src/image
- Files:
-
- 4 edited
-
psImage.c (modified) (2 diffs)
-
psImage.h (modified) (2 diffs)
-
psImageExtraction.c (modified) (2 diffs)
-
psImageManip.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/image/psImage.c
r2067 r2105 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1. 49$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-10-1 3 00:10:50$12 * @version $Revision: 1.50 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-10-14 01:22:59 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 441 441 psF64 unexposedValue) \ 442 442 { \ 443 int intX = (int) round((psF64)(x) - 0.5 ); \444 int intY = (int) round((psF64)(y) - 0.5 ); \443 int intX = (int) round((psF64)(x) - 0.5 + FLT_EPSILON); \ 444 int intY = (int) round((psF64)(y) - 0.5 + FLT_EPSILON); \ 445 445 int lastX = input->numCols - 1; \ 446 446 int lastY = input->numRows - 1; \ -
trunk/psLib/src/image/psImage.h
r2067 r2105 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.4 0$ $Name: not supported by cvs2svn $14 * @date $Date: 2004-10-1 3 00:10:50$13 * @version $Revision: 1.41 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2004-10-14 01:22:59 $ 15 15 * 16 16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 31 31 */ 32 32 typedef enum { 33 PS_INTERPOLATE_FLAT ,///< 'flat' interpolation (nearest pixel)33 PS_INTERPOLATE_FLAT = 1, ///< 'flat' interpolation (nearest pixel) 34 34 PS_INTERPOLATE_BILINEAR, ///< bi-linear interpolation 35 35 PS_INTERPOLATE_BICUBIC, ///< bi-cubic interpolation 36 PS_INTERPOLATE_SINC ///< sinc interpolation 36 PS_INTERPOLATE_SINC, ///< sinc interpolation 37 PS_INTERPOLATE_NUM_MODES ///< end-marker of list of modes; not a valid interpolation mode 37 38 } psImageInterpolateMode; 38 39 -
trunk/psLib/src/image/psImageExtraction.c
r2093 r2105 9 9 * @author Robert DeSonia, MHPCC 10 10 * 11 * @version $Revision: 1.2 5$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-10-1 3 23:34:57$11 * @version $Revision: 1.26 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-10-14 01:22:59 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 543 543 } 544 544 545 if (mode < PS_INTERPOLATE_FLAT || mode >= PS_INTERPOLATE_NUM_MODES) { 546 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageResample", 547 PS_ERR_BAD_PARAMETER_VALUE, true, 548 PS_ERRORTEXT_psImageManip_INTERPOLATION_MODE_UNSUPPORTED, 549 mode); 550 psFree(out); 551 return NULL; 552 } 553 545 554 if (mask != NULL) { 546 555 if (numRows != mask->numRows || numCols != mask->numCols) { -
trunk/psLib/src/image/psImageManip.c
r1941 r2105 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1.2 7$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-10- 02 02:08:00$12 * @version $Revision: 1.28 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-10-14 01:22:59 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 569 569 return NULL; 570 570 } 571 572 if (scale < 1) { 573 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageResample", 574 PS_ERR_BAD_PARAMETER_VALUE, true, 575 PS_ERRORTEXT_psImageManip_SCALE_NOT_POSITIVE, 576 scale); 577 psFree(out); 578 return NULL; 579 } 580 581 if (mode < PS_INTERPOLATE_FLAT || mode >= PS_INTERPOLATE_NUM_MODES) { 582 psErrorMsg(PS_ERRORNAME_DOMAIN "psImageResample", 583 PS_ERR_BAD_PARAMETER_VALUE, true, 584 PS_ERRORTEXT_psImageManip_INTERPOLATION_MODE_UNSUPPORTED, 585 mode); 586 psFree(out); 587 return NULL; 588 } 589 571 590 // create an output image of the same size 572 591 // and type … … 582 601 float inRow = (float)row * invScale; \ 583 602 for (int col=0;col<outCols;col++) { \ 584 rowData[col] = psImagePixelInterpolate(in, inRow,(float)col*invScale,NULL,0,0,mode); \603 rowData[col] = psImagePixelInterpolate(in,(float)col*invScale,inRow,NULL,0,0,mode); \ 585 604 } \ 586 605 } \
Note:
See TracChangeset
for help on using the changeset viewer.
