Changeset 17228 for trunk/psModules/src/camera/pmReadoutStack.c
- Timestamp:
- Mar 28, 2008, 5:10:17 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/camera/pmReadoutStack.c (modified) (1 diff)
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,
Note:
See TracChangeset
for help on using the changeset viewer.
