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

Comparing ray/src/px/pvalue.c (file contents):
Revision 2.16 by greg, Tue Feb 25 16:47:23 2003 UTC vs.
Revision 2.19 by schorsch, Sun Jun 8 12:03:10 2003 UTC

# Line 7 | Line 7 | static const char RCSid[] = "$Id$";
7   *     4/23/86
8   */
9  
10 #include  "standard.h"
11
12 #include  "color.h"
13
10   #include  <time.h>
11  
12 + #include  "standard.h"
13 + #include  "platform.h"
14 + #include  "color.h"
15   #include  "resolu.h"
16  
17   typedef unsigned short uint16;  /* sizeof (uint16) must == 2 */
# Line 23 | Line 22 | typedef        unsigned short uint16;  /* sizeof (uint16) must
22   #define  ALL            3
23   #define  BRIGHT         4
24  
26 #define  brightonly     (putprim==BRIGHT)
27
25   RESOLU  picres;                 /* resolution of picture */
26  
27   int  uniq = 0;                  /* print only unique values? */
# Line 219 | Line 216 | unkopt:
216                          break;
217                                          /* recognize special formats */
218          if (dataonly && format == 'b')
219 <                if (brightonly)
223 <                        fmtid = "8-bit_grey";
224 <                else
219 >                if (putprim == ALL)
220                          fmtid = "24-bit_rgb";
226        if (dataonly && format == 'w')
227                if (brightonly)
228                        fmtid = "16-bit_grey";
221                  else
222 +                        fmtid = "8-bit_grey";
223 +        if (dataonly && format == 'w')
224 +                if (putprim == ALL)
225                          fmtid = "48-bit_rgb";
226 +                else
227 +                        fmtid = "16-bit_grey";
228                                          /* assign reverse ordering */
229          rord[ord[0]] = 0;
230          rord[ord[1]] = 1;
# Line 241 | Line 238 | unkopt:
238                                                  progname, argv[i]);
239                          quit(1);
240                  }
241 <                if (reverse && !brightonly && i == argc-3) {
241 >                if (reverse && putprim != BRIGHT && i == argc-3) {
242                          if ((fin2 = fopen(argv[i+1], "r")) == NULL) {
243                                  fprintf(stderr, "%s: can't open file \"%s\"\n",
244                                                  progname, argv[i+1]);
# Line 255 | Line 252 | unkopt:
252                          interleave = -1;
253                  } else if (i != argc-1)
254                          fin = NULL;
255 <                if (reverse && !brightonly && !interleave) {
255 >                if (reverse && putprim != BRIGHT && !interleave) {
256                          fin2 = fopen(argv[i], "r");
257                          fin3 = fopen(argv[i], "r");
258                  }
# Line 273 | Line 270 | unkopt:
270          }
271  
272          if (reverse) {
273 < #ifdef MSDOS
274 <                setmode(fileno(stdout), O_BINARY);
273 > #ifdef _WIN32
274 >                SET_FILE_BINARY(stdout);
275                  if (format != 'a' && format != 'i')
276 <                        setmode(fileno(fin), O_BINARY);
276 >                        SET_FILE_BINARY(fin);
277   #endif
278                                          /* get header */
279                  if (header) {
# Line 321 | Line 318 | unkopt:
318                  fputsresolu(&picres, stdout);   /* always put resolution */
319                  valtopix();
320          } else {
321 < #ifdef MSDOS
322 <                setmode(fileno(fin), O_BINARY);
321 > #ifdef _WIN32
322 >                SET_FILE_BINARY(fin);
323                  if (format != 'a' && format != 'i')
324 <                        setmode(fileno(stdout), O_BINARY);
324 >                        SET_FILE_BINARY(stdout);
325   #endif
326                                                  /* get header */
327                  getheader(fin, checkhead, NULL);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines