Changeset 29125 for trunk/ppSim
- Timestamp:
- Sep 7, 2010, 9:29:02 AM (16 years ago)
- File:
-
- 1 edited
-
trunk/ppSim/src/ppSimCreate.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppSim/src/ppSimCreate.c
r29011 r29125 28 28 assert (config->camera); 29 29 30 // int nx = psMetadataLookupS32 (&status, config->arguments, "NX.CELL"); 31 // if (nx) { 32 // psMetadata *defaults = psMetadataLookupPtr(&status, config->camera, "DEFAULTS"); 33 // psMetadataLookupS32 (&status, defaults, "CELL.XSIZE"); 34 // psAssert (status, "CELL.XSIZE should be in DEFAULTS"); 35 // psMetadataAddF32(defaults, PS_LIST_TAIL, "CELL.XSIZE", PS_META_REPLACE, "", nx); 36 // } 37 // int ny = psMetadataLookupS32 (&status, config->arguments, "NY.CELL"); 38 // if (ny) { 39 // psMetadata *defaults = psMetadataLookupPtr(&status, config->camera, "DEFAULTS"); 40 // psMetadataLookupS32 (&status, defaults, "CELL.YSIZE"); 41 // psAssert (status, "CELL.YSIZE should be in DEFAULTS"); 42 // psMetadataAddF32(defaults, PS_LIST_TAIL, "CELL.YSIZE", PS_META_REPLACE, "", ny); 43 // } 30 int nx = psMetadataLookupS32 (&status, config->arguments, "NX.CELL"); 31 int ny = psMetadataLookupS32 (&status, config->arguments, "NY.CELL"); 32 33 if (nx || ny) { 34 // need to find format(s) 35 psMetadata *formats = psMetadataLookupPtr(&status, config->camera, "FORMATS"); 36 psAssert (formats, "FORMATS missing from camera config"); 37 38 psMetadataIterator *iter = psMetadataIteratorAlloc(formats, PS_LIST_HEAD, NULL); // Iterator 39 psMetadataItem *format; // Item from iteration 40 while ((format = psMetadataGetAndIncrement(iter))) { 41 psAssert (format->type == PS_DATA_METADATA, "unexpected format block"); 42 43 if (nx) { 44 psMetadata *defaults = psMetadataLookupPtr(&status, format->data.md, "DEFAULTS"); 45 psMetadataLookupS32 (&status, defaults, "CELL.XSIZE"); 46 psAssert (status, "CELL.XSIZE should be in DEFAULTS"); 47 psMetadataAddF32(defaults, PS_LIST_TAIL, "CELL.XSIZE", PS_META_REPLACE, "", nx); 48 } 49 if (ny) { 50 psMetadata *defaults = psMetadataLookupPtr(&status, format->data.md, "DEFAULTS"); 51 psMetadataLookupS32 (&status, defaults, "CELL.YSIZE"); 52 psAssert (status, "CELL.YSIZE should be in DEFAULTS"); 53 psMetadataAddF32(defaults, PS_LIST_TAIL, "CELL.YSIZE", PS_META_REPLACE, "", ny); 54 } 55 } 56 psFree(iter); 57 } 44 58 45 59 // generate the fpa structure used by the output camera (determined from INPUT or specified)
Note:
See TracChangeset
for help on using the changeset viewer.
