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

Comparing ray/src/px/oki20.c (file contents):
Revision 2.5 by greg, Fri Jul 3 10:46:27 1992 UTC vs.
Revision 2.8 by greg, Mon Aug 2 14:39:06 1993 UTC

# Line 5 | Line 5 | static char SCCSid[] = "$SunId$ LBL";
5   #endif
6  
7   /*
8 < *  oki20c.c - program to dump pixel file to OkiMate 20 color printer.
8 > *  oki20.c - program to dump pixel file to OkiMate 20 printer.
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   long  lpat[NCOLS];
27  
28   int  dofilter = 0;              /* filter through pfilt first? */
29  
30 + extern FILE  *popen();
31  
32 +
33   main(argc, argv)
34   int  argc;
35   char  *argv[];
36   {
37          int  i, status = 0;
38 <        
38 > #ifdef MSDOS
39 >        extern int  _fmode;
40 >        _fmode = O_BINARY;
41 >        setmode(fileno(stdin), O_BINARY);
42 >        setmode(fileno(stdout), O_BINARY);
43 > #endif
44          if (argc > 1 && !strcmp(argv[1], "-p")) {
45                  dofilter++;
46                  argv++; argc--;
47          }
38 #ifdef _IOLBF
39        stdout->_flag &= ~_IOLBF;
40 #endif
48          if (argc < 2)
49                  status = printp(NULL) == -1;
50          else
# Line 146 | Line 153 | int  y;
153          putchar(i >> 8);
154          for (i = start; i <= end; i++) {
155                  c = lpat[i];
156 <                putchar(c>>16);
157 <                putchar(c>>8 & 255);
158 <                putchar(c & 255);
156 >                putchar((int)(c>>16));
157 >                putchar((int)(c>>8 & 255));
158 >                putchar((int)(c & 255));
159                  if (y)                  /* repeat this row next time */
160                          lpat[i] = (c & 1) << 23;
161                  else                    /* or clear for next image */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines