Changeset 4367
- Timestamp:
- Jun 22, 2005, 5:50:29 PM (21 years ago)
- Location:
- trunk/psLib
- Files:
-
- 29 edited
-
pslib.kdevelop (modified) (2 diffs)
-
pslib.kdevelop.pcs (modified) ( previous)
-
pslib.kdevses (modified) (1 diff)
-
src/collections/psArray.c (modified) (2 diffs)
-
src/collections/psArray.h (modified) (2 diffs)
-
src/collections/psCompare.h (modified) (2 diffs)
-
src/collections/psList.c (modified) (3 diffs)
-
src/collections/psList.h (modified) (3 diffs)
-
src/image/psImageGeomManip.c (modified) (19 diffs)
-
src/image/psImageGeomManip.h (modified) (5 diffs)
-
src/image/psImagePixelExtract.c (modified) (24 diffs)
-
src/image/psImagePixelExtract.h (modified) (4 diffs)
-
src/image/psImagePixelManip.c (modified) (2 diffs)
-
src/image/psImagePixelManip.h (modified) (2 diffs)
-
src/imageops/psImageGeomManip.c (modified) (19 diffs)
-
src/imageops/psImageGeomManip.h (modified) (5 diffs)
-
src/imageops/psImagePixelExtract.c (modified) (24 diffs)
-
src/imageops/psImagePixelExtract.h (modified) (4 diffs)
-
src/imageops/psImagePixelManip.c (modified) (2 diffs)
-
src/imageops/psImagePixelManip.h (modified) (2 diffs)
-
src/math/psCompare.h (modified) (2 diffs)
-
src/sys/psLogMsg.c (modified) (5 diffs)
-
src/sys/psLogMsg.h (modified) (3 diffs)
-
src/sysUtils/psLogMsg.c (modified) (5 diffs)
-
src/sysUtils/psLogMsg.h (modified) (3 diffs)
-
src/types/psArray.c (modified) (2 diffs)
-
src/types/psArray.h (modified) (2 diffs)
-
src/types/psList.c (modified) (3 diffs)
-
src/types/psList.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/pslib.kdevelop
r3476 r4367 12 12 </keywords> 13 13 <ignoreparts> 14 <part>KDevClearCase</part> 15 <part>KDevcopyto</part> 14 16 <part>KDevCTags</part> 17 <part>CvsService</part> 18 <part>KDevFileGroups</part> 19 <part>KDevPerforce</part> 15 20 <part>KDevsubversion</part> 16 <part>KDevcopyto</part>17 <part>KDevClearCase</part>18 <part>KDevFileGroups</part>19 <part>CvsService</part>20 <part>KDevPerforce</part>21 21 </ignoreparts> 22 <projectdirectory>./src/</projectdirectory> 23 <absoluteprojectpath>false</absoluteprojectpath> 24 <description/> 25 <secondaryLanguages/> 22 26 </general> 23 27 <kdevautoproject> … … 156 160 </codecompletion> 157 161 </kdevcppsupport> 162 <cppsupportpart> 163 <filetemplates> 164 <interfacesuffix>.h</interfacesuffix> 165 <implementationsuffix>.cpp</implementationsuffix> 166 </filetemplates> 167 </cppsupportpart> 168 <kdevdebugger> 169 <general> 170 <programargs/> 171 <gdbpath/> 172 <dbgshell>libtool</dbgshell> 173 <configGdbScript/> 174 <runShellScript/> 175 <runGdbScript/> 176 <breakonloadinglibs>true</breakonloadinglibs> 177 <separatetty>false</separatetty> 178 <floatingtoolbar>false</floatingtoolbar> 179 </general> 180 <display> 181 <staticmembers>false</staticmembers> 182 <demanglenames>true</demanglenames> 183 <outputradix>10</outputradix> 184 </display> 185 </kdevdebugger> 158 186 </kdevelop> -
trunk/psLib/pslib.kdevses
r4342 r4367 2 2 <!DOCTYPE KDevPrjSession> 3 3 <KDevPrjSession> 4 <DocsAndViews NumberOfDocuments="2" > 5 <Doc0 NumberOfViews="1" URL="file:/home/drobbin/panstarrs/psLib/src/collections/psVector.h" > 6 <View0 line="103" Type="Source" /> 7 </Doc0> 8 <Doc1 NumberOfViews="1" URL="file:/home/drobbin/panstarrs/psLib/src/collections/psVector.c" > 9 <View0 line="130" Type="Source" /> 10 </Doc1> 11 </DocsAndViews> 4 <DocsAndViews NumberOfDocuments="0" /> 12 5 <pluginList> 13 6 <kdevbookmarks> -
trunk/psLib/src/collections/psArray.c
r4342 r4367 9 9 * @author Ross Harman, MHPCC 10 10 * 11 * @version $Revision: 1.3 0$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-06-2 2 02:05:41$11 * @version $Revision: 1.31 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-06-23 03:50:29 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 147 147 } 148 148 149 psArray* psArraySort(psArray* array, psComparePtrF cnfunc)149 psArray* psArraySort(psArray* array, psComparePtrFunc func) 150 150 { 151 151 if (array == NULL) { -
trunk/psLib/src/collections/psArray.h
r4342 r4367 12 12 * @author Ross Harman, MHPCC 13 13 * 14 * @version $Revision: 1.2 6$ $Name: not supported by cvs2svn $15 * @date $Date: 2005-06-2 2 02:05:41$14 * @version $Revision: 1.27 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2005-06-23 03:50:29 $ 16 16 * 17 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 123 123 psArray* psArraySort( 124 124 psArray* array, ///< input array to sort. 125 psComparePtrF cn func///< the compare function125 psComparePtrFunc func ///< the compare function 126 126 ); 127 127 -
trunk/psLib/src/collections/psCompare.h
r4162 r4367 6 6 * @ingroup Compare 7 7 * 8 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $9 * @date $Date: 2005-06- 08 23:40:45$8 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2005-06-23 03:50:29 $ 10 10 * 11 11 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 28 28 * than, equal to, or greater than the second. 29 29 */ 30 typedef int (*psComparePtrF cn) (30 typedef int (*psComparePtrFunc) ( 31 31 const void **a, ///< first comparison target 32 32 const void **b ///< second comparison target -
trunk/psLib/src/collections/psList.c
r4316 r4367 6 6 * @author Robert Daniel DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1.3 7$ $Name: not supported by cvs2svn $9 * @date $Date: 2005-06- 18 03:13:01$8 * @version $Revision: 1.38 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2005-06-23 03:50:29 $ 10 10 * 11 11 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 610 610 } 611 611 612 psList* psListSort(psList* list, psComparePtrF cn compare)612 psList* psListSort(psList* list, psComparePtrFunc func) 613 613 { 614 614 psArray* arr; … … 622 622 psFree(list); 623 623 624 arr = psArraySort(arr, compare);624 arr = psArraySort(arr, func); 625 625 626 626 // convert back to linked list -
trunk/psLib/src/collections/psList.h
r4330 r4367 7 7 * @ingroup LinkedList 8 8 * 9 * @version $Revision: 1.2 7$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-06-2 1 03:01:37$9 * @version $Revision: 1.28 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-06-23 03:50:29 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 99 99 psListIterator* psListIteratorAlloc( 100 100 psList* list, ///< the psList to iterate with 101 long location, ///< the initial starting point.101 long location, ///< the initial starting point. 102 102 ///< This can be a numeric index, PS_LIST_HEAD, or PS_LIST_TAIL. 103 103 bool mutable ///< Is it permissible to modify list? … … 221 221 psList* psListSort( 222 222 psList* list, ///< the list to sort 223 psComparePtrF cn compare///< the comparison function223 psComparePtrFunc func ///< the comparison function 224 224 ); 225 225 -
trunk/psLib/src/image/psImageGeomManip.c
r4316 r4367 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1. 9$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-06- 18 03:13:02$12 * @version $Revision: 1.10 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-06-23 03:50:29 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 36 36 const psImage* restrict mask, 37 37 psMaskType maskVal, 38 psU32scale,38 int scale, 39 39 const psStats* stats) 40 40 { … … 303 303 304 304 psImage* psImageRotate(psImage* out, 305 const psImage* in ,305 const psImage* input, 306 306 float angle, 307 psC64 unexposedValue,307 _Complex exposed, 308 308 psImageInterpolateMode mode) 309 309 { 310 if (in == NULL) {310 if (input == NULL) { 311 311 psError(PS_ERR_BAD_PARAMETER_NULL, true, 312 312 PS_ERRORTEXT_psImage_IMAGE_NULL); … … 319 319 if (fabsf(angle - M_PI_2) < FLT_EPSILON) { 320 320 // perform 1/4 rotate counter-clockwise 321 psS32 numRows = in ->numCols;322 psS32 numCols = in ->numRows;321 psS32 numRows = input->numCols; 322 psS32 numCols = input->numRows; 323 323 psS32 lastCol = numCols - 1; 324 psElemType type = in ->type.type;324 psElemType type = input->type.type; 325 325 326 326 out = psImageRecycle(out, numCols, numRows, type); … … 328 328 #define PSIMAGE_ROTATE_LEFT_90(TYPE) \ 329 329 case PS_TYPE_##TYPE: { \ 330 ps##TYPE** inData = in ->data.TYPE; \330 ps##TYPE** inData = input->data.TYPE; \ 331 331 for (psS32 row=0;row<numRows;row++) { \ 332 332 ps##TYPE* outRow = out->data.TYPE[row]; \ … … 364 364 } else if (fabsf(angle - M_PI) < FLT_EPSILON) { 365 365 // perform 1/2 rotate 366 psS32 numRows = in ->numRows;366 psS32 numRows = input->numRows; 367 367 psS32 lastRow = numRows - 1; 368 psS32 numCols = in ->numCols;368 psS32 numCols = input->numCols; 369 369 psS32 lastCol = numCols - 1; 370 psElemType type = in ->type.type;370 psElemType type = input->type.type; 371 371 372 372 out = psImageRecycle(out, numCols, numRows, type); … … 376 376 for (psS32 row=0;row<numRows;row++) { \ 377 377 ps##TYPE* outRow = out->data.TYPE[row]; \ 378 ps##TYPE* inRow = in ->data.TYPE[lastRow-row]; \378 ps##TYPE* inRow = input->data.TYPE[lastRow-row]; \ 379 379 for (psS32 col=0;col<numCols;col++) { \ 380 380 outRow[col] = inRow[lastCol - col]; \ … … 410 410 } else if (fabsf(angle - (M_PI+M_PI_2)) < FLT_EPSILON) { 411 411 // perform 1/4 rotate clockwise 412 psS32 numRows = in ->numCols;412 psS32 numRows = input->numCols; 413 413 psS32 lastRow = numRows - 1; 414 psS32 numCols = in ->numRows;415 psElemType type = in ->type.type;414 psS32 numCols = input->numRows; 415 psElemType type = input->type.type; 416 416 417 417 out = psImageRecycle(out, numCols, numRows, type); … … 419 419 #define PSIMAGE_ROTATE_RIGHT_90(TYPE) \ 420 420 case PS_TYPE_##TYPE: { \ 421 ps##TYPE** inData = in ->data.TYPE; \421 ps##TYPE** inData = input->data.TYPE; \ 422 422 for (psS32 row=0;row<numRows;row++) { \ 423 423 ps##TYPE* outRow = out->data.TYPE[row]; \ … … 454 454 } 455 455 } else if (fabsf(angle) < FLT_EPSILON) { 456 out = psImageCopy(out, in , in->type.type);456 out = psImageCopy(out, input, input->type.type); 457 457 } else { 458 psElemType type = in ->type.type;459 psS32 numRows = in ->numRows;460 psS32 numCols = in ->numCols;458 psElemType type = input->type.type; 459 psS32 numRows = input->numRows; 460 psS32 numCols = input->numCols; 461 461 float centerX = (float)(numCols) / 2.0f; 462 462 float centerY = (float)(numRows) / 2.0f; … … 497 497 498 498 #define PSIMAGE_ROTATE_ARBITRARY_LOOP(TYPE,MODE) { \ 499 if (creal( unexposedValue) < PS_MIN_##TYPE || \500 creal( unexposedValue) > PS_MAX_##TYPE || \501 cimag( unexposedValue) < PS_MIN_##TYPE || \502 cimag( unexposedValue) > PS_MAX_##TYPE) { \499 if (creal(exposed) < PS_MIN_##TYPE || \ 500 creal(exposed) > PS_MAX_##TYPE || \ 501 cimag(exposed) < PS_MIN_##TYPE || \ 502 cimag(exposed) > PS_MAX_##TYPE) { \ 503 503 psError(PS_ERR_BAD_PARAMETER_VALUE, true, \ 504 504 PS_ERRORTEXT_psImageManip_CLIP_VALUE_INVALID, \ 505 " unexposedValue", \506 creal( unexposedValue),cimag(unexposedValue), \505 "exposed", \ 506 creal(exposed),cimag(exposed), \ 507 507 PS_TYPE_##TYPE##_NAME, \ 508 508 (double)PS_MIN_##TYPE,(double)PS_MAX_##TYPE); \ … … 519 519 outRow = out->data.TYPE[y]; \ 520 520 for (psS32 x = 0; x < outCols; x++) { \ 521 outRow[x] = p_psImagePixelInterpolate##MODE##_##TYPE(in ,inX,inY,NULL,0,unexposedValue); \521 outRow[x] = p_psImagePixelInterpolate##MODE##_##TYPE(input,inX,inY,NULL,0,exposed); \ 522 522 inX += cosT; \ 523 523 inY -= sinT; \ … … 594 594 595 595 psImage* psImageShift(psImage* out, 596 const psImage* in ,596 const psImage* input, 597 597 float dx, 598 598 float dy, 599 psC64 unexposedValue,599 _Complex exposed, 600 600 psImageInterpolateMode mode) 601 601 { … … 605 605 psElemType type; 606 606 607 if (in == NULL) {607 if (input == NULL) { 608 608 psError(PS_ERR_BAD_PARAMETER_NULL, true, 609 609 PS_ERRORTEXT_psImage_IMAGE_NULL); … … 613 613 // create an output image of the same size 614 614 // and type 615 outRows = in ->numRows;616 outCols = in ->numCols;617 type = in ->type.type;615 outRows = input->numRows; 616 outCols = input->numCols; 617 type = input->type.type; 618 618 elementSize = PSELEMTYPE_SIZEOF(type); 619 619 out = psImageRecycle(out, outCols, outRows, type); … … 621 621 #define PSIMAGE_SHIFT_CASE(MODE,TYPE) \ 622 622 case PS_TYPE_##TYPE: \ 623 if (creal( unexposedValue) < PS_MIN_##TYPE || \624 creal( unexposedValue) > PS_MAX_##TYPE || \625 cimag( unexposedValue) < PS_MIN_##TYPE || \626 cimag( unexposedValue) > PS_MAX_##TYPE) { \623 if (creal(exposed) < PS_MIN_##TYPE || \ 624 creal(exposed) > PS_MAX_##TYPE || \ 625 cimag(exposed) < PS_MIN_##TYPE || \ 626 cimag(exposed) > PS_MAX_##TYPE) { \ 627 627 psError(PS_ERR_BAD_PARAMETER_VALUE, true, \ 628 628 PS_ERRORTEXT_psImageManip_CLIP_VALUE_INVALID, \ 629 " unexposedValue", \630 creal( unexposedValue),cimag(unexposedValue), \629 "exposed", \ 630 creal(exposed),cimag(exposed), \ 631 631 PS_TYPE_##TYPE##_NAME, \ 632 632 (double)PS_MIN_##TYPE,(double)PS_MAX_##TYPE); \ … … 640 640 for (psS32 col=0;col<outCols;col++) { \ 641 641 outRow[col] = p_psImagePixelInterpolate##MODE##_##TYPE( \ 642 in ,dx+(float)col,y,NULL,0,unexposedValue); \642 input,dx+(float)col,y,NULL,0,exposed); \ 643 643 } \ 644 644 } \ … … 647 647 #define PSIMAGE_SHIFT_ARBITRARY_CASE(MODE) \ 648 648 case PS_INTERPOLATE_##MODE: \ 649 switch (in ->type.type) { \649 switch (input->type.type) { \ 650 650 PSIMAGE_SHIFT_CASE(MODE,U8); \ 651 651 PSIMAGE_SHIFT_CASE(MODE,U16); \ … … 694 694 int inputMaskVal, 695 695 const psPlaneTransform *outToIn, 696 constpsRegion region,696 psRegion region, 697 697 const psPixels* pixels, 698 698 psImageInterpolateMode mode, 699 intexposedValue)699 double exposedValue) 700 700 { 701 701 if (input == NULL) { -
trunk/psLib/src/image/psImageGeomManip.h
r4316 r4367 8 8 * @author Robert DeSonia, MHPCC 9 9 * 10 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $11 * @date $Date: 2005-06- 18 03:13:02$10 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2005-06-23 03:50:29 $ 12 12 * 13 13 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 39 39 const psImage* mask, ///< mask for input image. If NULL, no masking is done. 40 40 psMaskType maskVal, ///< the bits to check in mask. 41 psU32 scale,///< the scale to rebin for each dimension41 int scale, ///< the scale to rebin for each dimension 42 42 const psStats* stats 43 43 ///< the statistic to perform when rebinning. Only one method should be set. … … 75 75 psImage* psImageRotate( 76 76 psImage* out, ///< an psImage to recycle. If NULL, a new image is created 77 const psImage* in ,///< input image77 const psImage* input, ///< input image 78 78 float angle, ///< the rotation angle in radians. 79 psC64 unexposedValue,///< the output image pixel values for non-imagery areas79 _Complex exposed, ///< the output image pixel values for non-imagery areas 80 80 psImageInterpolateMode mode ///< the interpolation mode used 81 81 ); … … 94 94 psImage* psImageShift( 95 95 psImage* out, ///< an psImage to recycle. If NULL, a new image is created 96 const psImage* in ,///< input image96 const psImage* input, ///< input image 97 97 float dx, ///< the shift in x direction. 98 98 float dy, ///< the shift in y direction. 99 psC64 unexposedValue,///< the output image pixel values for non-imagery areas99 _Complex exposed, ///< the output image pixel values for non-imagery areas 100 100 psImageInterpolateMode mode ///< the interpolation mode to use 101 101 ); … … 149 149 int inputMaskVal, ///< masking value for inputMask 150 150 const psPlaneTransform *outToIn, ///< the transform to apply 151 const psRegion region,///< the size of the transformed image151 psRegion region, ///< the size of the transformed image 152 152 const psPixels* pixels, /**< if not NULL, consists of psPixelCoords and specifies which pixels in 153 * output image shall be transformed; otherwise, entire image generated*/153 * output image shall be transformed; otherwise, entire image generated*/ 154 154 psImageInterpolateMode mode, ///< the interpolation scheme to be used 155 intexposedValue ///< Exposed value to which non-corresponding pixels are set155 double exposedValue ///< Exposed value to which non-corresponding pixels are set 156 156 ); 157 157 -
trunk/psLib/src/image/psImagePixelExtract.c
r4206 r4367 8 8 * @author Robert DeSonia, MHPCC 9 9 * 10 * @version $Revision: 1. 2$ $Name: not supported by cvs2svn $11 * @date $Date: 2005-06- 10 02:30:47$10 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2005-06-23 03:50:29 $ 12 12 * 13 13 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 24 24 25 25 psVector* psImageSlice(psVector* out, 26 psVector* slicePositions,27 const psImage* restrict in ,26 psVector* coords, 27 const psImage* restrict input, 28 28 const psImage* restrict mask, 29 29 psU32 maskVal, … … 44 44 psS32 col1 = region.x1; 45 45 46 if (in == NULL || in->data.V == NULL) {46 if (input == NULL || input->data.V == NULL) { 47 47 psError(PS_ERR_BAD_PARAMETER_NULL, true, 48 48 PS_ERRORTEXT_psImage_IMAGE_NULL); … … 52 52 53 53 if (col1 < 1) { 54 col1 += in ->numCols;54 col1 += input->numCols; 55 55 } 56 56 57 57 if (row1 < 1) { 58 row1 += in ->numRows;58 row1 += input->numRows; 59 59 } 60 60 61 61 if ( col0 < 0 || 62 62 row0 < 0 || 63 col1 > in ->numCols ||64 row1 > in ->numRows ||63 col1 > input->numCols || 64 row1 > input->numRows || 65 65 col0 >= col1 || 66 66 row0 >= row1) { … … 68 68 PS_ERRORTEXT_psImage_SUBSET_RANGE_INVALID, 69 69 col0, col1, row0, row1, 70 in ->numCols, in->numRows);71 psFree(out); 72 return NULL; 73 } 74 75 type = in ->type.type;76 inRows = in ->numRows;77 inCols = in ->numCols;70 input->numCols, input->numRows); 71 psFree(out); 72 return NULL; 73 } 74 75 type = input->type.type; 76 inRows = input->numRows; 77 inCols = input->numCols; 78 78 79 79 if (direction == PS_CUT_X_NEG || direction == PS_CUT_Y_NEG) { … … 134 134 // psStats. 135 135 out = psVectorRecycle(out, numCols, PS_TYPE_F64); 136 if ( slicePositions != NULL) {137 slicePositions = psVectorRecycle(slicePositions, numCols, PS_TYPE_U32);138 outPosition = slicePositions->data.U32;136 if (coords != NULL) { 137 coords = psVectorRecycle(coords, numCols, PS_TYPE_U32); 138 outPosition = coords->data.U32; 139 139 } 140 140 outData = out->data.F64; … … 153 153 psMaskType* maskVecData = NULL; \ 154 154 for (psS32 c=col0;c<col1;c++) { \ 155 ps##TYPE *imgData = in ->data.TYPE[row0] + c; \155 ps##TYPE *imgData = input->data.TYPE[row0] + c; \ 156 156 ps##TYPE *imgVecData = imgVec->data.TYPE; \ 157 157 if (maskVec != NULL) { \ … … 213 213 // fill in psVector to fake out the statistics functions. 214 214 imgVec = psAlloc(sizeof(psVector)); 215 imgVec->type = in ->type;215 imgVec->type = input->type; 216 216 imgVec->n = *(int*)&imgVec->nalloc = numCols; 217 217 if (mask != NULL) { … … 224 224 // psStats. 225 225 out = psVectorRecycle(out, numRows, PS_TYPE_F64); 226 if ( slicePositions != NULL) {227 slicePositions = psVectorRecycle(slicePositions, numRows, PS_TYPE_U32);228 outPosition = slicePositions->data.U32;226 if (coords != NULL) { 227 coords = psVectorRecycle(coords, numRows, PS_TYPE_U32); 228 outPosition = coords->data.U32; 229 229 } 230 230 outData = out->data.F64; … … 239 239 // point the vector struct to the 240 240 // data to calculate the stats 241 imgVec->data.U8 = (psPtr )(in ->data.U8[r] + col0 * elementSize);241 imgVec->data.U8 = (psPtr )(input->data.U8[r] + col0 * elementSize); 242 242 if (maskVec != NULL) { 243 243 maskVec->data.U8 = (psPtr )(mask->data.U8[r] + col0 * sizeof(psMaskType)); … … 271 271 psVector* cutCols, 272 272 psVector* cutRows, 273 const psImage* in ,273 const psImage* input, 274 274 const psImage* mask, 275 275 psU32 maskVal, 276 276 psRegion region, 277 psU32nSamples,277 unsigned int nSamples, 278 278 psImageInterpolateMode mode) 279 279 { 280 280 281 if (in == NULL || in->data.V == NULL) {281 if (input == NULL || input->data.V == NULL) { 282 282 psError(PS_ERR_BAD_PARAMETER_NULL, true, 283 283 PS_ERRORTEXT_psImage_IMAGE_NULL); … … 285 285 return NULL; 286 286 } 287 psS32 numCols = in ->numCols;288 psS32 numRows = in ->numRows;287 psS32 numCols = input->numCols; 288 psS32 numRows = input->numRows; 289 289 290 290 if (nSamples < 2) { … … 352 352 } 353 353 354 out = psVectorRecycle(out, nSamples, in ->type.type);354 out = psVectorRecycle(out, nSamples, input->type.type); 355 355 356 356 float dX = (endCol - startCol) / (float)(nSamples-1); … … 370 370 cutRowsData[i] = y; \ 371 371 } \ 372 outData[i] = psImagePixelInterpolate(in ,x,y,mask,maskVal,0,mode); \372 outData[i] = psImagePixelInterpolate(input,x,y,mask,maskVal,0,mode); \ 373 373 } \ 374 374 } \ … … 376 376 377 377 378 switch (in ->type.type) {378 switch (input->type.type) { 379 379 LINEAR_CUT_CASE(U8); 380 380 LINEAR_CUT_CASE(U16); … … 392 392 default: { 393 393 char* typeStr; 394 PS_TYPE_NAME(typeStr,in ->type.type);394 PS_TYPE_NAME(typeStr,input->type.type); 395 395 psError(PS_ERR_BAD_PARAMETER_TYPE, true, 396 396 PS_ERRORTEXT_psImage_IMAGE_TYPE_UNSUPPORTED, … … 405 405 406 406 psVector* psImageRadialCut(psVector* out, 407 const psImage* in ,407 const psImage* input, 408 408 const psImage* restrict mask, 409 409 psU32 maskVal, 410 float centerCol,411 float centerRow,410 float x, 411 float y, 412 412 const psVector* radii, 413 413 const psStats* stats) … … 417 417 /* check the parameters */ 418 418 419 if (in == NULL || in->data.V == NULL) {419 if (input == NULL || input->data.V == NULL) { 420 420 psError(PS_ERR_BAD_PARAMETER_NULL, true, 421 421 PS_ERRORTEXT_psImage_IMAGE_NULL); … … 423 423 return NULL; 424 424 } 425 psS32 numCols = in ->numCols;426 psS32 numRows = in ->numRows;425 psS32 numCols = input->numCols; 426 psS32 numRows = input->numRows; 427 427 428 428 if (mask != NULL) { … … 446 446 } 447 447 448 if ( centerCol < 0 || centerCol>= numCols ||449 centerRow < 0 || centerRow>= numRows) {448 if (x < 0 || x >= numCols || 449 y < 0 || y >= numRows) { 450 450 psError(PS_ERR_BAD_PARAMETER_VALUE, true, 451 451 PS_ERRORTEXT_psImage_CENTER_NOT_IN_IMAGE, 452 centerCol, centerRow,452 x, y, 453 453 numCols-1, numRows-1); 454 454 psFree(out); … … 498 498 psF32* rSq = rSqVec->data.F32; 499 499 500 psS32 startRow = centerRow- rSq[numOut];501 psS32 endRow = centerRow+ rSq[numOut];502 psS32 startCol = centerCol- rSq[numOut];503 psS32 endCol = centerCol+ rSq[numOut];500 psS32 startRow = y - rSq[numOut]; 501 psS32 endRow = y + rSq[numOut]; 502 psS32 startCol = x - rSq[numOut]; 503 psS32 endCol = x + rSq[numOut]; 504 504 505 505 if (startRow < 0) { … … 531 531 // than the area of the region of interest. 532 532 buffer[lcv] = psVectorAlloc(1+4*(rSq[lcv+1]-rSq[lcv]), 533 in ->type.type);533 input->type.type); 534 534 buffer[lcv]->n = 0; 535 535 … … 546 546 float dist; 547 547 for (psS32 row=startRow; row <= endRow; row++) { 548 psF32* inRow = in ->data.F32[row];548 psF32* inRow = input->data.F32[row]; 549 549 psMaskType* maskRow = NULL; 550 550 if (mask != NULL) { … … 552 552 } 553 553 for (psS32 col=startCol; col <= endCol; col++) { 554 dX = centerCol- (float)col - 0.5f;555 dY = centerRow- (float)row - 0.5f;554 dX = x - (float)col - 0.5f; 555 dY = y - (float)row - 0.5f; 556 556 dist = dX*dX+dY*dY; 557 557 for (psS32 r = 0; r < numOut; r++) { -
trunk/psLib/src/image/psImagePixelExtract.h
r4206 r4367 8 8 * @author Robert DeSonia, MHPCC 9 9 * 10 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $11 * @date $Date: 2005-06- 10 02:30:47$10 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2005-06-23 03:50:29 $ 12 12 * 13 13 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 58 58 psVector* psImageSlice( 59 59 psVector* out, ///< psVector to recycle, or NULL. 60 psVector* slicePositions,60 psVector* coords, 61 61 ///< If not NULL, it is populated with the coordinate in the slice dimension 62 62 ///< coorsponding to the output vector's value of the same position in the … … 94 94 psU32 maskVal, ///< the mask value to apply to the mask 95 95 psRegion region, ///< the start and end points to cut along 96 psU32 nSamples,///< the number of samples along the cut96 unsigned int nSamples, ///< the number of samples along the cut 97 97 psImageInterpolateMode mode ///< the interpolation method to use 98 98 ); … … 116 116 const psImage* mask, ///< the mask for the input image. 117 117 psU32 maskVal, ///< the mask value to apply to the mask 118 float centerCol,///< the column of the center of the cut circle119 float centerRow,///< the row of the center of the cut circle118 float x, ///< the column of the center of the cut circle 119 float y, ///< the row of the center of the cut circle 120 120 const psVector* radii, ///< the radii of the cut circle 121 121 const psStats* stats ///< the statistic to perform in operation -
trunk/psLib/src/image/psImagePixelManip.c
r4315 r4367 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1. 2$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-06- 18 02:30:49 $12 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-06-23 03:50:29 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 311 311 312 312 int psImageClipComplexRegion(psImage* input, 313 psC64min,314 psC64vmin,315 psC64max,316 psC64vmax)313 _Complex min, 314 _Complex vmin, 315 _Complex max, 316 _Complex vmax) 317 317 { 318 318 psS32 numClipped = 0; -
trunk/psLib/src/image/psImagePixelManip.h
r4330 r4367 8 8 * @author Robert DeSonia, MHPCC 9 9 * 10 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $11 * @date $Date: 2005-06-2 1 03:01:37$10 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2005-06-23 03:50:29 $ 12 12 * 13 13 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 47 47 * This function is defined for psC32, and psC64 imagery only. 48 48 * 49 * @return psS32The number of clipped pixels49 * @return int The number of clipped pixels 50 50 */ 51 51 int psImageClipComplexRegion( 52 52 psImage* input, ///< the image to clip 53 psC64 min,///< the minimum image value allowed54 psC64 vmin,///< the value pixels < min are set to55 psC64 max,///< the maximum image value allowed56 psC64 vmax///< the value pixels > max are set to53 _Complex min, ///< the minimum image value allowed 54 _Complex vmin, ///< the value pixels < min are set to 55 _Complex max, ///< the maximum image value allowed 56 _Complex vmax ///< the value pixels > max are set to 57 57 ); 58 58 -
trunk/psLib/src/imageops/psImageGeomManip.c
r4316 r4367 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1. 9$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-06- 18 03:13:02$12 * @version $Revision: 1.10 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-06-23 03:50:29 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 36 36 const psImage* restrict mask, 37 37 psMaskType maskVal, 38 psU32scale,38 int scale, 39 39 const psStats* stats) 40 40 { … … 303 303 304 304 psImage* psImageRotate(psImage* out, 305 const psImage* in ,305 const psImage* input, 306 306 float angle, 307 psC64 unexposedValue,307 _Complex exposed, 308 308 psImageInterpolateMode mode) 309 309 { 310 if (in == NULL) {310 if (input == NULL) { 311 311 psError(PS_ERR_BAD_PARAMETER_NULL, true, 312 312 PS_ERRORTEXT_psImage_IMAGE_NULL); … … 319 319 if (fabsf(angle - M_PI_2) < FLT_EPSILON) { 320 320 // perform 1/4 rotate counter-clockwise 321 psS32 numRows = in ->numCols;322 psS32 numCols = in ->numRows;321 psS32 numRows = input->numCols; 322 psS32 numCols = input->numRows; 323 323 psS32 lastCol = numCols - 1; 324 psElemType type = in ->type.type;324 psElemType type = input->type.type; 325 325 326 326 out = psImageRecycle(out, numCols, numRows, type); … … 328 328 #define PSIMAGE_ROTATE_LEFT_90(TYPE) \ 329 329 case PS_TYPE_##TYPE: { \ 330 ps##TYPE** inData = in ->data.TYPE; \330 ps##TYPE** inData = input->data.TYPE; \ 331 331 for (psS32 row=0;row<numRows;row++) { \ 332 332 ps##TYPE* outRow = out->data.TYPE[row]; \ … … 364 364 } else if (fabsf(angle - M_PI) < FLT_EPSILON) { 365 365 // perform 1/2 rotate 366 psS32 numRows = in ->numRows;366 psS32 numRows = input->numRows; 367 367 psS32 lastRow = numRows - 1; 368 psS32 numCols = in ->numCols;368 psS32 numCols = input->numCols; 369 369 psS32 lastCol = numCols - 1; 370 psElemType type = in ->type.type;370 psElemType type = input->type.type; 371 371 372 372 out = psImageRecycle(out, numCols, numRows, type); … … 376 376 for (psS32 row=0;row<numRows;row++) { \ 377 377 ps##TYPE* outRow = out->data.TYPE[row]; \ 378 ps##TYPE* inRow = in ->data.TYPE[lastRow-row]; \378 ps##TYPE* inRow = input->data.TYPE[lastRow-row]; \ 379 379 for (psS32 col=0;col<numCols;col++) { \ 380 380 outRow[col] = inRow[lastCol - col]; \ … … 410 410 } else if (fabsf(angle - (M_PI+M_PI_2)) < FLT_EPSILON) { 411 411 // perform 1/4 rotate clockwise 412 psS32 numRows = in ->numCols;412 psS32 numRows = input->numCols; 413 413 psS32 lastRow = numRows - 1; 414 psS32 numCols = in ->numRows;415 psElemType type = in ->type.type;414 psS32 numCols = input->numRows; 415 psElemType type = input->type.type; 416 416 417 417 out = psImageRecycle(out, numCols, numRows, type); … … 419 419 #define PSIMAGE_ROTATE_RIGHT_90(TYPE) \ 420 420 case PS_TYPE_##TYPE: { \ 421 ps##TYPE** inData = in ->data.TYPE; \421 ps##TYPE** inData = input->data.TYPE; \ 422 422 for (psS32 row=0;row<numRows;row++) { \ 423 423 ps##TYPE* outRow = out->data.TYPE[row]; \ … … 454 454 } 455 455 } else if (fabsf(angle) < FLT_EPSILON) { 456 out = psImageCopy(out, in , in->type.type);456 out = psImageCopy(out, input, input->type.type); 457 457 } else { 458 psElemType type = in ->type.type;459 psS32 numRows = in ->numRows;460 psS32 numCols = in ->numCols;458 psElemType type = input->type.type; 459 psS32 numRows = input->numRows; 460 psS32 numCols = input->numCols; 461 461 float centerX = (float)(numCols) / 2.0f; 462 462 float centerY = (float)(numRows) / 2.0f; … … 497 497 498 498 #define PSIMAGE_ROTATE_ARBITRARY_LOOP(TYPE,MODE) { \ 499 if (creal( unexposedValue) < PS_MIN_##TYPE || \500 creal( unexposedValue) > PS_MAX_##TYPE || \501 cimag( unexposedValue) < PS_MIN_##TYPE || \502 cimag( unexposedValue) > PS_MAX_##TYPE) { \499 if (creal(exposed) < PS_MIN_##TYPE || \ 500 creal(exposed) > PS_MAX_##TYPE || \ 501 cimag(exposed) < PS_MIN_##TYPE || \ 502 cimag(exposed) > PS_MAX_##TYPE) { \ 503 503 psError(PS_ERR_BAD_PARAMETER_VALUE, true, \ 504 504 PS_ERRORTEXT_psImageManip_CLIP_VALUE_INVALID, \ 505 " unexposedValue", \506 creal( unexposedValue),cimag(unexposedValue), \505 "exposed", \ 506 creal(exposed),cimag(exposed), \ 507 507 PS_TYPE_##TYPE##_NAME, \ 508 508 (double)PS_MIN_##TYPE,(double)PS_MAX_##TYPE); \ … … 519 519 outRow = out->data.TYPE[y]; \ 520 520 for (psS32 x = 0; x < outCols; x++) { \ 521 outRow[x] = p_psImagePixelInterpolate##MODE##_##TYPE(in ,inX,inY,NULL,0,unexposedValue); \521 outRow[x] = p_psImagePixelInterpolate##MODE##_##TYPE(input,inX,inY,NULL,0,exposed); \ 522 522 inX += cosT; \ 523 523 inY -= sinT; \ … … 594 594 595 595 psImage* psImageShift(psImage* out, 596 const psImage* in ,596 const psImage* input, 597 597 float dx, 598 598 float dy, 599 psC64 unexposedValue,599 _Complex exposed, 600 600 psImageInterpolateMode mode) 601 601 { … … 605 605 psElemType type; 606 606 607 if (in == NULL) {607 if (input == NULL) { 608 608 psError(PS_ERR_BAD_PARAMETER_NULL, true, 609 609 PS_ERRORTEXT_psImage_IMAGE_NULL); … … 613 613 // create an output image of the same size 614 614 // and type 615 outRows = in ->numRows;616 outCols = in ->numCols;617 type = in ->type.type;615 outRows = input->numRows; 616 outCols = input->numCols; 617 type = input->type.type; 618 618 elementSize = PSELEMTYPE_SIZEOF(type); 619 619 out = psImageRecycle(out, outCols, outRows, type); … … 621 621 #define PSIMAGE_SHIFT_CASE(MODE,TYPE) \ 622 622 case PS_TYPE_##TYPE: \ 623 if (creal( unexposedValue) < PS_MIN_##TYPE || \624 creal( unexposedValue) > PS_MAX_##TYPE || \625 cimag( unexposedValue) < PS_MIN_##TYPE || \626 cimag( unexposedValue) > PS_MAX_##TYPE) { \623 if (creal(exposed) < PS_MIN_##TYPE || \ 624 creal(exposed) > PS_MAX_##TYPE || \ 625 cimag(exposed) < PS_MIN_##TYPE || \ 626 cimag(exposed) > PS_MAX_##TYPE) { \ 627 627 psError(PS_ERR_BAD_PARAMETER_VALUE, true, \ 628 628 PS_ERRORTEXT_psImageManip_CLIP_VALUE_INVALID, \ 629 " unexposedValue", \630 creal( unexposedValue),cimag(unexposedValue), \629 "exposed", \ 630 creal(exposed),cimag(exposed), \ 631 631 PS_TYPE_##TYPE##_NAME, \ 632 632 (double)PS_MIN_##TYPE,(double)PS_MAX_##TYPE); \ … … 640 640 for (psS32 col=0;col<outCols;col++) { \ 641 641 outRow[col] = p_psImagePixelInterpolate##MODE##_##TYPE( \ 642 in ,dx+(float)col,y,NULL,0,unexposedValue); \642 input,dx+(float)col,y,NULL,0,exposed); \ 643 643 } \ 644 644 } \ … … 647 647 #define PSIMAGE_SHIFT_ARBITRARY_CASE(MODE) \ 648 648 case PS_INTERPOLATE_##MODE: \ 649 switch (in ->type.type) { \649 switch (input->type.type) { \ 650 650 PSIMAGE_SHIFT_CASE(MODE,U8); \ 651 651 PSIMAGE_SHIFT_CASE(MODE,U16); \ … … 694 694 int inputMaskVal, 695 695 const psPlaneTransform *outToIn, 696 constpsRegion region,696 psRegion region, 697 697 const psPixels* pixels, 698 698 psImageInterpolateMode mode, 699 intexposedValue)699 double exposedValue) 700 700 { 701 701 if (input == NULL) { -
trunk/psLib/src/imageops/psImageGeomManip.h
r4316 r4367 8 8 * @author Robert DeSonia, MHPCC 9 9 * 10 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $11 * @date $Date: 2005-06- 18 03:13:02$10 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2005-06-23 03:50:29 $ 12 12 * 13 13 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 39 39 const psImage* mask, ///< mask for input image. If NULL, no masking is done. 40 40 psMaskType maskVal, ///< the bits to check in mask. 41 psU32 scale,///< the scale to rebin for each dimension41 int scale, ///< the scale to rebin for each dimension 42 42 const psStats* stats 43 43 ///< the statistic to perform when rebinning. Only one method should be set. … … 75 75 psImage* psImageRotate( 76 76 psImage* out, ///< an psImage to recycle. If NULL, a new image is created 77 const psImage* in ,///< input image77 const psImage* input, ///< input image 78 78 float angle, ///< the rotation angle in radians. 79 psC64 unexposedValue,///< the output image pixel values for non-imagery areas79 _Complex exposed, ///< the output image pixel values for non-imagery areas 80 80 psImageInterpolateMode mode ///< the interpolation mode used 81 81 ); … … 94 94 psImage* psImageShift( 95 95 psImage* out, ///< an psImage to recycle. If NULL, a new image is created 96 const psImage* in ,///< input image96 const psImage* input, ///< input image 97 97 float dx, ///< the shift in x direction. 98 98 float dy, ///< the shift in y direction. 99 psC64 unexposedValue,///< the output image pixel values for non-imagery areas99 _Complex exposed, ///< the output image pixel values for non-imagery areas 100 100 psImageInterpolateMode mode ///< the interpolation mode to use 101 101 ); … … 149 149 int inputMaskVal, ///< masking value for inputMask 150 150 const psPlaneTransform *outToIn, ///< the transform to apply 151 const psRegion region,///< the size of the transformed image151 psRegion region, ///< the size of the transformed image 152 152 const psPixels* pixels, /**< if not NULL, consists of psPixelCoords and specifies which pixels in 153 * output image shall be transformed; otherwise, entire image generated*/153 * output image shall be transformed; otherwise, entire image generated*/ 154 154 psImageInterpolateMode mode, ///< the interpolation scheme to be used 155 intexposedValue ///< Exposed value to which non-corresponding pixels are set155 double exposedValue ///< Exposed value to which non-corresponding pixels are set 156 156 ); 157 157 -
trunk/psLib/src/imageops/psImagePixelExtract.c
r4206 r4367 8 8 * @author Robert DeSonia, MHPCC 9 9 * 10 * @version $Revision: 1. 2$ $Name: not supported by cvs2svn $11 * @date $Date: 2005-06- 10 02:30:47$10 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2005-06-23 03:50:29 $ 12 12 * 13 13 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 24 24 25 25 psVector* psImageSlice(psVector* out, 26 psVector* slicePositions,27 const psImage* restrict in ,26 psVector* coords, 27 const psImage* restrict input, 28 28 const psImage* restrict mask, 29 29 psU32 maskVal, … … 44 44 psS32 col1 = region.x1; 45 45 46 if (in == NULL || in->data.V == NULL) {46 if (input == NULL || input->data.V == NULL) { 47 47 psError(PS_ERR_BAD_PARAMETER_NULL, true, 48 48 PS_ERRORTEXT_psImage_IMAGE_NULL); … … 52 52 53 53 if (col1 < 1) { 54 col1 += in ->numCols;54 col1 += input->numCols; 55 55 } 56 56 57 57 if (row1 < 1) { 58 row1 += in ->numRows;58 row1 += input->numRows; 59 59 } 60 60 61 61 if ( col0 < 0 || 62 62 row0 < 0 || 63 col1 > in ->numCols ||64 row1 > in ->numRows ||63 col1 > input->numCols || 64 row1 > input->numRows || 65 65 col0 >= col1 || 66 66 row0 >= row1) { … … 68 68 PS_ERRORTEXT_psImage_SUBSET_RANGE_INVALID, 69 69 col0, col1, row0, row1, 70 in ->numCols, in->numRows);71 psFree(out); 72 return NULL; 73 } 74 75 type = in ->type.type;76 inRows = in ->numRows;77 inCols = in ->numCols;70 input->numCols, input->numRows); 71 psFree(out); 72 return NULL; 73 } 74 75 type = input->type.type; 76 inRows = input->numRows; 77 inCols = input->numCols; 78 78 79 79 if (direction == PS_CUT_X_NEG || direction == PS_CUT_Y_NEG) { … … 134 134 // psStats. 135 135 out = psVectorRecycle(out, numCols, PS_TYPE_F64); 136 if ( slicePositions != NULL) {137 slicePositions = psVectorRecycle(slicePositions, numCols, PS_TYPE_U32);138 outPosition = slicePositions->data.U32;136 if (coords != NULL) { 137 coords = psVectorRecycle(coords, numCols, PS_TYPE_U32); 138 outPosition = coords->data.U32; 139 139 } 140 140 outData = out->data.F64; … … 153 153 psMaskType* maskVecData = NULL; \ 154 154 for (psS32 c=col0;c<col1;c++) { \ 155 ps##TYPE *imgData = in ->data.TYPE[row0] + c; \155 ps##TYPE *imgData = input->data.TYPE[row0] + c; \ 156 156 ps##TYPE *imgVecData = imgVec->data.TYPE; \ 157 157 if (maskVec != NULL) { \ … … 213 213 // fill in psVector to fake out the statistics functions. 214 214 imgVec = psAlloc(sizeof(psVector)); 215 imgVec->type = in ->type;215 imgVec->type = input->type; 216 216 imgVec->n = *(int*)&imgVec->nalloc = numCols; 217 217 if (mask != NULL) { … … 224 224 // psStats. 225 225 out = psVectorRecycle(out, numRows, PS_TYPE_F64); 226 if ( slicePositions != NULL) {227 slicePositions = psVectorRecycle(slicePositions, numRows, PS_TYPE_U32);228 outPosition = slicePositions->data.U32;226 if (coords != NULL) { 227 coords = psVectorRecycle(coords, numRows, PS_TYPE_U32); 228 outPosition = coords->data.U32; 229 229 } 230 230 outData = out->data.F64; … … 239 239 // point the vector struct to the 240 240 // data to calculate the stats 241 imgVec->data.U8 = (psPtr )(in ->data.U8[r] + col0 * elementSize);241 imgVec->data.U8 = (psPtr )(input->data.U8[r] + col0 * elementSize); 242 242 if (maskVec != NULL) { 243 243 maskVec->data.U8 = (psPtr )(mask->data.U8[r] + col0 * sizeof(psMaskType)); … … 271 271 psVector* cutCols, 272 272 psVector* cutRows, 273 const psImage* in ,273 const psImage* input, 274 274 const psImage* mask, 275 275 psU32 maskVal, 276 276 psRegion region, 277 psU32nSamples,277 unsigned int nSamples, 278 278 psImageInterpolateMode mode) 279 279 { 280 280 281 if (in == NULL || in->data.V == NULL) {281 if (input == NULL || input->data.V == NULL) { 282 282 psError(PS_ERR_BAD_PARAMETER_NULL, true, 283 283 PS_ERRORTEXT_psImage_IMAGE_NULL); … … 285 285 return NULL; 286 286 } 287 psS32 numCols = in ->numCols;288 psS32 numRows = in ->numRows;287 psS32 numCols = input->numCols; 288 psS32 numRows = input->numRows; 289 289 290 290 if (nSamples < 2) { … … 352 352 } 353 353 354 out = psVectorRecycle(out, nSamples, in ->type.type);354 out = psVectorRecycle(out, nSamples, input->type.type); 355 355 356 356 float dX = (endCol - startCol) / (float)(nSamples-1); … … 370 370 cutRowsData[i] = y; \ 371 371 } \ 372 outData[i] = psImagePixelInterpolate(in ,x,y,mask,maskVal,0,mode); \372 outData[i] = psImagePixelInterpolate(input,x,y,mask,maskVal,0,mode); \ 373 373 } \ 374 374 } \ … … 376 376 377 377 378 switch (in ->type.type) {378 switch (input->type.type) { 379 379 LINEAR_CUT_CASE(U8); 380 380 LINEAR_CUT_CASE(U16); … … 392 392 default: { 393 393 char* typeStr; 394 PS_TYPE_NAME(typeStr,in ->type.type);394 PS_TYPE_NAME(typeStr,input->type.type); 395 395 psError(PS_ERR_BAD_PARAMETER_TYPE, true, 396 396 PS_ERRORTEXT_psImage_IMAGE_TYPE_UNSUPPORTED, … … 405 405 406 406 psVector* psImageRadialCut(psVector* out, 407 const psImage* in ,407 const psImage* input, 408 408 const psImage* restrict mask, 409 409 psU32 maskVal, 410 float centerCol,411 float centerRow,410 float x, 411 float y, 412 412 const psVector* radii, 413 413 const psStats* stats) … … 417 417 /* check the parameters */ 418 418 419 if (in == NULL || in->data.V == NULL) {419 if (input == NULL || input->data.V == NULL) { 420 420 psError(PS_ERR_BAD_PARAMETER_NULL, true, 421 421 PS_ERRORTEXT_psImage_IMAGE_NULL); … … 423 423 return NULL; 424 424 } 425 psS32 numCols = in ->numCols;426 psS32 numRows = in ->numRows;425 psS32 numCols = input->numCols; 426 psS32 numRows = input->numRows; 427 427 428 428 if (mask != NULL) { … … 446 446 } 447 447 448 if ( centerCol < 0 || centerCol>= numCols ||449 centerRow < 0 || centerRow>= numRows) {448 if (x < 0 || x >= numCols || 449 y < 0 || y >= numRows) { 450 450 psError(PS_ERR_BAD_PARAMETER_VALUE, true, 451 451 PS_ERRORTEXT_psImage_CENTER_NOT_IN_IMAGE, 452 centerCol, centerRow,452 x, y, 453 453 numCols-1, numRows-1); 454 454 psFree(out); … … 498 498 psF32* rSq = rSqVec->data.F32; 499 499 500 psS32 startRow = centerRow- rSq[numOut];501 psS32 endRow = centerRow+ rSq[numOut];502 psS32 startCol = centerCol- rSq[numOut];503 psS32 endCol = centerCol+ rSq[numOut];500 psS32 startRow = y - rSq[numOut]; 501 psS32 endRow = y + rSq[numOut]; 502 psS32 startCol = x - rSq[numOut]; 503 psS32 endCol = x + rSq[numOut]; 504 504 505 505 if (startRow < 0) { … … 531 531 // than the area of the region of interest. 532 532 buffer[lcv] = psVectorAlloc(1+4*(rSq[lcv+1]-rSq[lcv]), 533 in ->type.type);533 input->type.type); 534 534 buffer[lcv]->n = 0; 535 535 … … 546 546 float dist; 547 547 for (psS32 row=startRow; row <= endRow; row++) { 548 psF32* inRow = in ->data.F32[row];548 psF32* inRow = input->data.F32[row]; 549 549 psMaskType* maskRow = NULL; 550 550 if (mask != NULL) { … … 552 552 } 553 553 for (psS32 col=startCol; col <= endCol; col++) { 554 dX = centerCol- (float)col - 0.5f;555 dY = centerRow- (float)row - 0.5f;554 dX = x - (float)col - 0.5f; 555 dY = y - (float)row - 0.5f; 556 556 dist = dX*dX+dY*dY; 557 557 for (psS32 r = 0; r < numOut; r++) { -
trunk/psLib/src/imageops/psImagePixelExtract.h
r4206 r4367 8 8 * @author Robert DeSonia, MHPCC 9 9 * 10 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $11 * @date $Date: 2005-06- 10 02:30:47$10 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2005-06-23 03:50:29 $ 12 12 * 13 13 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 58 58 psVector* psImageSlice( 59 59 psVector* out, ///< psVector to recycle, or NULL. 60 psVector* slicePositions,60 psVector* coords, 61 61 ///< If not NULL, it is populated with the coordinate in the slice dimension 62 62 ///< coorsponding to the output vector's value of the same position in the … … 94 94 psU32 maskVal, ///< the mask value to apply to the mask 95 95 psRegion region, ///< the start and end points to cut along 96 psU32 nSamples,///< the number of samples along the cut96 unsigned int nSamples, ///< the number of samples along the cut 97 97 psImageInterpolateMode mode ///< the interpolation method to use 98 98 ); … … 116 116 const psImage* mask, ///< the mask for the input image. 117 117 psU32 maskVal, ///< the mask value to apply to the mask 118 float centerCol,///< the column of the center of the cut circle119 float centerRow,///< the row of the center of the cut circle118 float x, ///< the column of the center of the cut circle 119 float y, ///< the row of the center of the cut circle 120 120 const psVector* radii, ///< the radii of the cut circle 121 121 const psStats* stats ///< the statistic to perform in operation -
trunk/psLib/src/imageops/psImagePixelManip.c
r4315 r4367 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1. 2$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-06- 18 02:30:49 $12 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-06-23 03:50:29 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 311 311 312 312 int psImageClipComplexRegion(psImage* input, 313 psC64min,314 psC64vmin,315 psC64max,316 psC64vmax)313 _Complex min, 314 _Complex vmin, 315 _Complex max, 316 _Complex vmax) 317 317 { 318 318 psS32 numClipped = 0; -
trunk/psLib/src/imageops/psImagePixelManip.h
r4330 r4367 8 8 * @author Robert DeSonia, MHPCC 9 9 * 10 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $11 * @date $Date: 2005-06-2 1 03:01:37$10 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2005-06-23 03:50:29 $ 12 12 * 13 13 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 47 47 * This function is defined for psC32, and psC64 imagery only. 48 48 * 49 * @return psS32The number of clipped pixels49 * @return int The number of clipped pixels 50 50 */ 51 51 int psImageClipComplexRegion( 52 52 psImage* input, ///< the image to clip 53 psC64 min,///< the minimum image value allowed54 psC64 vmin,///< the value pixels < min are set to55 psC64 max,///< the maximum image value allowed56 psC64 vmax///< the value pixels > max are set to53 _Complex min, ///< the minimum image value allowed 54 _Complex vmin, ///< the value pixels < min are set to 55 _Complex max, ///< the maximum image value allowed 56 _Complex vmax ///< the value pixels > max are set to 57 57 ); 58 58 -
trunk/psLib/src/math/psCompare.h
r4162 r4367 6 6 * @ingroup Compare 7 7 * 8 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $9 * @date $Date: 2005-06- 08 23:40:45$8 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2005-06-23 03:50:29 $ 10 10 * 11 11 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 28 28 * than, equal to, or greater than the second. 29 29 */ 30 typedef int (*psComparePtrF cn) (30 typedef int (*psComparePtrFunc) ( 31 31 const void **a, ///< first comparison target 32 32 const void **b ///< second comparison target -
trunk/psLib/src/sys/psLogMsg.c
r4321 r4367 12 12 * @author GLG, MHPCC 13 13 * 14 * @version $Revision: 1.4 6$ $Name: not supported by cvs2svn $15 * @date $Date: 2005-06-2 0 22:42:30$14 * @version $Revision: 1.47 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2005-06-23 03:50:29 $ 16 16 * 17 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 87 87 An psBool: TRUE if successful. 88 88 *****************************************************************************/ 89 psBool psLogSetDestination(const char *dest)89 bool psLogSetDestination(const char *dest) 90 90 { 91 91 char protocol[5]; … … 163 163 NULL. 164 164 *****************************************************************************/ 165 void psLogSetFormat(const char *f mt)165 void psLogSetFormat(const char *format) 166 166 { 167 167 // assume none. … … 173 173 174 174 // if fmt is NULL, no logging is desired. 175 if (f mt == NULL) {175 if (format == NULL) { 176 176 return; 177 177 } 178 178 179 179 // XXX: What is the purpose of this conditional. 180 if (strlen(f mt) == 0) {181 f mt = "THLNM";180 if (strlen(format) == 0) { 181 format = "THLNM"; 182 182 } 183 183 // Step through each character in the format string. For each letter 184 184 // in that string, set the appropriate logging. 185 185 186 for (const char *ptr = f mt; *ptr != '\0'; ptr++) {186 for (const char *ptr = format; *ptr != '\0'; ptr++) { 187 187 switch (*ptr) { 188 188 case 'H': … … 215 215 // XXX: If one must at least log error messages, why don't we set logMsg = true here? 216 216 if (!logMsg) { 217 psTrace("utils.logMsg", 1, "You must at least log error messages (You chose \"%s\")", f mt);217 psTrace("utils.logMsg", 1, "You must at least log error messages (You chose \"%s\")", format); 218 218 } 219 219 } -
trunk/psLib/src/sys/psLogMsg.h
r4330 r4367 11 11 * @author GLG, MHPCC 12 12 * 13 * @version $Revision: 1.2 7$ $Name: not supported by cvs2svn $14 * @date $Date: 2005-06-2 1 03:01:37$13 * @version $Revision: 1.28 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2005-06-23 03:50:29 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 30 30 * argument which can specify general log destinations. 31 31 * 32 * @return psS32true if set successfully, otherwise false.32 * @return bool true if set successfully, otherwise false. 33 33 */ 34 psBool psLogSetDestination(34 bool psLogSetDestination( 35 35 const char *dest ///< Specifies where to send messages. 36 36 ); … … 56 56 */ 57 57 void psLogSetFormat( 58 const char *f mt///< Specifies the system log format58 const char *format ///< Specifies the system log format 59 59 ); 60 60 -
trunk/psLib/src/sysUtils/psLogMsg.c
r4321 r4367 12 12 * @author GLG, MHPCC 13 13 * 14 * @version $Revision: 1.4 6$ $Name: not supported by cvs2svn $15 * @date $Date: 2005-06-2 0 22:42:30$14 * @version $Revision: 1.47 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2005-06-23 03:50:29 $ 16 16 * 17 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 87 87 An psBool: TRUE if successful. 88 88 *****************************************************************************/ 89 psBool psLogSetDestination(const char *dest)89 bool psLogSetDestination(const char *dest) 90 90 { 91 91 char protocol[5]; … … 163 163 NULL. 164 164 *****************************************************************************/ 165 void psLogSetFormat(const char *f mt)165 void psLogSetFormat(const char *format) 166 166 { 167 167 // assume none. … … 173 173 174 174 // if fmt is NULL, no logging is desired. 175 if (f mt == NULL) {175 if (format == NULL) { 176 176 return; 177 177 } 178 178 179 179 // XXX: What is the purpose of this conditional. 180 if (strlen(f mt) == 0) {181 f mt = "THLNM";180 if (strlen(format) == 0) { 181 format = "THLNM"; 182 182 } 183 183 // Step through each character in the format string. For each letter 184 184 // in that string, set the appropriate logging. 185 185 186 for (const char *ptr = f mt; *ptr != '\0'; ptr++) {186 for (const char *ptr = format; *ptr != '\0'; ptr++) { 187 187 switch (*ptr) { 188 188 case 'H': … … 215 215 // XXX: If one must at least log error messages, why don't we set logMsg = true here? 216 216 if (!logMsg) { 217 psTrace("utils.logMsg", 1, "You must at least log error messages (You chose \"%s\")", f mt);217 psTrace("utils.logMsg", 1, "You must at least log error messages (You chose \"%s\")", format); 218 218 } 219 219 } -
trunk/psLib/src/sysUtils/psLogMsg.h
r4330 r4367 11 11 * @author GLG, MHPCC 12 12 * 13 * @version $Revision: 1.2 7$ $Name: not supported by cvs2svn $14 * @date $Date: 2005-06-2 1 03:01:37$13 * @version $Revision: 1.28 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2005-06-23 03:50:29 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 30 30 * argument which can specify general log destinations. 31 31 * 32 * @return psS32true if set successfully, otherwise false.32 * @return bool true if set successfully, otherwise false. 33 33 */ 34 psBool psLogSetDestination(34 bool psLogSetDestination( 35 35 const char *dest ///< Specifies where to send messages. 36 36 ); … … 56 56 */ 57 57 void psLogSetFormat( 58 const char *f mt///< Specifies the system log format58 const char *format ///< Specifies the system log format 59 59 ); 60 60 -
trunk/psLib/src/types/psArray.c
r4342 r4367 9 9 * @author Ross Harman, MHPCC 10 10 * 11 * @version $Revision: 1.3 0$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-06-2 2 02:05:41$11 * @version $Revision: 1.31 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-06-23 03:50:29 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 147 147 } 148 148 149 psArray* psArraySort(psArray* array, psComparePtrF cnfunc)149 psArray* psArraySort(psArray* array, psComparePtrFunc func) 150 150 { 151 151 if (array == NULL) { -
trunk/psLib/src/types/psArray.h
r4342 r4367 12 12 * @author Ross Harman, MHPCC 13 13 * 14 * @version $Revision: 1.2 6$ $Name: not supported by cvs2svn $15 * @date $Date: 2005-06-2 2 02:05:41$14 * @version $Revision: 1.27 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2005-06-23 03:50:29 $ 16 16 * 17 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 123 123 psArray* psArraySort( 124 124 psArray* array, ///< input array to sort. 125 psComparePtrF cn func///< the compare function125 psComparePtrFunc func ///< the compare function 126 126 ); 127 127 -
trunk/psLib/src/types/psList.c
r4316 r4367 6 6 * @author Robert Daniel DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1.3 7$ $Name: not supported by cvs2svn $9 * @date $Date: 2005-06- 18 03:13:01$8 * @version $Revision: 1.38 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2005-06-23 03:50:29 $ 10 10 * 11 11 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 610 610 } 611 611 612 psList* psListSort(psList* list, psComparePtrF cn compare)612 psList* psListSort(psList* list, psComparePtrFunc func) 613 613 { 614 614 psArray* arr; … … 622 622 psFree(list); 623 623 624 arr = psArraySort(arr, compare);624 arr = psArraySort(arr, func); 625 625 626 626 // convert back to linked list -
trunk/psLib/src/types/psList.h
r4330 r4367 7 7 * @ingroup LinkedList 8 8 * 9 * @version $Revision: 1.2 7$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-06-2 1 03:01:37$9 * @version $Revision: 1.28 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-06-23 03:50:29 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 99 99 psListIterator* psListIteratorAlloc( 100 100 psList* list, ///< the psList to iterate with 101 long location, ///< the initial starting point.101 long location, ///< the initial starting point. 102 102 ///< This can be a numeric index, PS_LIST_HEAD, or PS_LIST_TAIL. 103 103 bool mutable ///< Is it permissible to modify list? … … 221 221 psList* psListSort( 222 222 psList* list, ///< the list to sort 223 psComparePtrF cn compare///< the comparison function223 psComparePtrFunc func ///< the comparison function 224 224 ); 225 225
Note:
See TracChangeset
for help on using the changeset viewer.
