Changeset 33507
- Timestamp:
- Mar 13, 2012, 2:21:32 PM (14 years ago)
- Location:
- tags/ipp-20120216/pstamp/src
- Files:
-
- 6 edited
-
. (modified) (1 prop)
-
ppstampArguments.c (modified) (2 diffs)
-
ppstampMakeStamp.c (modified) (3 diffs)
-
ppstampOptions.c (modified) (1 diff)
-
ppstampOptions.h (modified) (1 diff)
-
ppstampParseCamera.c (modified) (4 diffs, 1 prop)
Legend:
- Unmodified
- Added
- Removed
-
tags/ipp-20120216/pstamp/src
- Property svn:mergeinfo set to
-
tags/ipp-20120216/pstamp/src/ppstampArguments.c
r33383 r33507 62 62 *pOptions = options; 63 63 64 if (!pstampGetROI(&options->roip, &argc, argv, &gotCenter, &gotRange)) { 65 usage(); 64 if ((argnum = psArgumentGet(argc, argv, "-wholefile"))) { 65 psArgumentRemove(argnum, &argc, argv); 66 gotCenter = true; 67 gotRange = true; 68 options->wholeFile = true; 69 } else { 70 if (!pstampGetROI(&options->roip, &argc, argv, &gotCenter, &gotRange)) { 71 usage(); 72 } 66 73 } 67 74 … … 105 112 106 113 if ((argnum = psArgumentGet(argc, argv, "-no_censor_masked"))) { 114 // this is the default. This is for compatiability 107 115 psArgumentRemove(argnum, &argc, argv); 108 116 options->censorMasked = false; 117 } 118 if ((argnum = psArgumentGet(argc, argv, "-censor_masked"))) { 119 // default changed to not censor allow it to be changed back to true 120 psArgumentRemove(argnum, &argc, argv); 121 options->censorMasked = true; 122 } 123 if ((argnum = psArgumentGet(argc, argv, "-nocompress"))) { 124 psArgumentRemove(argnum, &argc, argv); 125 options->nocompress = true; 109 126 } 110 127 -
tags/ipp-20120216/pstamp/src/ppstampMakeStamp.c
r30050 r33507 233 233 int status = false; 234 234 235 pmFPAfile *output; 236 if (!options->stage || (strcmp(options->stage, "diff") != 0)) { 237 output = psMetadataLookupPtr(NULL, config->files, "PPSTAMP.OUTPUT"); 238 } else { 239 output = psMetadataLookupPtr(NULL, config->files, "PPSTAMP.OUTPUT.DIFF"); 240 } 235 pmFPAfile *output = psMetadataLookupPtr(NULL, config->files, options->outputFileRule); 241 236 if (!output) { 242 237 psError(PS_ERR_UNKNOWN, false, "Can't find output data\n"); … … 529 524 // If no chip name was specified, select this one (the first one that had data) 530 525 if ((options->chipName == NULL) || !strcasecmp(chipName, options->chipName)) { 531 psLogMsg("ppstampMakeStamp", 2, "Center on chip: %s\n", chipName); 532 center->chip->x = options->roip.centerX; 533 center->chip->y = options->roip.centerY; 526 if (options->chipName) { 527 psLogMsg("ppstampMakeStamp", 2, "Center on chip: %s\n", chipName); 528 } 529 if (options->wholeFile) { 530 center->chip->x = (chipBounds->x1 + chipBounds->x0 + 1) / 2; 531 center->chip->y = (chipBounds->y1 + chipBounds->y0 + 1) / 2; 532 } else { 533 center->chip->x = options->roip.centerX; 534 center->chip->y = options->roip.centerY; 535 } 534 536 center->chip->xErr = 0; 535 537 center->chip->yErr = 0; … … 543 545 findBoundingBox(options, input->fpa, chip, center); 544 546 } else { 545 int width = options->roip.dX; 546 int height = options->roip.dY; 547 if (width > 5000) { 548 fprintf(stderr, "requested width %d too large reducing to 5000\n", width); 549 width = 5000; 547 if (options->wholeFile) { 548 options->roi = *chipBounds; 549 } else { 550 int width = options->roip.dX; 551 int height = options->roip.dY; 552 if (width > 7000) { 553 fprintf(stderr, "requested width %d too large reducing to 7000\n", width); 554 width = 7000; 555 } 556 if (height > 7000) { 557 fprintf(stderr, "requested height %d too large reducing to 7000\n", height); 558 height = 7000; 559 } 560 561 // calculate the ROI in chip coordinates 562 options->roi.x0 = center->chip->x - width / 2; 563 options->roi.x1 = options->roi.x0 + width; 564 options->roi.y0 = center->chip->y - height / 2; 565 options->roi.y1 = options->roi.y0 + height; 550 566 } 551 if (height > 5000) { 552 fprintf(stderr, "requested height %d too large reducing to 5000\n", height); 553 height = 5000; 554 } 555 556 // calculate the ROI in chip coordinates 557 options->roi.x0 = center->chip->x - width / 2; 558 options->roi.x1 = options->roi.x0 + width; 559 options->roi.y0 = center->chip->y - height / 2; 560 options->roi.y1 = options->roi.y0 + height; 561 } 562 563 564 if (regionContainsRegion(chipBounds, &options->roi)) { 565 // returnval = findCell(view, options, input, center, ppCell); 567 } 568 569 570 if (options->wholeFile || regionContainsRegion(chipBounds, &options->roi)) { 566 571 psLogMsg("ppstampMakeStamp", 2, "ROI contained on: %s\n", chipName); 567 572 returnval = PPSTAMP_ON; -
tags/ipp-20120216/pstamp/src/ppstampOptions.c
r32370 r33507 30 30 options->cellName = NULL; 31 31 options->stage = NULL; 32 options->censorMasked = true; 32 options->censorMasked = false; 33 options->writeJPEG = false; 34 options->nocompress = false; 35 options->wholeFile = false; 36 options->outputFileRule = NULL; 33 37 34 38 return options; -
tags/ipp-20120216/pstamp/src/ppstampOptions.h
r33383 r33507 8 8 // input arguments 9 9 pstampROI roip; 10 bool wholeFile; 10 11 psString chipName; 11 12 psString cellName; 12 13 psString stage; 14 bool censorMasked; 15 bool writeJPEG; 16 bool nocompress; 13 17 // 14 18 // Calculated Values 15 19 // 20 psString outputFileRule; 16 21 psRegion roi; // roi in chip coordinates 17 bool censorMasked;18 bool writeJPEG;19 22 } ppstampOptions; 20 23 -
tags/ipp-20120216/pstamp/src/ppstampParseCamera.c
- Property svn:mergeinfo deleted
r33390 r33507 8 8 9 9 // Set up the ppstamp output Image file 10 bool setupOutput(pmConfig *config, pmFPAfile *input, p sString stage, bool doMask, bool doWeight, pmFPAfile **pOutput)10 bool setupOutput(pmConfig *config, pmFPAfile *input, ppstampOptions *options, bool doMask, bool doWeight, pmFPAfile **pOutput) 11 11 { 12 pmFPAfile *output; 13 14 if (!stage || (strcmp(stage, "diff") != 0)) { 15 output = pmFPAfileDefineSkycell(config, NULL, "PPSTAMP.OUTPUT"); 12 if (!options->stage || (strcmp(options->stage, "diff") != 0)) { 13 if (options->nocompress) { 14 options->outputFileRule = "PPSTAMP.OUTPUT.NOCOMP"; 15 } else { 16 options->outputFileRule = "PPSTAMP.OUTPUT"; 17 } 16 18 } else { 17 19 // need special filerule for diff stage image to allow for negative values 18 output = pmFPAfileDefineSkycell(config, NULL, "PPSTAMP.OUTPUT.DIFF"); 20 if (options->nocompress) { 21 options->outputFileRule = "PPSTAMP.OUTPUT.DIFF.NOCOMP"; 22 } else { 23 options->outputFileRule = "PPSTAMP.OUTPUT.DIFF"; 24 } 19 25 } 26 pmFPAfile *output = pmFPAfileDefineSkycell(config, NULL, options->outputFileRule); 20 27 if (!output) { 21 28 psError(PS_ERR_UNKNOWN, false, "Unable to setup output."); … … 27 34 28 35 if (doMask) { 29 pmFPAfile *outMask = pmFPAfileDefineSkycell(config, output->fpa, "PPSTAMP.OUTPUT.MASK"); 36 char *rule; 37 if (options->nocompress) { 38 rule = "PPSTAMP.OUTPUT.MASK.NOCOMP"; 39 } else { 40 rule = "PPSTAMP.OUTPUT.MASK"; 41 } 42 pmFPAfile *outMask = pmFPAfileDefineSkycell(config, output->fpa, rule); 30 43 outMask->save = true; 31 44 } 32 45 if (doWeight) { 33 pmFPAfile *outWeight = pmFPAfileDefineSkycell(config, output->fpa, "PPSTAMP.OUTPUT.VARIANCE"); 46 char *rule; 47 if (options->nocompress) { 48 rule = "PPSTAMP.OUTPUT.VARIANCE.NOCOMP"; 49 } else { 50 rule = "PPSTAMP.OUTPUT.VARIANCE"; 51 } 52 pmFPAfile *outWeight = pmFPAfileDefineSkycell(config, output->fpa, rule); 34 53 outWeight->save = true; 35 54 } 36 37 55 38 56 return true; … … 97 115 // Set up the output target 98 116 pmFPAfile *output; 99 if (!setupOutput(config, input, options ->stage, doMask, doWeight, &output)) {117 if (!setupOutput(config, input, options, doMask, doWeight, &output)) { 100 118 psError(PS_ERR_UNKNOWN, false, "Unable to setup output."); 101 119 return false; … … 113 131 114 132 if (options->writeJPEG) { 115 char *filerule; 116 // If stage is chip flip the X axis otherwise don't flip. 117 // XXX: is this the right thing to do? 118 // Shouldn't the JPEG match the stamp even for chip stage? 119 if (!options->stage || strcmp(options->stage, "chip")) { 120 filerule = "PPSTAMP.OUTPUT.JPEG"; 121 } else { 122 filerule = "PPSTAMP.OUTPUT.JPEG.FLIP"; 123 } 124 pmFPAfile *jpg = pmFPAfileDefineOutput(config, output->fpa, filerule); 133 char *filerule = "PPSTAMP.OUTPUT.JPEG"; 134 pmFPAfile *jpg = pmFPAfileDefineSkycell(config, output->fpa, filerule); 125 135 if (!jpg) { 126 136 psError(PS_ERR_IO, false, "Unable to generate new file from %s", filerule);
Note:
See TracChangeset
for help on using the changeset viewer.
