1 |
– |
/* Copyright (c) 1992 Regents of the University of California */ |
2 |
– |
|
1 |
|
#ifndef lint |
2 |
< |
static char SCCSid[] = "$SunId$ LBL"; |
2 |
> |
static const char RCSid[] = "$Id$"; |
3 |
|
#endif |
6 |
– |
|
4 |
|
/* |
5 |
|
* Find extrema points in a Radiance picture. |
6 |
|
*/ |
7 |
|
|
8 |
|
#include <stdio.h> |
9 |
< |
#ifdef MSDOS |
10 |
< |
#include <fcntl.h> |
11 |
< |
#endif |
9 |
> |
#include <math.h> |
10 |
> |
|
11 |
> |
#include "platform.h" |
12 |
|
#include "color.h" |
13 |
|
|
14 |
|
|
18 |
|
|
19 |
|
COLOR expos = WHTCOLOR; |
20 |
|
|
24 |
– |
extern char *malloc(); |
21 |
|
|
26 |
– |
|
22 |
|
headline(s) /* check header line */ |
23 |
|
char *s; |
24 |
|
{ |
28 |
|
|
29 |
|
if (isformat(s)) { /* format */ |
30 |
|
formatval(fmt, s); |
31 |
< |
wrongformat = strcmp(fmt, COLRFMT); |
31 |
> |
wrongformat = !globmatch(PICFMT, fmt); |
32 |
|
} |
33 |
|
if (!orig) |
34 |
< |
return; |
34 |
> |
return(0); |
35 |
|
if (isexpos(s)) { /* exposure */ |
36 |
|
d = exposval(s); |
37 |
|
scalecolor(expos, d); |
39 |
|
colcorval(ctmp, s); |
40 |
|
multcolor(expos, ctmp); |
41 |
|
} |
42 |
+ |
return(0); |
43 |
|
} |
44 |
|
|
45 |
|
|
54 |
|
COLR *scan; |
55 |
|
COLR cmin, cmax; |
56 |
|
int xmin, ymin, xmax, ymax; |
57 |
< |
#ifdef MSDOS |
58 |
< |
extern int _fmode; |
63 |
< |
_fmode = O_BINARY; |
64 |
< |
setmode(fileno(stdin), O_BINARY); |
65 |
< |
#endif |
57 |
> |
SET_DEFAULT_BINARY() |
58 |
> |
SET_FILE_BINARY(stdin); |
59 |
|
for (i = 1; i < argc; i++) /* get options */ |
60 |
|
if (!strcmp(argv[i], "-o")) |
61 |
|
orig++; |
102 |
|
} |
103 |
|
} |
104 |
|
} |
105 |
< |
free((char *)scan); |
105 |
> |
free((void *)scan); |
106 |
|
printf("%d %d\t%e %e %e\n", xmin, ymin, |
107 |
|
colrval(cmin,RED)/colval(expos,RED), |
108 |
|
colrval(cmin,GRN)/colval(expos,GRN), |