1 |
– |
/* Copyright (c) 1999 Regents of the University of California */ |
2 |
– |
|
1 |
|
#ifndef lint |
2 |
< |
static char SCCSid[] = "$SunId$ SGI"; |
2 |
> |
static const char RCSid[] = "$Id$"; |
3 |
|
#endif |
6 |
– |
|
4 |
|
/* |
5 |
|
* Calibrate a scanned MacBeth Color Checker Chart |
6 |
|
* |
12 |
|
|
13 |
|
#include <stdio.h> |
14 |
|
#include <math.h> |
15 |
< |
#ifdef MSDOS |
16 |
< |
#include <fcntl.h> |
17 |
< |
#endif |
15 |
> |
#include <time.h> |
16 |
> |
|
17 |
> |
#include "platform.h" |
18 |
|
#include "color.h" |
19 |
|
#include "resolu.h" |
20 |
|
#include "pmap.h" |
122 |
|
FILE *debugfp = NULL; /* debug output picture */ |
123 |
|
char *progname; |
124 |
|
|
128 |
– |
extern char *malloc(); |
125 |
|
|
130 |
– |
|
126 |
|
main(argc, argv) |
127 |
|
int argc; |
128 |
|
char **argv; |
140 |
|
perror(argv[i]); |
141 |
|
exit(1); |
142 |
|
} |
143 |
< |
#ifdef MSDOS |
149 |
< |
setmode(fileno(debugfp), O_BINARY); |
150 |
< |
#endif |
143 |
> |
SET_FILE_BINARY(debugfp); |
144 |
|
newheader("RADIANCE", debugfp); /* start */ |
145 |
|
printargs(argc, argv, debugfp); /* header */ |
146 |
|
break; |
185 |
|
exit(1); |
186 |
|
} |
187 |
|
if (scanning) { /* load input picture header */ |
188 |
< |
#ifdef MSDOS |
196 |
< |
setmode(fileno(stdin), O_BINARY); |
197 |
< |
#endif |
188 |
> |
SET_FILE_BINARY(stdin); |
189 |
|
if (checkheader(stdin, COLRFMT, NULL) < 0 || |
190 |
|
fgetresolu(&xmax, &ymax, stdin) < 0) { |
191 |
|
fprintf(stderr, "%s: bad input picture\n", progname); |
353 |
|
scalecolor(inpRGB[i], d); |
354 |
|
inpflags |= 1L<<i; |
355 |
|
} |
356 |
< |
free((char *)scanln); |
356 |
> |
free((void *)scanln); |
357 |
|
} |
358 |
|
|
359 |
|
|
703 |
|
} |
704 |
|
/* clean up */ |
705 |
|
fclose(debugfp); |
706 |
< |
free((char *)scan); |
706 |
> |
free((void *)scan); |
707 |
|
} |
708 |
|
|
709 |
|
|
773 |
|
} |
774 |
|
/* clean up */ |
775 |
|
fclose(debugfp); |
776 |
< |
free((char *)scan); |
776 |
> |
free((void *)scan); |
777 |
|
} |
778 |
|
|
779 |
|
|