Changeset 9730 for trunk/psLib/src/imageops
- Timestamp:
- Oct 24, 2006, 12:55:05 PM (20 years ago)
- Location:
- trunk/psLib/src/imageops
- Files:
-
- 5 edited
-
psImageBackground.c (modified) (1 diff)
-
psImageConvolve.c (modified) (5 diffs)
-
psImageGeomManip.c (modified) (4 diffs)
-
psImagePixelExtract.c (modified) (5 diffs)
-
psImageStats.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/imageops/psImageBackground.c
r8978 r9730 36 36 int Npixels = nx*ny; // Total number of pixels 37 37 38 psVector *values = psVectorAlloc (Nsubset, PS_TYPE_F32); // Vector containing subsample38 psVector *values = psVectorAllocEmpty(Nsubset, PS_TYPE_F32); // Vector containing subsample 39 39 40 40 // Minimum and maximum values -
trunk/psLib/src/imageops/psImageConvolve.c
r9538 r9730 5 5 * @author Robert DeSonia, MHPCC 6 6 * 7 * @version $Revision: 1. 39$ $Name: not supported by cvs2svn $8 * @date $Date: 2006-10- 13 21:13:48$7 * @version $Revision: 1.40 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2006-10-24 22:52:55 $ 9 9 * 10 10 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 505 505 /* generate normalized gaussian */ \ 506 506 psVector *gaussnorm = psVectorAlloc(Npixel, PS_TYPE_##TYPE); \ 507 gaussnorm->n = gaussnorm->nalloc; \508 507 { \ 509 508 double sum = 0.0; \ … … 522 521 { \ 523 522 psVector *calculation = psVectorAlloc(Nx, PS_TYPE_##TYPE); \ 524 calculation->n = calculation->nalloc; \525 523 for (int j = 0; j < Ny; j++) { \ 526 524 ps##TYPE *vi = image->data.TYPE[j]; \ … … 573 571 /* Smooth in Y direction */ \ 574 572 psArray *rows = psArrayAlloc(Nrange); \ 575 rows->n = Nrange; \576 573 /* Smooth the first Nrange pixels, with renorm */ \ 577 574 int yMax = PS_MIN(Nrange, Ny); \ … … 579 576 for (int j = 0; j < yMax; j++) { \ 580 577 psVector *calculation = psVectorAlloc(Nx, PS_TYPE_##TYPE); \ 581 calculation->n = calculation->nalloc; \582 578 /* Zero the output row */ \ 583 579 memset(calculation->data.TYPE, 0, Nx*sizeof(ps##TYPE)); \ -
trunk/psLib/src/imageops/psImageGeomManip.c
r8232 r9730 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1.2 8$ $Name: not supported by cvs2svn $13 * @date $Date: 2006- 08-08 23:32:23$12 * @version $Revision: 1.29 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2006-10-24 22:52:55 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 80 80 } 81 81 82 vec = psVectorAlloc (scale * scale, in->type.type);82 vec = psVectorAllocEmpty(scale * scale, in->type.type); 83 83 84 84 if (mask != NULL) { … … 93 93 return NULL; 94 94 } 95 maskVec = psVectorAlloc(scale * scale, PS_TYPE_MASK); 96 maskVec->n = maskVec->nalloc; 95 maskVec = psVectorAllocEmpty(scale * scale, PS_TYPE_MASK); 97 96 maskData = maskVec->data.PS_TYPE_MASK_DATA; 98 97 } … … 134 133 } \ 135 134 vec->n = n; \ 135 maskVec->n = n; \ 136 136 myStats = psVectorStats(myStats, vec, NULL, maskVec, maskVal); \ 137 137 outRowData[col] = (ps##TYPE)psStatsGetValue(myStats, statistic); \ -
trunk/psLib/src/imageops/psImagePixelExtract.c
r8627 r9730 8 8 * @author Robert DeSonia, MHPCC 9 9 * 10 * @version $Revision: 1.2 7$ $Name: not supported by cvs2svn $11 * @date $Date: 2006- 08-26 04:34:28$10 * @version $Revision: 1.28 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2006-10-24 22:52:55 $ 12 12 * 13 13 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 18 18 19 19 #include "psMemory.h" 20 #include "psVector.h" 20 21 #include "psImagePixelExtract.h" 21 22 #include "psError.h" … … 392 393 if (direction == PS_CUT_X_POS || direction == PS_CUT_X_NEG) { 393 394 psVector* imgVec = psVectorAlloc(numRows, type); 394 imgVec->n = imgVec->nalloc;395 395 psVector* maskVec = NULL; 396 396 psMaskType* maskData = NULL; … … 417 417 if (mask != NULL) { 418 418 maskVec = psVectorAlloc(numRows, mask->type.type); 419 maskVec->n = maskVec->nalloc;420 419 } 421 420 #define PSIMAGE_CUT_VERTICAL(TYPE) \ … … 855 854 // n.b. alloc enough for the data by making the vectors slightly larger 856 855 // than the area of the region of interest. 857 buffer[lcv] = psVectorAlloc(1+4*(rSq[lcv+1]-rSq[lcv]), 858 input->type.type); 859 buffer[lcv]->n = 0; 856 buffer[lcv] = psVectorAllocEmpty(1+4*(rSq[lcv+1]-rSq[lcv]), 857 input->type.type); 860 858 861 859 bufferMask[lcv] = NULL; 862 860 if (mask != NULL) { 863 bufferMask[lcv] = psVectorAlloc(1+4*(rSq[lcv+1]-rSq[lcv]), 864 PS_TYPE_MASK); 865 bufferMask[lcv]->n = 0; 861 bufferMask[lcv] = psVectorAllocEmpty(1+4*(rSq[lcv+1]-rSq[lcv]), 862 PS_TYPE_MASK); 866 863 } 867 864 } -
trunk/psLib/src/imageops/psImageStats.c
r8627 r9730 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1.10 0$ $Name: not supported by cvs2svn $12 * @date $Date: 2006- 08-26 04:34:28$11 * @version $Revision: 1.101 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2006-10-24 22:52:55 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 76 76 77 77 junkData = psVectorAlloc(numRows*numCols, in->type.type); 78 junkData->n = junkData->nalloc;79 78 80 79 psU8* data = junkData->data.U8; … … 100 99 101 100 junkMask = psVectorAlloc(numRows*numCols, mask->type.type); 102 junkMask->n = junkMask->nalloc;103 101 104 102 psU8* data = junkMask->data.U8; … … 149 147 150 148 junkData = psVectorAlloc(numRows*numCols, in->type.type); 151 junkData->n = junkData->nalloc;152 149 153 150 psU8* data = junkData->data.U8; … … 173 170 174 171 junkMask = psVectorAlloc(numRows*numCols, mask->type.type); 175 junkMask->n = junkMask->nalloc;176 172 177 173 psU8* data = junkMask->data.U8; … … 592 588 return -1; 593 589 }/* else if (col0 == col1 && row0 == row1) { 594 psError(PS_ERR_BAD_PARAMETER_VALUE, true,595 "Invalid psRegion specified. Region contains only 1 pixel.\n");596 return -1;597 }598 */590 psError(PS_ERR_BAD_PARAMETER_VALUE, true, 591 "Invalid psRegion specified. Region contains only 1 pixel.\n"); 592 return -1; 593 } 594 */ 599 595 x0 = col0; 600 596 x1 = col1;
Note:
See TracChangeset
for help on using the changeset viewer.
