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.14 by schorsch, Mon Oct 27 10:24:51 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.
6   */
7  
8   #include  <stdio.h>
9 + #include  <time.h>
10  
11 + #include  "platform.h"
12 + #include  "rtprocess.h"
13   #include  "color.h"
14   #include  "resolu.h"
15  
16 < #define  NROWS          1440            /* 10" at 144 dpi */
17 < #define  NCOLS          960             /* 8" at 120 dpi */
16 > #define  NROWS          1440            /* 10" at 144 dpi */
17 > #define  NCOLS          960             /* 8" at 120 dpi */
18  
19 < #define  ASPECT         (120./144.)     /* pixel aspect ratio */
19 > #define  ASPECT         (120./144.)     /* pixel aspect ratio */
20  
21 < #define  FILTER         "pfilt -1 -x %d -y %d -p %f %s",NCOLS,NROWS,ASPECT
21 > #define  FILTER         "pfilt -1 -x %d -y %d -p %f %s",NCOLS,NROWS,ASPECT
22  
23   /*
24 < *  Subtractive primaries are ordered:  Yellow, Magenta, Cyan.
24 > *  Subtractive primaries are ordered:  Yellow, Magenta, Cyan.
25   */
26  
27 < #define  sub_add(sub)   (2-(sub))       /* map subtractive to additive pri. */
27 > #define  sub_add(sub)   (2-(sub))       /* map subtractive to additive pri. */
28  
29   long  lpat[NCOLS][3];
30  
# Line 36 | Line 36 | int  argc;
36   char  *argv[];
37   {
38          int  i, status = 0;
39 <        
39 >        SET_DEFAULT_BINARY();
40 >        SET_FILE_BINARY(stdin);
41 >        SET_FILE_BINARY(stdout);
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 125 | Line 124 | int  y;
124          register long  c;
125          register int  i, j;
126  
127 <        if (bpos = y % 23) {
127 >        if ( (bpos = y % 23) ) {
128  
129                  for (j = 0; j < 3; j++)
130                          for (i = 0; i < len; i++)
# Line 146 | Line 145 | int  y;
145                  }
146                  for (i = 0; i < len; i++) {
147                          c = lpat[i][j] | colbit(scan[i],i,j);
148 <                        putchar(c>>16);
149 <                        putchar(c>>8 & 255);
150 <                        putchar(c & 255);
148 >                        putchar((int)(c>>16));
149 >                        putchar((int)(c>>8 & 255));
150 >                        putchar((int)(c & 255));
151                          if (y)                  /* repeat this row */
152                                  lpat[i][j] = (c & 1) << 23;
153                          else                    /* or clear for next image */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines