IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 5, 2005, 12:13:28 PM (21 years ago)
Author:
Paul Price
Message:

Cleaning up stac.c to work with TESTING. shiftSize now working. Added stacWriteMaps.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/stac/src/shiftSize.c

    r3660 r3667  
    1414#include "stac.h"
    1515
     16void 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
    1629int main(int argc, char *argv[])
    1730{
     
    2033#ifdef TESTING
    2134    psTraceSetLevel("stac.checkMemory",10);
    22     psTraceSetLevel("stac.config",10);
    2335    psTraceSetLevel("stac.read",10);
    2436    psTraceSetLevel("stac.size",10);
     
    2840    psLogSetLevel(9);
    2941
     42
     43    int verbose = 0;                    // Verbosity level
     44
    3045    // Parse command line
    31     stacConfig *config = stacConfigAlloc(); // Configuration values
    3246    const char *programName = argv[0];  // Program name
    33 
    34     float saturated = 65535.0;          // Saturation level
    35     float bad = 0.0;                    // Bad level
    36 
    3747    /* Variables for getopt */
    3848    int opt;   /* Option, from getopt */
     
    4757            exit(EXIT_SUCCESS);
    4858          case 'v':
    49             config->verbose++;
     59            verbose++;
    5060            break;
    5161          default:
     
    6272    }
    6373
    64     // Get the input files
    65     config->inputs = psArrayAlloc(argc);
     74    psArray *inputs = psArrayAlloc(argc); // Input filenames
    6675    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]));
    6978    }
    7079
    71 
    7280    // Read input files
    73     psArray *inputs = stacReadImages(config);
     81    psArray *images = stacReadImages(inputs);
    7482
    7583    // Read maps
    76     psArray *maps = stacReadMaps(config);
     84    psArray *maps = stacReadMaps(inputs);
    7785
    7886    // 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);
    8090
    81     printf("%d %d\n", config->outnx, config->outny);
     91    printf("%d %d\n", outnx, outny);
    8292
    8393    // Write out altered maps
    84     stacWriteMaps(maps, config);
     94    stacWriteMaps(inputs, maps);
    8595
    86     psFree(config);
    8796    psFree(inputs);
     97    psFree(images);
    8898    psFree(maps);
    8999
Note: See TracChangeset for help on using the changeset viewer.