Changeset 4540 for trunk/psLib/src/imageops/psImageConvolve.c
- Timestamp:
- Jul 12, 2005, 9:12:01 AM (21 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/imageops/psImageConvolve.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/imageops/psImageConvolve.c
r4392 r4540 5 5 * @author Robert DeSonia, MHPCC 6 6 * 7 * @version $Revision: 1.2 0$ $Name: not supported by cvs2svn $8 * @date $Date: 2005-0 6-25 02:02:05$7 * @version $Revision: 1.21 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2005-07-12 19:12:01 $ 9 9 * 10 10 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 65 65 result->image = psImageAlloc(numCols,numRows,PS_TYPE_KERNEL); 66 66 memset(result->image->rawDataBuffer,0,numCols*numRows*PSELEMTYPE_SIZEOF(PS_TYPE_KERNEL)); 67 result->p_kernelRows = psAlloc(sizeof( psKernelType*)*numRows);68 69 psKernelType** kernelRows = result->p_kernelRows;70 psKernelType** imageRows = result->image->data.PS_TYPE_KERNEL_DATA;67 result->p_kernelRows = psAlloc(sizeof(float*)*numRows); 68 69 float** kernelRows = result->p_kernelRows; 70 float** imageRows = result->image->data.PS_TYPE_KERNEL_DATA; 71 71 for (psS32 i = 0; i < numRows; i++) { 72 72 kernelRows[i] = imageRows[i] - xMin; … … 103 103 psS32 yMax = 0; 104 104 psS32 length = 0; 105 psKernelTypenormalizeTime = 1.0; // fraction of total time for each shift clock105 float normalizeTime = 1.0; // fraction of total time for each shift clock 106 106 psKernel* result = NULL; 107 psKernelType** kernel = NULL;107 float** kernel = NULL; 108 108 109 109 // got non-NULL vectors? … … 170 170 } \ 171 171 \ 172 normalizeTime = 1.0 / ( psKernelType)(tShiftData[length-1]); \172 normalizeTime = 1.0 / (float)(tShiftData[length-1]); \ 173 173 result = psKernelAlloc(xMin,xMax,yMin,yMax); \ 174 174 kernel = result->kernel; \ … … 180 180 y = lastY - yShiftData[i]; \ 181 181 \ 182 kernel[y][x] += ( psKernelType)t / (psKernelType)lastT; \182 kernel[y][x] += (float)t / (float)lastT; \ 183 183 prevT = tShiftData[i]; \ 184 184 } \ … … 216 216 kernel = result->kernel; \ 217 217 \ 218 normalizeTime = 1.0 / ( psKernelType)t; \218 normalizeTime = 1.0 / (float)t; \ 219 219 x = 0; \ 220 220 y = 0; \ 221 221 for (psS32 i = length-1; i >= 0; i--) { \ 222 kernel[y][x] += ( psKernelType)(tShiftData[i]) * normalizeTime; \222 kernel[y][x] += (float)(tShiftData[i]) * normalizeTime; \ 223 223 x -= xShiftData[i]; \ 224 224 y -= yShiftData[i]; \ … … 296 296 psS32 yMin = kernel->yMin; 297 297 psS32 yMax = kernel->yMax; 298 psKernelType** kData = kernel->kernel;298 float** kData = kernel->kernel; 299 299 300 300 // make the output image to the proper size and type … … 399 399 // pad the kernel to the same size of paddedImage 400 400 psImage* paddedKernel = psImageAlloc(paddedCols,paddedRows,PS_TYPE_KERNEL); 401 memset(paddedKernel->data.U8[0],0,sizeof( psKernelType)*numCols*numRows); // zero-out image401 memset(paddedKernel->data.U8[0],0,sizeof(float)*numCols*numRows); // zero-out image 402 402 psS32 yMax = kernel->yMax; 403 403 psS32 xMax = kernel->xMax; … … 407 407 padRow += paddedRows; 408 408 } 409 psKernelType* padData = paddedKernel->data.PS_TYPE_KERNEL_DATA[padRow];410 psKernelType* kernelRow = kernel->kernel[row];409 float* padData = paddedKernel->data.PS_TYPE_KERNEL_DATA[padRow]; 410 float* kernelRow = kernel->kernel[row]; 411 411 for (psS32 col = kernel->xMin; col <= xMax; col++) { 412 412 if (col < 0) {
Note:
See TracChangeset
for help on using the changeset viewer.
