Changeset 2088
- Timestamp:
- Oct 13, 2004, 12:05:03 PM (22 years ago)
- Location:
- trunk/psLib/src/image
- Files:
-
- 2 edited
-
psImageExtraction.c (modified) (8 diffs)
-
psImageExtraction.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/image/psImageExtraction.c
r2074 r2088 9 9 * @author Robert DeSonia, MHPCC 10 10 * 11 * @version $Revision: 1.2 3$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-10-13 02:40:13 $11 * @version $Revision: 1.24 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-10-13 22:05:03 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 508 508 float endCol, 509 509 float endRow, 510 float nSamples,510 unsigned int nSamples, 511 511 psImageInterpolateMode mode) 512 512 { … … 538 538 PS_ERRORTEXT_psImage_LINE_NOT_IN_IMAGE, 539 539 startCol,startRow,endCol,endRow, 540 numCols,numRows); 541 psFree(out); 540 numCols-1,numRows-1); 541 psFree(out); 542 return NULL; 542 543 } 543 544 … … 548 549 PS_ERRORTEXT_psImage_IMAGE_MASK_SIZE, 549 550 mask->numCols,mask->numRows, 550 numCols , numRows);551 numCols-1, numRows); 551 552 psFree(out); 553 return NULL; 552 554 } 553 555 if (mask->type.type != PS_TYPE_MASK) { … … 559 561 typeStr, PS_TYPE_MASK_NAME); 560 562 psFree(out); 563 return NULL; 561 564 } 562 565 } … … 574 577 } 575 578 576 out = psVectorRecycle(out,nSamples,in->type.type); 577 578 float dX = (endCol - startCol) / (nSamples-1); 579 float dY = (endRow - startRow) / (nSamples-1); 580 581 float x = startCol; 582 float y = startRow; 579 out = psVectorRecycle(out, nSamples, in->type.type); 580 581 float dX = (endCol - startCol) / (float)(nSamples-1); 582 float dY = (endRow - startRow) / (float)(nSamples-1); 583 583 584 584 #define LINEAR_CUT_CASE(TYPE) \ … … 586 586 ps##TYPE* outData = out->data.TYPE; \ 587 587 for (int i = 0; i < nSamples; i++) { \ 588 float x = startCol + (float)i*dX; \ 589 float y = startRow + (float)i*dY; \ 588 590 /* store off the location of the sample. */ \ 589 591 if (cutColsData != NULL) { \ … … 594 596 } \ 595 597 outData[i] = psImagePixelInterpolate(in,x,y,mask,maskVal,0,mode); \ 596 x += dX; \597 y += dY; \598 598 } \ 599 599 } \ -
trunk/psLib/src/image/psImageExtraction.h
r2067 r2088 10 10 * @author Robert DeSonia, MHPCC 11 11 * 12 * @version $Revision: 1.1 7$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-10-13 00:10:50$12 * @version $Revision: 1.18 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-10-13 22:05:03 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 166 166 float endCol, ///< the column of the end of the cut line 167 167 float endRow, ///< the row of the end of the cut line 168 float nSamples,///< the number of samples along the cut168 unsigned int nSamples, ///< the number of samples along the cut 169 169 psImageInterpolateMode mode ///< the interpolation method to use 170 170 );
Note:
See TracChangeset
for help on using the changeset viewer.
