Changeset 10214 for trunk/ppImage/src/ppImageMosaic.c
- Timestamp:
- Nov 27, 2006, 6:37:47 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/ppImage/src/ppImageMosaic.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppImage/src/ppImageMosaic.c
r8751 r10214 3 3 #endif 4 4 5 # include "ppImage.h"5 #include "ppImage.h" 6 6 7 bool ppImageMosaicChip (pmConfig *config, const pmFPAview *view, char *outFile, char *inFile) { 7 bool ppImageMosaicChip(pmConfig *config, const pmFPAview *view, char *outFile, char *inFile) 8 { 9 bool status; // Status of MD lookup 8 10 9 bool status; 10 11 pmFPAfile *in = psMetadataLookupPtr (&status, config->files, inFile); 11 pmFPAfile *in = psMetadataLookupPtr(&status, config->files, inFile); // Input file 12 12 if (!status) { 13 psErrorStackPrint(stderr, "Can't find required I/O file!\n");14 exit(EXIT_FAILURE);13 psErrorStackPrint(stderr, "Can't find required I/O file!\n"); 14 exit(EXIT_FAILURE); 15 15 } 16 16 17 pmFPAfile *out = psMetadataLookupPtr (&status, config->files, outFile);17 pmFPAfile *out = psMetadataLookupPtr(&status, config->files, outFile); // Output file 18 18 if (!status) { 19 psErrorStackPrint(stderr, "Can't find required I/O file!\n");20 exit(EXIT_FAILURE);19 psErrorStackPrint(stderr, "Can't find required I/O file!\n"); 20 exit(EXIT_FAILURE); 21 21 } 22 22 23 pmFPAAddSourceFromView (out->fpa, view, out->format);24 pmChip *outChip = pmFPAviewThisChip (view, out->fpa);25 pmChip *inChip = pmFPAviewThisChip (view, in->fpa);23 pmFPAAddSourceFromView(out->fpa, view, out->format); 24 pmChip *outChip = pmFPAviewThisChip(view, out->fpa); 25 pmChip *inChip = pmFPAviewThisChip(view, in->fpa); 26 26 27 // Copy over concepts 27 28 if (!(out->fpa->conceptsRead & PM_CONCEPT_SOURCE_HEADER)) { 28 psMetadataCopy(out->fpa->concepts, in->fpa->concepts);29 out->fpa->conceptsRead |= PM_CONCEPT_SOURCE_HEADER;29 psMetadataCopy(out->fpa->concepts, in->fpa->concepts); 30 out->fpa->conceptsRead |= PM_CONCEPT_SOURCE_HEADER; 30 31 } 31 32 32 psTrace ("pmChipMosaic", 5, "mosaic chip %s to %s (xbin,ybin: %d,%d to %d,%d)\n", in->name, out->name, in->xBin, in->yBin, out->xBin, out->yBin); 33 pmChipMosaic (outChip, inChip); 34 35 return true; 33 psTrace("pmChipMosaic", 5, "mosaic chip %s to %s (xbin,ybin: %d,%d to %d,%d)\n", 34 in->name, out->name, in->xBin, in->yBin, out->xBin, out->yBin); 35 return pmChipMosaic(outChip, inChip); 36 36 } 37 37 38 bool ppImageMosaicFPA (pmConfig *config, char *outFile, char *inFile) { 38 bool ppImageMosaicFPA (pmConfig *config, char *outFile, char *inFile) 39 { 40 bool status; // Status of MD lookup 39 41 40 bool status; 41 42 pmFPAfile *in = psMetadataLookupPtr (&status, config->files, inFile); 42 pmFPAfile *in = psMetadataLookupPtr(&status, config->files, inFile); // Input file 43 43 if (!status) { 44 psErrorStackPrint(stderr, "Can't find required I/O file!\n");45 exit(EXIT_FAILURE);44 psErrorStackPrint(stderr, "Can't find required I/O file!\n"); 45 exit(EXIT_FAILURE); 46 46 } 47 47 48 pmFPAfile *out = psMetadataLookupPtr (&status, config->files, outFile);48 pmFPAfile *out = psMetadataLookupPtr(&status, config->files, outFile); // Output file 49 49 if (!status) { 50 psErrorStackPrint(stderr, "Can't find required I/O file!\n");51 exit(EXIT_FAILURE);50 psErrorStackPrint(stderr, "Can't find required I/O file!\n"); 51 exit(EXIT_FAILURE); 52 52 } 53 53 54 54 // XXX test printing of all concepts 55 # if 055 #if 0 56 56 for (int i = 0; i < in->fpa->chips->n; i++) { 57 pmChip *chip = in->fpa->chips->data[i];58 for (int j = 0; j < chip->cells->n; j++) {59 pmCell *cell = chip->cells->data[j];60 psMetadataPrint(stdout, cell->concepts, 2);61 }57 pmChip *chip = in->fpa->chips->data[i]; 58 for (int j = 0; j < chip->cells->n; j++) { 59 pmCell *cell = chip->cells->data[j]; 60 psMetadataPrint(stdout, cell->concepts, 2); 61 } 62 62 } 63 # endif63 #endif 64 64 65 pmFPAview *view = pmFPAviewAlloc (0); 66 pmFPAAddSourceFromView (out->fpa, view, out->format); 65 pmFPAview *view = pmFPAviewAlloc(0); 66 pmFPAAddSourceFromView(out->fpa, view, out->format); 67 psFree(view); 67 68 68 psTrace ("pmFPAMosaic", 5, "mosaic fpa %s to %s (xbin,ybin: %d,%d to %d,%d)\n", in->name, out->name, in->xBin, in->yBin, out->xBin, out->yBin); 69 pmFPAMosaic (out->fpa, in->fpa); 70 71 psFree (view); 72 return true; 69 psTrace ("pmFPAMosaic", 5, "mosaic fpa %s to %s (xbin,ybin: %d,%d to %d,%d)\n", 70 in->name, out->name, in->xBin, in->yBin, out->xBin, out->yBin); 71 return pmFPAMosaic(out->fpa, in->fpa); 73 72 }
Note:
See TracChangeset
for help on using the changeset viewer.
