ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/px/pextrem.c
(Generate patch)

Comparing ray/src/px/pextrem.c (file contents):
Revision 2.3 by greg, Tue Oct 19 17:23:31 1993 UTC vs.
Revision 2.6 by schorsch, Thu Jun 5 19:29:34 2003 UTC

# Line 1 | Line 1
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   #include  <math.h>
10 < #ifdef MSDOS
11 < #include  <fcntl.h>
15 < #endif
10 >
11 > #include  "platform.h"
12   #include  "color.h"
13  
14  
# Line 22 | Line 18 | int  wrongformat = 0;
18  
19   COLOR  expos = WHTCOLOR;
20  
25 extern char  *malloc();
21  
27
22   headline(s)                     /* check header line */
23   char  *s;
24   {
# Line 34 | Line 28 | char  *s;
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);
# Line 45 | Line 39 | char  *s;
39                  colcorval(ctmp, s);
40                  multcolor(expos, ctmp);
41          }
42 +        return(0);
43   }
44  
45  
# Line 59 | Line 54 | char  *argv[];
54          COLR  *scan;
55          COLR  cmin, cmax;
56          int  xmin, ymin, xmax, ymax;
57 < #ifdef MSDOS
58 <        extern int  _fmode;
64 <        _fmode = O_BINARY;
65 <        setmode(fileno(stdin), O_BINARY);
66 < #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++;
# Line 110 | Line 102 | char  *argv[];
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),

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines