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.4 by greg, Fri Jul 3 10:30:07 1992 UTC vs.
Revision 2.7 by greg, Thu Oct 8 10:05:20 1992 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  
23 #ifdef  BSD
24 #define  clearlbuf()    bzero((char *)lpat, sizeof(lpat))
25 #else
26 #define  clearlbuf()    (void)memset((char *)lpat, 0, sizeof(lpat))
27 #endif
28
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--;
# Line 95 | Line 99 | char  *fname;
99          }
100                                  /* set line spacing (overlap for knitting) */
101          fputs("\0333\042\022", stdout);
98                                /* clear line buffer */
99        clearlbuf();
102                                  /* put out scanlines */
103          for (i = yres-1; i >= 0; i--) {
104                  if (freadcolrs(scanline, xres, input) < 0) {
# Line 154 | Line 156 | int  y;
156          putchar(i >> 8);
157          for (i = start; i <= end; i++) {
158                  c = lpat[i];
159 <                putchar(c>>16);
160 <                putchar(c>>8 & 255);
161 <                putchar(c & 255);
162 <                                        /* repeat this row next time */
163 <                lpat[i] = (c & 1) << 23;
159 >                putchar((int)(c>>16));
160 >                putchar((int)(c>>8 & 255));
161 >                putchar((int)(c & 255));
162 >                if (y)                  /* repeat this row next time */
163 >                        lpat[i] = (c & 1) << 23;
164 >                else                    /* or clear for next image */
165 >                        lpat[i] = 0L;
166          }
167          putchar('\r');
168          putchar('\n');

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines