Changeset 21363 for trunk/psModules/src/camera/pmReadoutStack.c
- Timestamp:
- Feb 5, 2009, 4:31:25 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/camera/pmReadoutStack.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/camera/pmReadoutStack.c
r21183 r21363 12 12 // XXX should it be an error for the image to exist? 13 13 psImage *pmReadoutSetAnalysisImage(pmReadout *readout, // Readout containing image 14 const char *name, // Name of image in analysis metadata15 int numCols, int numRows, // Expected size of image16 psElemType type, // Expected type of image17 double init // Initial value14 const char *name, // Name of image in analysis metadata 15 int numCols, int numRows, // Expected size of image 16 psElemType type, // Expected type of image 17 double init // Initial value 18 18 ) 19 19 { … … 24 24 25 25 if (!psMetadataAddImage(readout->analysis, PS_LIST_TAIL, name, 0, "Analysis image from " __FILE__, image)) { 26 psAbort ("analysis image already exists");26 psAbort ("analysis image already exists"); 27 27 } 28 28 psImageInit(image, init); … … 35 35 // XXX not sure why this should call psMemIncrRefCounter 36 36 psImage *pmReadoutGetAnalysisImage(pmReadout *readout, // Readout containing image 37 const char *name // Name of image in analysis metadata37 const char *name // Name of image in analysis metadata 38 38 ) 39 39 { … … 78 78 79 79 // XXX for the moment, use col0, row0, numCols, numRows supplied from the outside 80 bool pmReadoutStackDefineOutput(pmReadout *readout, int col0, int row0, int numCols, int numRows, bool mask, bool weight, psImageMaskType blank)80 bool pmReadoutStackDefineOutput(pmReadout *readout, int col0, int row0, int numCols, int numRows, bool mask, bool variance, psImageMaskType blank) 81 81 { 82 82 PS_ASSERT_PTR_NON_NULL(readout, false); … … 92 92 93 93 if (mask) { 94 // XXX is this an error?94 // XXX is this an error? 95 95 if (readout->mask) return false; 96 readout->mask = psImageAlloc(numCols, numRows, PS_TYPE_IMAGE_MASK);97 psImageInit(readout->mask, blank);98 } 99 100 if ( weight) {101 // XXX is this an error?102 if (readout-> weight) return false;103 readout->weight= psImageAlloc(numCols, numRows, PS_TYPE_F32);104 psImageInit(readout->weight, NAN);96 readout->mask = psImageAlloc(numCols, numRows, PS_TYPE_IMAGE_MASK); 97 psImageInit(readout->mask, blank); 98 } 99 100 if (variance) { 101 // XXX is this an error? 102 if (readout->variance) return false; 103 readout->variance = psImageAlloc(numCols, numRows, PS_TYPE_F32); 104 psImageInit(readout->variance, NAN); 105 105 } 106 106 … … 162 162 163 163 bool pmReadoutUpdateSize(pmReadout *readout, int minCols, int minRows, 164 int numCols, int numRows, bool mask, bool weight,164 int numCols, int numRows, bool mask, bool variance, 165 165 psImageMaskType blank) 166 166 { … … 203 203 } 204 204 205 if ( weight) {206 if (!readout-> weight) {207 readout-> weight= psImageAlloc(numCols, numRows, PS_TYPE_F32);208 psImageInit(readout-> weight, NAN);209 } 210 if (readout-> weight->numCols < numCols || readout->weight->numRows < numRows) {211 psImage *new Weight= psImageAlloc(numCols, numRows, PS_TYPE_F32);212 psImageInit(new Weight, NAN);213 psImageOverlaySection(new Weight, readout->weight, readout->col0, readout->row0, "=");214 psFree(readout-> weight);215 readout-> weight = newWeight;205 if (variance) { 206 if (!readout->variance) { 207 readout->variance = psImageAlloc(numCols, numRows, PS_TYPE_F32); 208 psImageInit(readout->variance, NAN); 209 } 210 if (readout->variance->numCols < numCols || readout->variance->numRows < numRows) { 211 psImage *newVariance = psImageAlloc(numCols, numRows, PS_TYPE_F32); 212 psImageInit(newVariance, NAN); 213 psImageOverlaySection(newVariance, readout->variance, readout->col0, readout->row0, "="); 214 psFree(readout->variance); 215 readout->variance = newVariance; 216 216 } 217 217 }
Note:
See TracChangeset
for help on using the changeset viewer.
