Changeset 2287 for trunk/psModules/src/pmReadoutCombine.c
- Timestamp:
- Nov 4, 2004, 6:49:47 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/pmReadoutCombine.c (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/pmReadoutCombine.c
r2286 r2287 5 5 * @author GLG, MHPCC 6 6 * 7 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $8 * @date $Date: 2004-11-05 0 2:45:42$7 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2004-11-05 04:49:47 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 65 65 psListElem *tmpInput = NULL; 66 66 int numInputs = 0; 67 psReadout *tmpReadout ;67 psReadout *tmpReadout = NULL; 68 68 float tmpF; 69 69 … … 135 135 // 136 136 if (output == NULL) { 137 output = psImageAlloc( 1+maxInputCols-minInputCols,138 1+maxInputRows-minInputRows, PS_TYPE_F32);137 output = psImageAlloc(maxInputCols-minInputCols, 138 maxInputRows-minInputRows, PS_TYPE_F32); 139 139 *(int *) &(output->col0) = minInputCols; 140 140 *(int *) &(output->row0) = minInputRows; … … 168 168 psReadout **tmpReadouts = (psReadout **) psAlloc(numInputs * sizeof(psReadout *)); 169 169 170 171 170 // For each input readout, we create a pointer to that readout in 172 171 // "tmpReadouts[]", and we store the min/max pixel indices for that … … 174 173 // (outRowLower, outColLower, outRowUpper, outColUpper). 175 174 i = 0; 175 tmpInput = (psListElem *) inputs->head; 176 176 while (NULL != tmpInput) { 177 177 tmpReadouts[i] = (psReadout *) tmpInput->data; 178 outRowLower->data.U32[i] = tmpReadouts[i]->row0 + tmpReadout ->image->row0;179 outColLower->data.U32[i] = tmpReadouts[i]->col0 + tmpReadout ->image->col0;178 outRowLower->data.U32[i] = tmpReadouts[i]->row0 + tmpReadouts[i]->image->row0; 179 outColLower->data.U32[i] = tmpReadouts[i]->col0 + tmpReadouts[i]->image->col0; 180 180 outRowUpper->data.U32[i] = tmpReadouts[i]->row0 + 181 181 tmpReadouts[i]->image->row0 + … … 185 185 tmpReadouts[i]->image->numCols; 186 186 187 // printf("Bounds: [%d][%d] to [%d][%d]\n", outRowLower->data.U32[i], outColLower->data.U32[i], outRowUpper->data.U32[i], outColUpper->data.U32[i]); 188 189 187 190 tmpInput = tmpInput->next; 188 191 i++; 189 190 192 } 191 193 … … 197 199 // stats routine on those pixels/mask. Then we set the output pixel value 198 200 // to the result of the stats call. 199 for (i = output->row0; i < output->numRows ; i++) { 200 for (j = output->col0; j < output->numCols ; j++) { 201 202 for (i = output->row0; i < (output->row0 + output->numRows) ; i++) { 203 for (j = output->col0; j < (output->col0 + output->numCols) ; j++) { 201 204 for (int r = 0; r < numInputs ; r++) { 205 // printf("[%d][%d]: [%d][%d] to [%d][%d]\n", i, j, outRowLower->data.U32[r], outColLower->data.U32[r], outRowUpper->data.U32[r], outColUpper->data.U32[r]); 202 206 if ((outRowLower->data.U32[r] <= i) && 203 207 (outColLower->data.U32[r] <= j) && … … 206 210 207 211 int imageRow = i - (tmpReadouts[r]->row0 + 208 tmpReadouts[ i]->image->row0);212 tmpReadouts[r]->image->row0); 209 213 int imageCol = j - (tmpReadouts[r]->col0 + 210 214 tmpReadouts[r]->image->col0); 211 if (!(maskVal && tmpReadouts[i]->mask->data.U8[imageRow][imageCol])) { 212 tmpPixels->data.F32[r] = tmpReadouts[i]->image->data.F32[imageRow][imageCol]; 215 216 if ((NULL == tmpReadouts[r]->mask) || 217 !(maskVal && tmpReadouts[r]->mask->data.U8[imageRow][imageCol])) { 218 tmpPixels->data.F32[r] = tmpReadouts[r]->image->data.F32[imageRow][imageCol]; 213 219 tmpPixelMask->data.U8[r] = 0; 214 220 } else { … … 220 226 tmpPixelMask->data.U8[r] = 1; 221 227 } 228 // printf("readout[%d], image [%d][%d] is %f\n", r, i, j, tmpPixels->data.F32[r]); 222 229 } 223 230 // At this point, we have scanned all input readouts for this … … 299 306 300 307 psFree(tmpPixels); 301 psFree(tmpPixels);302 308 psFree(tmpPixelMask); 303 309 psFree(tmpPixelMaskNKeep);
Note:
See TracChangeset
for help on using the changeset viewer.
