Changeset 17228 for trunk/psModules/src/camera
- Timestamp:
- Mar 28, 2008, 5:10:17 PM (18 years ago)
- Location:
- trunk/psModules/src/camera
- Files:
-
- 2 edited
-
pmReadoutStack.c (modified) (1 diff)
-
pmReadoutStack.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/camera/pmReadoutStack.c
r17009 r17228 3 3 #endif 4 4 5 #include <stdio.h> 6 #include <string.h> 5 7 #include <pslib.h> 6 8 7 9 #include "pmReadoutStack.h" 8 10 11 psImage *pmReadoutAnalysisImage(pmReadout *readout, // Readout containing image 12 const char *name, // Name of image in analysis metadata 13 int numCols, int numRows, // Expected size of image 14 psElemType type, // Expected type of image 15 double init // Initial value 16 ) 17 { 18 PS_ASSERT_PTR_NON_NULL(readout, false); 19 PS_ASSERT_STRING_NON_EMPTY(name, false); 20 21 bool mdok; // Status of MD lookup 22 psImage *image = psMetadataLookupPtr(&mdok, readout->analysis, name); 23 if (!image) { 24 image = psImageAlloc(numCols, numRows, type); 25 psMetadataAddImage(readout->analysis, PS_LIST_TAIL, name, 0, "Analysis image from " __FILE__, image); 26 psImageInit(image, init); 27 return image; 28 } 29 if (image->numCols != numCols || image->numRows != numRows) { 30 psError(PS_ERR_BAD_PARAMETER_SIZE, true, "Analysis image %s has incorrect size (%dx%d vs %dx%d)", 31 name, image->numCols, image->numRows, numCols, numRows); 32 return NULL; 33 } 34 if (image->type.type != type) { 35 psError(PS_ERR_BAD_PARAMETER_TYPE, true, "Analysis image %s has incorrect type (%x vs %x)", 36 name, image->type.type, type); 37 return NULL; 38 } 39 return psMemIncrRefCounter(image); 40 } 9 41 10 42 bool pmReadoutUpdateSize(pmReadout *readout, int minCols, int minRows, -
trunk/psModules/src/camera/pmReadoutStack.h
r16600 r17228 4 4 #include "pmHDU.h" 5 5 #include "pmFPA.h" 6 7 #define PM_READOUT_STACK_ANALYSIS_COUNT "STACK.COUNT" // Name for count image in analysis metadata 8 #define PM_READOUT_STACK_ANALYSIS_SIGMA "STACK.SIGMA" // Name for sigma image in analysis metadata 6 9 7 10 /// Update an output readout (for a stack) with the correct col0,row0 and the image size … … 21 24 ); 22 25 26 /// Return an image from analysis metadata, produced while stacking 27 psImage *pmReadoutAnalysisImage(pmReadout *readout, // Readout containing image 28 const char *name, // Name of image in analysis metadata 29 int numCols, int numRows, // Expected size of image 30 psElemType type, // Expected type of image 31 double init // Initial value 32 ); 23 33 24 34 #endif
Note:
See TracChangeset
for help on using the changeset viewer.
