Utah Raster Toolkit  9999-git
URT Development version (post-3.1b)
Functions
qcrldmap.c File Reference
#include <stdio.h>
Include dependency graph for qcrldmap.c:

Go to the source code of this file.

Functions

 main (int argc, char **argv)
 

Function Documentation

main ( int  argc,
char **  argv 
)

Definition at line 13 of file qcrldmap.c.

16 {
17  int file_flag = 0, mapflag = 0, map_num, verbose_flag = 0, i;
18  char * filename;
19  FILE * mapfile;
20  unsigned char lut_data[1536];
21  unsigned char * lutptr;
22  int num;
23 
24  if (! scanargs( argc, argv, "% f%-file!s m%-stdmap!d v%-", &file_flag,
25  &filename, &mapflag, &map_num, &verbose_flag ))
26  {
27  fprintf(stderr, "std color maps are: 1=linear, 2=Polaroid 59,\n");
28  fprintf(stderr, " 3=Ektachrome 100, 4=Ektachrome 100 (4K),\n");
29  fprintf(stderr, " 5=Polaroid 59 (4K), 6=Polaroid 809 (4K)\n");
30  exit(-2);
31  }
32 
33  if (mapflag && file_flag)
34  {
35  fprintf(stderr, "qcrldmap: only one of -f or -m\n");
36  exit(-2);
37  }
38 
39  init_qcr( verbose_flag );
40 
41  if (mapflag)
42  {
43  qcr_load_i_luts( map_num );
44  }
45 
46  if (file_flag)
47  {
48  if (! (mapfile = fopen( filename, "r" )))
49  {
50  perror("qcrldmap");
51  exit(-2);
52  }
53 
54  lutptr = lut_data;
55  for (i = 0; i < 3*256; i++)
56  {
57  fscanf( mapfile, "%d", &num );
58  *lutptr++ = (num >> 8) & 0xFF;
59  *lutptr++ = num & 0xFF;
60  }
61  qcr_ld_lut12( lut_data );
62  }
63 }
int scanargs(int argc, char **argv, const char *format,...)
Definition: scanargs.c:94
int init_qcr(short verbose)
Definition: qcr.c:104
Boolean verbose_flag
Definition: getx11.c:80
qcr_load_i_luts(int lut)
Definition: qcr.c:584
qcr_ld_lut12(buf)
Definition: qcr.c:565
int i
Definition: rletorla.c:82