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.9 by greg, Sat Feb 22 02:07:27 2003 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1992 Regents of the University of California */
2
1   #ifndef lint
2 < static char SCCSid[] = "$SunId$ LBL";
2 > static const char       RCSid[] = "$Id$";
3   #endif
6
4   /*
5 < *  oki20c.c - program to dump pixel file to OkiMate 20 color printer.
5 > *  oki20.c - program to dump pixel file to OkiMate 20 printer.
6   */
7  
8   #include  <stdio.h>
9 + #ifdef MSDOS
10 + #include  <fcntl.h>
11 + #endif
12 + #include  <time.h>
13  
14   #include  "color.h"
15   #include  "resolu.h"
16  
17 < #define  NROWS          1440            /* 10" at 144 dpi */
18 < #define  NCOLS          960             /* 8" at 120 dpi */
17 > #define  NROWS          1440            /* 10" at 144 dpi */
18 > #define  NCOLS          960             /* 8" at 120 dpi */
19  
20 < #define  ASPECT         (120./144.)     /* pixel aspect ratio */
20 > #define  ASPECT         (120./144.)     /* pixel aspect ratio */
21  
22 < #define  FILTER         "pfilt -1 -x %d -y %d -p %f %s",NCOLS,NROWS,ASPECT
22 > #define  FILTER         "pfilt -1 -x %d -y %d -p %f %s",NCOLS,NROWS,ASPECT
23  
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
24   long  lpat[NCOLS];
25  
26   int  dofilter = 0;              /* filter through pfilt first? */
27  
28 + extern FILE  *popen();
29  
30 +
31   main(argc, argv)
32   int  argc;
33   char  *argv[];
34   {
35          int  i, status = 0;
36 <        
36 > #ifdef MSDOS
37 >        extern int  _fmode;
38 >        _fmode = O_BINARY;
39 >        setmode(fileno(stdin), O_BINARY);
40 >        setmode(fileno(stdout), O_BINARY);
41 > #endif
42          if (argc > 1 && !strcmp(argv[1], "-p")) {
43                  dofilter++;
44                  argv++; argc--;
45          }
44 #ifdef _IOLBF
45        stdout->_flag &= ~_IOLBF;
46 #endif
46          if (argc < 2)
47                  status = printp(NULL) == -1;
48          else
# Line 95 | Line 94 | char  *fname;
94          }
95                                  /* set line spacing (overlap for knitting) */
96          fputs("\0333\042\022", stdout);
98                                /* clear line buffer */
99        clearlbuf();
97                                  /* put out scanlines */
98          for (i = yres-1; i >= 0; i--) {
99                  if (freadcolrs(scanline, xres, input) < 0) {
# Line 154 | Line 151 | int  y;
151          putchar(i >> 8);
152          for (i = start; i <= end; i++) {
153                  c = lpat[i];
154 <                putchar(c>>16);
155 <                putchar(c>>8 & 255);
156 <                putchar(c & 255);
157 <                                        /* repeat this row next time */
158 <                lpat[i] = (c & 1) << 23;
154 >                putchar((int)(c>>16));
155 >                putchar((int)(c>>8 & 255));
156 >                putchar((int)(c & 255));
157 >                if (y)                  /* repeat this row next time */
158 >                        lpat[i] = (c & 1) << 23;
159 >                else                    /* or clear for next image */
160 >                        lpat[i] = 0L;
161          }
162          putchar('\r');
163          putchar('\n');

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines