Changeset 12741 for trunk/psLib/src/imageops/psImagePixelExtract.c
- Timestamp:
- Apr 4, 2007, 12:42:02 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/imageops/psImagePixelExtract.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/imageops/psImagePixelExtract.c
r12431 r12741 8 8 * @author Robert DeSonia, MHPCC 9 9 * 10 * @version $Revision: 1.3 1$ $Name: not supported by cvs2svn $11 * @date $Date: 2007-0 3-14 00:39:50$10 * @version $Revision: 1.32 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2007-04-04 22:42:02 $ 12 12 * 13 13 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 23 23 #include "psMemory.h" 24 24 #include "psVector.h" 25 #include "psError.h" 26 #include "psImage.h" 27 #include "psImageInterpolate.h" 25 28 #include "psImagePixelExtract.h" 26 #include "psError.h"27 28 29 29 30 30 #define VECTOR_STORE_ROW_CASE(TYPE) \ … … 679 679 float dY = (endRow - startRow) / (float)(nSamples-1); 680 680 681 psImageInterpolateOptions *interp = psImageInterpolateOptionsAlloc(mode, input, NULL, mask, maskVal, 682 0, 0, 0, 0, 0); 683 681 684 #define LINEAR_CUT_CASE(TYPE) \ 682 685 case PS_TYPE_##TYPE: { \ … … 692 695 cutRowsData[i] = y; \ 693 696 } \ 694 outData[i] = psImagePixelInterpolate(input,x,y,mask,maskVal,0,mode); \ 697 double value; \ 698 if (!psImageInterpolate(&value, NULL, NULL, x, y, interp)) { \ 699 psError(PS_ERR_UNKNOWN, false, "Unable to interpolate image."); \ 700 psFree(interp); \ 701 psFree(out); \ 702 return NULL; \ 703 } \ 704 outData[i] = value; \ 695 705 } \ 696 706 } \ … … 709 719 LINEAR_CUT_CASE(F32); 710 720 LINEAR_CUT_CASE(F64); 711 712 default: { 713 char* typeStr; 714 PS_TYPE_NAME(typeStr,input->type.type); 715 psError(PS_ERR_BAD_PARAMETER_TYPE, true, 716 _("Specified psImage type, %s, is not supported."), 717 typeStr); 718 psFree(out); 719 out = NULL; 720 } 721 } 721 default: { 722 char* typeStr; 723 PS_TYPE_NAME(typeStr,input->type.type); 724 psError(PS_ERR_BAD_PARAMETER_TYPE, true, 725 _("Specified psImage type, %s, is not supported."), 726 typeStr); 727 psFree(interp); 728 psFree(out); 729 out = NULL; 730 } 731 } 732 733 psFree(interp); 722 734 723 735 return out;
Note:
See TracChangeset
for help on using the changeset viewer.
