Changeset 3476 for trunk/psLib/src/image
- Timestamp:
- Mar 22, 2005, 11:52:49 AM (21 years ago)
- Location:
- trunk/psLib/src/image
- Files:
-
- 6 edited
-
psImageErrors.dat (modified) (1 diff)
-
psImageErrors.h (modified) (2 diffs)
-
psImageExtraction.c (modified) (3 diffs)
-
psImageManip.c (modified) (4 diffs)
-
psImageManip.h (modified) (3 diffs)
-
psImageStats.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/image/psImageErrors.dat
r2879 r3476 79 79 psImageConvolve_KERNEL_TOO_LARGE Specified psKernel size, %dx%d, can not be larger than input psImage size, %dx%d. 80 80 psImage_COEFF_NULL Polynomial coefficients cannot be NULL. 81 psImageManip_TRANSFORM_NULL Specified input transform can not be NULL. -
trunk/psLib/src/image/psImageErrors.h
r3264 r3476 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1.1 4$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-0 2-17 19:26:24$9 * @version $Revision: 1.15 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-03-22 21:52:49 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 96 96 #define PS_ERRORTEXT_psImageConvolve_KERNEL_TOO_LARGE "Specified psKernel size, %dx%d, can not be larger than input psImage size, %dx%d." 97 97 #define PS_ERRORTEXT_psImage_COEFF_NULL "Polynomial coefficients cannot be NULL." 98 #define PS_ERRORTEXT_psImageManip_TRANSFORM_NULL "Specified input transform can not be NULL" 98 99 //~End 99 100 -
trunk/psLib/src/image/psImageExtraction.c
r3313 r3476 9 9 * @author Robert DeSonia, MHPCC 10 10 * 11 * @version $Revision: 1.3 2$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-0 2-24 00:19:51$11 * @version $Revision: 1.33 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-03-22 21:52:49 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 370 370 ps##TYPE *imgVecData = imgVec->data.TYPE; \ 371 371 if (maskVec != NULL) { \ 372 maskVecData = maskVec->data. V; \373 maskData = (psMaskType* )(mask->data. V[row0]) + c; \372 maskVecData = maskVec->data.U8; \ 373 maskData = (psMaskType* )(mask->data.U8[row0]) + c; \ 374 374 } \ 375 375 for (psS32 r=row0;r<row1;r++) { \ … … 453 453 // point the vector struct to the 454 454 // data to calculate the stats 455 imgVec->data. V= (psPtr )(in->data.U8[r] + col0 * elementSize);455 imgVec->data.U8 = (psPtr )(in->data.U8[r] + col0 * elementSize); 456 456 if (maskVec != NULL) { 457 maskVec->data. V= (psPtr )(mask->data.U8[r] + col0 * sizeof(psMaskType));457 maskVec->data.U8 = (psPtr )(mask->data.U8[r] + col0 * sizeof(psMaskType)); 458 458 } 459 459 myStats = psVectorStats(myStats, imgVec, NULL, maskVec, maskVal); -
trunk/psLib/src/image/psImageManip.c
r3446 r3476 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1.3 7$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-03- 18 02:35:14$12 * @version $Revision: 1.38 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-03-22 21:52:49 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 27 27 #include "psConstants.h" 28 28 #include "psImageErrors.h" 29 #include "psCoord.h" 29 30 30 31 psS32 psImageClip(psImage* input, … … 1034 1035 break; 1035 1036 1036 1037 1037 switch (mode) { 1038 1038 PSIMAGE_SHIFT_ARBITRARY_CASE(FLAT); … … 1049 1049 return out; 1050 1050 } 1051 1052 1053 // XXX: implementation is awaiting working psPlaneTransform functions like 1054 // invert. Also, the next SDRS should have a different signature. 1055 psImage* psImageTransform(psImage *output, 1056 const psImage *input, 1057 const psImage *inputMask, 1058 int inputMaskVal, 1059 const psPlaneTransform *outToIn, 1060 const psImage *combineMask, 1061 int combineMaskVal) 1062 { 1063 if (input == NULL) { 1064 psError(PS_ERR_BAD_PARAMETER_NULL, true, 1065 PS_ERRORTEXT_psImage_IMAGE_NULL); 1066 return NULL; 1067 } 1068 1069 if (outToIn == NULL) { 1070 psError(PS_ERR_BAD_PARAMETER_NULL, true, 1071 PS_ERRORTEXT_psImageManip_TRANSFORM_NULL); 1072 return NULL; 1073 } 1074 1075 // find the input image domain in the output image 1076 1077 // loop through the output image using the domain above and transform 1078 // each output pixel to input coordinates and use psImagePixelInterpolate 1079 // to determine the pixel value. 1080 1081 1082 return NULL; 1083 } -
trunk/psLib/src/image/psImageManip.h
r3264 r3476 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.1 8$ $Name: not supported by cvs2svn $14 * @date $Date: 2005-0 2-17 19:26:24$13 * @version $Revision: 1.19 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2005-03-22 21:52:49 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 20 20 21 21 #include "psImage.h" 22 #include "psCoord.h" 22 23 23 24 /// @addtogroup Image … … 180 181 ); 181 182 183 /** Transform the input image according the supplied transformation. 184 * 185 * Transform the input image according the supplied transformation. In the 186 * event that the output is NULL, the smallest possible image capable of 187 * containing the entire transformed input image is to be returned; otherwise 188 * only the image size specified in the output image is to be used. If the 189 * inputMask is not NULL, those pixels in the inputMask matching inputMaskVal 190 * are to be ignored in the transformation. The inputMask must be of type 191 * psU8, and of the same size as the input, otherwise the function shall 192 * generate an error and return NULL. The transformation outToIn specifies 193 * the coordinates in the input image of a pixel in the output image - note 194 * that this is the reverse of what might be naively expected, but it is what 195 * is required in order to use psImagePixelInterpolate. If combineMask is not 196 * NULL, then those pixels that match combineMaskVal are not transformed. 197 * combineMask must be of type psU8 and of the same size as the output, 198 * otherwise the function shall generate an error and return NULL. This 199 * function must be capable of handling the following types for the input 200 * (with corresponding types for the output): psF32, psF64. 201 * 202 * @return psImage* The transformed image. 203 */ 204 psImage* psImageTransform( 205 psImage *output, ///< psImage to recycle, or NULL 206 const psImage *input, ///< psImage to apply transform to 207 const psImage *inputMask, ///< if not NULL, mask of input psImage 208 int inputMaskVal, ///< masking value for inputMask 209 const psPlaneTransform *outToIn, ///< the transform to apply 210 const psImage *combineMask, ///< if not NULL, mask of pixels not to be transformed 211 int combineMaskVal ///< masking value for combineMask 212 ); 213 182 214 #endif -
trunk/psLib/src/image/psImageStats.c
r3309 r3476 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1.6 8$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-0 2-23 21:32:40$11 * @version $Revision: 1.69 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-03-22 21:52:49 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 63 63 junkData->nalloc = in->numRows * in->numCols; 64 64 junkData->n = junkData->nalloc; 65 junkData->data. V= in->data.V[0]; // since psImage data is contiguous...65 junkData->data.U8 = in->data.V[0]; // since psImage data is contiguous... 66 66 } else { 67 67 // image not necessarily contiguous … … 73 73 junkData->n = junkData->nalloc; 74 74 75 psU8* data = junkData->data. V;75 psU8* data = junkData->data.U8; 76 76 for (int row = 0; row < numRows; row++) { 77 77 memcpy(data, in->data.V[row], rowSize); … … 87 87 junkMask->nalloc = mask->numRows * mask->numCols; 88 88 junkMask->n = junkMask->nalloc; 89 junkMask->data. V= mask->data.V[0];89 junkMask->data.U8 = mask->data.V[0]; 90 90 } else { 91 91 // image not necessarily contiguous … … 97 97 junkMask->n = junkMask->nalloc; 98 98 99 psU8* data = junkMask->data. V;99 psU8* data = junkMask->data.U8; 100 100 for (int row = 0; row < numRows; row++) { 101 101 memcpy(data, mask->data.V[row], rowSize); … … 136 136 junkData->nalloc = in->numRows * in->numCols; 137 137 junkData->n = junkData->nalloc; 138 junkData->data. V= in->data.V[0]; // since psImage data is contiguous...138 junkData->data.U8 = in->data.V[0]; // since psImage data is contiguous... 139 139 } else { 140 140 // image not necessarily contiguous … … 146 146 junkData->n = junkData->nalloc; 147 147 148 psU8* data = junkData->data. V;148 psU8* data = junkData->data.U8; 149 149 for (int row = 0; row < numRows; row++) { 150 150 memcpy(data, in->data.V[row], rowSize); … … 160 160 junkMask->nalloc = mask->numRows * mask->numCols; 161 161 junkMask->n = junkMask->nalloc; 162 junkMask->data. V= mask->data.V[0];162 junkMask->data.U8 = mask->data.V[0]; 163 163 } else { 164 164 // image not necessarily contiguous … … 170 170 junkMask->n = junkMask->nalloc; 171 171 172 psU8* data = junkMask->data. V;172 psU8* data = junkMask->data.U8; 173 173 for (int row = 0; row < numRows; row++) { 174 174 memcpy(data, mask->data.V[row], rowSize);
Note:
See TracChangeset
for help on using the changeset viewer.
