Changeset 3667 for trunk/stac/src/shiftSize.c
- Timestamp:
- Apr 5, 2005, 12:13:28 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/stac/src/shiftSize.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/stac/src/shiftSize.c
r3660 r3667 14 14 #include "stac.h" 15 15 16 void help(const char *name) 17 { 18 fprintf (stderr, "shiftSize: Calculate size for output combined image\n" 19 "Usage: %s [-h] [-v] IN1 IN2...\n" 20 "where\n" 21 "\t-h Help (this info)\n" 22 "\t-v Increase verbosity level\n" 23 "\tIN1, IN2... Input images, which have associated .map files.\n", 24 name 25 ); 26 } 27 28 16 29 int main(int argc, char *argv[]) 17 30 { … … 20 33 #ifdef TESTING 21 34 psTraceSetLevel("stac.checkMemory",10); 22 psTraceSetLevel("stac.config",10);23 35 psTraceSetLevel("stac.read",10); 24 36 psTraceSetLevel("stac.size",10); … … 28 40 psLogSetLevel(9); 29 41 42 43 int verbose = 0; // Verbosity level 44 30 45 // Parse command line 31 stacConfig *config = stacConfigAlloc(); // Configuration values32 46 const char *programName = argv[0]; // Program name 33 34 float saturated = 65535.0; // Saturation level35 float bad = 0.0; // Bad level36 37 47 /* Variables for getopt */ 38 48 int opt; /* Option, from getopt */ … … 47 57 exit(EXIT_SUCCESS); 48 58 case 'v': 49 config->verbose++;59 verbose++; 50 60 break; 51 61 default: … … 62 72 } 63 73 64 // Get the input files 65 config->inputs = psArrayAlloc(argc); 74 psArray *inputs = psArrayAlloc(argc); // Input filenames 66 75 for (int i = 0; i < argc; i++) { 67 config->inputs->data[i] = psAlloc(strlen(argv[i]));68 strncpy( config->inputs->data[i], argv[i], strlen(argv[i]));76 inputs->data[i] = psAlloc(strlen(argv[i])); 77 strncpy(inputs->data[i], argv[i], strlen(argv[i])); 69 78 } 70 79 71 72 80 // Read input files 73 psArray *i nputs = stacReadImages(config);81 psArray *images = stacReadImages(inputs); 74 82 75 83 // Read maps 76 psArray *maps = stacReadMaps( config);84 psArray *maps = stacReadMaps(inputs); 77 85 78 86 // Get size 79 stacSize(config, inputs, maps); 87 int outnx, outny; // Size of combined image 88 float xMapDiff, yMapDiff; // Difference to apply to maps 89 stacSize(&outnx, &outny, &xMapDiff, &yMapDiff, images, maps); 80 90 81 printf("%d %d\n", config->outnx, config->outny);91 printf("%d %d\n", outnx, outny); 82 92 83 93 // Write out altered maps 84 stacWriteMaps( maps, config);94 stacWriteMaps(inputs, maps); 85 95 86 psFree(config);87 96 psFree(inputs); 97 psFree(images); 88 98 psFree(maps); 89 99
Note:
See TracChangeset
for help on using the changeset viewer.
