Changeset 33378 for trunk/pstamp/src/ppstampParseCamera.c
- Timestamp:
- Feb 28, 2012, 11:56:52 AM (14 years ago)
- File:
-
- 1 edited
-
trunk/pstamp/src/ppstampParseCamera.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pstamp/src/ppstampParseCamera.c
r29379 r33378 8 8 9 9 // Set up the ppstamp output Image file 10 bool setupOutput(pmConfig *config, pmFPAfile *input, psString stage, bool doMask, bool doWeight )10 bool setupOutput(pmConfig *config, pmFPAfile *input, psString stage, bool doMask, bool doWeight, pmFPAfile **pOutput) 11 11 { 12 12 pmFPAfile *output; … … 22 22 return false; 23 23 } 24 *pOutput = output; 24 25 25 26 output->save = true; … … 33 34 outWeight->save = true; 34 35 } 36 35 37 36 38 return true; … … 76 78 77 79 78 79 80 // XXX: create a filerule for PPSTAMP.ASTROM 80 81 pmFPAfile *astrom = pmFPAfileDefineFromArgs(&status, config, "PSWARP.ASTROM", "ASTROM"); … … 95 96 96 97 // Set up the output target 97 if (!setupOutput(config, input, options->stage, doMask, doWeight)) { 98 pmFPAfile *output; 99 if (!setupOutput(config, input, options->stage, doMask, doWeight, &output)) { 98 100 psError(PS_ERR_UNKNOWN, false, "Unable to setup output."); 99 101 return false; 100 102 } 101 103 102 pmFPAfile *chipImage = pmFPAfileDefineChipMosaic(config, input->fpa, "PPSTAMP.CHIP");104 pmFPAfile *chipImage = pmFPAfileDefineChipMosaic(config, output->fpa, "PPSTAMP.CHIP"); 103 105 if (!chipImage) { 104 106 psError(PS_ERR_IO, false, _("Unable to generate new file from PPSTAMP.CHIP")); … … 108 110 psError(PS_ERR_IO, true, "PPSTAMP.CHIP is not of type IMAGE"); 109 111 return NULL; 112 } 113 114 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); 125 if (!jpg) { 126 psError(PS_ERR_IO, false, "Unable to generate new file from %s", filerule); 127 return NULL; 128 } 129 if (jpg->type != PM_FPA_FILE_JPEG) { 130 psError(PS_ERR_IO, true, "%s is not of type JPEG", filerule); 131 return NULL; 132 } 133 jpg->save = true; 110 134 } 111 135
Note:
See TracChangeset
for help on using the changeset viewer.
