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.12 by schorsch, Thu Jun 5 19:29:34 2003 UTC vs.
Revision 2.16 by schorsch, Sun Mar 28 20:33:14 2004 UTC

# Line 9 | Line 9 | static const char      RCSid[] = "$Id$";
9   #include  <time.h>
10  
11   #include  "platform.h"
12 + #include  "rtprocess.h"
13   #include  "color.h"
14   #include  "resolu.h"
15  
# Line 17 | Line 18 | static const char      RCSid[] = "$Id$";
18  
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",NCOLS,NROWS,ASPECT
22 > #define  FILTER_F       "pfilt -1 -x %d -y %d -p %f \"%s\"",NCOLS,NROWS,ASPECT
23  
24   /*
25   *  Subtractive primaries are ordered:  Yellow, Magenta, Cyan.
# Line 29 | Line 31 | long  lpat[NCOLS][3];
31  
32   int  dofilter = 0;              /* filter through pfilt first? */
33  
34 < extern FILE  *popen();
34 > static int printp(char  *fname);
35 > static void plotscan(COLR  scan[], int  len, int  y);
36 > static int colbit(COLR  col, int  x, int  s);
37  
38  
39 < main(argc, argv)
40 < int  argc;
41 < char  *argv[];
39 > int
40 > main(
41 >        int  argc,
42 >        char  *argv[]
43 > )
44   {
45          int  i, status = 0;
46          SET_DEFAULT_BINARY();
# Line 53 | Line 59 | char  *argv[];
59   }
60  
61  
62 < printp(fname)                           /* print a picture */
63 < char  *fname;
62 > static int
63 > printp(                         /* print a picture */
64 >        char  *fname
65 > )
66   {
67 <        char  buf[64];
67 >        char  buf[PATH_MAX];
68          FILE  *input;
69          int  xres, yres;
70          COLR  scanline[NCOLS];
# Line 64 | Line 72 | char  *fname;
72  
73          if (dofilter) {
74                  if (fname == NULL) {
75 <                        sprintf(buf, FILTER, "");
75 >                        sprintf(buf, FILTER);
76                          fname = "<stdin>";
77                  } else
78 <                        sprintf(buf, FILTER, fname);
78 >                        sprintf(buf, FILTER_F, fname);
79                  if ((input = popen(buf, "r")) == NULL) {
80                          fprintf(stderr, "Cannot execute: %s\n", buf);
81                          return(-1);
# Line 116 | Line 124 | char  *fname;
124   }
125  
126  
127 < plotscan(scan, len, y)                  /* plot a scanline */
128 < COLR  scan[];
129 < int  len;
130 < int  y;
127 > static void
128 > plotscan(                       /* plot a scanline */
129 >        COLR  scan[],
130 >        int  len,
131 >        int  y
132 > )
133   {
134          int  bpos;
135          register long  c;
136          register int  i, j;
137  
138 <        if (bpos = y % 23) {
138 >        if ( (bpos = y % 23) ) {
139  
140                  for (j = 0; j < 3; j++)
141                          for (i = 0; i < len; i++)
# Line 161 | Line 171 | int  y;
171   }
172  
173  
174 < colbit(col, x, s)               /* determine bit value for primary at x */
175 < COLR  col;
176 < register int  x;
177 < int  s;
174 > static int
175 > colbit(         /* determine bit value for primary at x */
176 >        COLR  col,
177 >        register int  x,
178 >        int  s
179 > )
180   {
181          static int  cerr[NCOLS][3];
182          static int  err[3];

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines