Changeset 2276
- Timestamp:
- Nov 4, 2004, 9:18:50 AM (22 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/pmReadoutCombine.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/pmReadoutCombine.c
r2275 r2276 5 5 * @author GLG, MHPCC 6 6 * 7 * @version $Revision: 1. 2$ $Name: not supported by cvs2svn $8 * @date $Date: 2004-11-04 02:02:10 $7 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2004-11-04 19:18:50 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 61 61 int numInputCols = -1; 62 62 int numInputRows = -1; 63 int minInputCols = HUGE; 64 int minInputRowss = HUGE; 63 65 psListElem *tmpInput = NULL; 64 66 int numInputs = 0; … … 68 70 // We step through each readout in the input image list. If any readout is 69 71 // NULL, empty, or has the wrong type, we generate an error and return 70 // NULL. If any readout is not the same size as any other image, we 71 // generate an error and return NULL. 72 // NULL. We determine how big of an output image is needed to combine 73 // these input images. We do this by taking the 74 // max(readout->col0 + readout->numCols + image->col0 + image->numCols) 75 // max(readout->row0 + readout->numRows + image->row0 + image->numRows) 76 // We then compare that to 77 // output->col0 + output->numCols 78 // output->row0 + output->numRows 79 // to determine if the output image actually stores that pixel. A similar 80 // thing is done for the minimul row and column. 81 // 72 82 tmpInput = (psListElem *) inputs->head; 73 74 83 while (NULL != tmpInput) { 75 84 tmpReadout = (psReadout *) tmpInput->data; … … 78 87 PS_READOUT_CHECK_TYPE(tmpReadout, PS_TYPE_F32, output); 79 88 80 if (numInputCols == -1) { 81 // XXX numInputCols = tmpReadout->image->numCols + OFFSET??; 82 numInputCols = tmpReadout->image->numCols; 83 } 84 if (numInputRows == -1) { 85 // XXX numInputRows = tmpReadout->image->numRows + OFFSET; 86 numInputRows = tmpReadout->image->numRows; 87 } 88 89 // XXX 90 if (numInputCols != tmpReadout->image->numCols) { 91 psError(PS_ERR_UNKNOWN,true, "Image %d not same size as other input images (%d, %d)\n", 92 tmpReadout->image->numRows, tmpReadout->image->numCols); 93 return(NULL); 94 } 95 // XXX 96 if (numInputRows != tmpReadout->image->numRows) { 97 psError(PS_ERR_UNKNOWN,true, "Image %d not same size as other input images (%d, %d)\n", 98 tmpReadout->image->numRows, tmpReadout->image->numCols); 99 return(NULL); 100 } 101 89 minInputRows = PS_MIN(minInputRows, 90 (tmpReadout->row0 + tmpReadout->image->row0)); 91 tmpF = tmpReadout->col0 + 92 tmpReadout->numCols + 93 tmpReadout->image->col0 + 94 tmpReadout->image->numCols; 95 maxInputCols = PS_MAX(maxInputCols, tmpF); 96 97 minInputCols = PS_MIN(minInputCols, 98 (tmpReadout->col0 + tmpReadout->image->col0)); 99 tmpF = tmpReadout->row0 + 100 tmpReadout->numRows + 101 tmpReadout->image->row0 + 102 tmpReadout->image->numRows; 103 maxInputRows = PS_MAX(maxInputRows, tmpF); 102 104 tmpInput = tmpInput->next; 103 105 numInputs++; … … 105 107 106 108 if (output == NULL) { 107 output = psImageAlloc(numInputCols, numInputRows, PS_TYPE_F32); 108 } 109 109 output = psImageAlloc(numInputCols-minInputCols, 110 numInputRows-minInputRows, PS_TYPE_F32); 111 output->col0 = minInputCols; 112 output->row0 = minInputRows; 113 } else { 114 if (((output->col0 + output->numCols) < maxInputCols) || 115 ((output->row0 + output->numRows) < maxInputRows)) { 116 psError(__func__, "Output image (%d, %d) is too small to hold combined images.\n", 117 output->row0 + output->numRows, 118 output->col0 + output->numCols); 119 return(NULL); 120 } 121 122 if ((output->col0 > minInputCols) || 123 (output->row0 > minInputRows)) { 124 psError(__func__, "Output image offset is larger then input image offset.\n"); 125 return(NULL); 126 } 127 } 110 128 111 129 if (1 < p_psDetermineNumBits(params->stats->options)) { … … 127 145 for (i = 0; i < output->numRows ; i++) { 128 146 for (j = 0; j < output->numCols ; j++) { 147 129 148 for (int r = 0; r < numInputs ; r++) { 130 // if (i,j are valid for this readout) {149 // if (i,j are valid for this readout) { 131 150 if (0) { 132 // tmpPixels->data.F32[r] = WHATEVER;151 // tmpPixels->data.F32[r] = WHATEVER; 133 152 tmpPixelMask->data.U8[r] = 0; 134 153 } else {
Note:
See TracChangeset
for help on using the changeset viewer.
