#include <stdio.h>
#include <sys/file.h>
char *pgm;
char *readqdv();
  
main(argc,argv)
     int argc;
     char *argv[];
{
  char *infile, *outfile, *image, pal[768];
  int x,y,palsize,fin;

  pgm = argv[0];
  infile = argv[1];
  outfile = argv[2];
 
  if (strcmp(infile,"-") == 0)
    fin = 0;
  else
    {
      fin = open(infile,O_RDONLY,0);
      if (fin == NULL)
	{
	  fprintf(stderr,"Can't open input file\n");
	}
    }
  image = readqdv(fin,&x,&y,pal,&palsize);

  writehdf(outfile,pal,palsize,image,x,y);
}
