# include "data.h"

int center (int argc, char **argv) {
  
  double x, y;
  int zoom;
  int Ximage, Nimage, N;
  
  Nimage = -1;
  if ((N = get_argument (argc, argv, "-n"))) {
    remove_argument (N, &argc, argv);
    Nimage = atof (argv[N]);
    remove_argument (N, &argc, argv);
  }
  if (!GetImage (&Ximage, &Nimage)) return (FALSE);

  if ((argc != 3) && (argc != 4)) {
    gprint (GP_ERR, "USAGE: center x y [zoom]\n");
    return (FALSE);
  }

  x = atof (argv[1]);
  y = atof (argv[2]);
  zoom = 0;
  if (argc == 4) zoom = atof (argv[3]);

  KiiCenter (Ximage, x, y, zoom);
  return (TRUE);
}
