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

Comparing ray/src/px/macbethcal.c (file contents):
Revision 2.17 by greg, Sat Feb 22 02:07:27 2003 UTC vs.
Revision 2.20 by schorsch, Sun Jul 27 22:12:03 2003 UTC

# Line 12 | Line 12 | static const char      RCSid[] = "$Id$";
12  
13   #include <stdio.h>
14   #include <math.h>
15 < #ifdef MSDOS
16 < #include <fcntl.h>
17 < #endif
18 < #include  <time.h>
15 > #include <time.h>
16 >
17 > #include "platform.h"
18   #include "color.h"
19   #include "resolu.h"
20   #include "pmap.h"
# Line 141 | Line 140 | char   **argv;
140                                  perror(argv[i]);
141                                  exit(1);
142                          }
143 < #ifdef MSDOS
145 <                        setmode(fileno(debugfp), O_BINARY);
146 < #endif
143 >                        SET_FILE_BINARY(debugfp);
144                          newheader("RADIANCE", debugfp);         /* start */
145                          printargs(argc, argv, debugfp);         /* header */
146                          break;
# Line 188 | Line 185 | char   **argv;
185                  exit(1);
186          }
187          if (scanning) {                 /* load input picture header */
188 < #ifdef MSDOS
192 <                setmode(fileno(stdin), O_BINARY);
193 < #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);
# Line 246 | Line 241 | char   **argv;
241                  printf("}\n");
242                  putmapping();                   /* put out color mapping */
243          }
244 <        if (debugfp != NULL)            /* put out debug picture */
244 >        if (debugfp != NULL) {          /* put out debug picture */
245                  if (scanning)
246                          picdebug();
247                  else
248                          clrdebug();
249 +        }
250          exit(0);
251   userr:
252          fprintf(stderr,
# Line 370 | Line 366 | getcolors()                    /* get xyY colors from standard input */
366          float   xyYin[3];
367  
368          while (fgetval(stdin, 'i', &n) == 1) {          /* read colors */
369 <                if (n < 0 | n > 24 ||
369 >                if ((n < 0) | (n > 24) ||
370                                  fgetval(stdin, 'f', &xyYin[0]) != 1 ||
371                                  fgetval(stdin, 'f', &xyYin[1]) != 1 ||
372                                  fgetval(stdin, 'f', &xyYin[2]) != 1 ||
373 <                                xyYin[0] < 0. | xyYin[1] < 0. ||
373 >                                (xyYin[0] < 0.) | (xyYin[1] < 0.) ||
374                                  xyYin[0] + xyYin[1] > 1.) {
375                          fprintf(stderr, "%s: bad color input data\n",
376                                          progname);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines