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

Comparing ray/src/px/oki20c.c (file contents):
Revision 2.8 by greg, Fri Jul 3 10:46:25 1992 UTC vs.
Revision 2.9 by greg, Mon Sep 21 12:13:38 1992 UTC

# Line 9 | Line 9 | static char SCCSid[] = "$SunId$ LBL";
9   */
10  
11   #include  <stdio.h>
12 + #ifdef MSDOS
13 + #include  <fcntl.h>
14 + #endif
15  
16   #include  "color.h"
17   #include  "resolu.h"
18  
19 < #define  NROWS          1440            /* 10" at 144 dpi */
20 < #define  NCOLS          960             /* 8" at 120 dpi */
19 > #define  NROWS          1440            /* 10" at 144 dpi */
20 > #define  NCOLS          960             /* 8" at 120 dpi */
21  
22 < #define  ASPECT         (120./144.)     /* pixel aspect ratio */
22 > #define  ASPECT         (120./144.)     /* pixel aspect ratio */
23  
24 < #define  FILTER         "pfilt -1 -x %d -y %d -p %f %s",NCOLS,NROWS,ASPECT
24 > #define  FILTER         "pfilt -1 -x %d -y %d -p %f %s",NCOLS,NROWS,ASPECT
25  
26   /*
27 < *  Subtractive primaries are ordered:  Yellow, Magenta, Cyan.
27 > *  Subtractive primaries are ordered:  Yellow, Magenta, Cyan.
28   */
29  
30 < #define  sub_add(sub)   (2-(sub))       /* map subtractive to additive pri. */
30 > #define  sub_add(sub)   (2-(sub))       /* map subtractive to additive pri. */
31  
32   long  lpat[NCOLS][3];
33  
34   int  dofilter = 0;              /* filter through pfilt first? */
35  
36 + extern FILE  *popen();
37  
38 +
39   main(argc, argv)
40   int  argc;
41   char  *argv[];
42   {
43          int  i, status = 0;
44 <        
44 > #ifdef MSDOS
45 >        extern int  _fmode;
46 >        _fmode = O_BINARY;
47 >        setmode(fileno(stdin), O_BINARY);
48 >        setmode(fileno(stdout), O_BINARY);
49 > #endif
50          if (argc > 1 && !strcmp(argv[1], "-p")) {
51                  dofilter++;
52                  argv++; argc--;
# Line 146 | Line 156 | int  y;
156                  }
157                  for (i = 0; i < len; i++) {
158                          c = lpat[i][j] | colbit(scan[i],i,j);
159 <                        putchar(c>>16);
160 <                        putchar(c>>8 & 255);
161 <                        putchar(c & 255);
159 >                        putchar((int)(c>>16));
160 >                        putchar((int)(c>>8 & 255));
161 >                        putchar((int)(c & 255));
162                          if (y)                  /* repeat this row */
163                                  lpat[i][j] = (c & 1) << 23;
164                          else                    /* or clear for next image */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines