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.3 by greg, Wed Jan 29 15:18:20 1992 UTC vs.
Revision 2.7 by greg, Fri Jul 3 08:59:26 1992 UTC

# Line 49 | Line 49 | char  *argv[];
49                  dofilter++;
50                  argv++; argc--;
51          }
52 + #ifdef _IOLBF
53 +        stdout->_flag &= ~_IOLBF;
54 + #endif
55          if (argc < 2)
56                  status = printp(NULL) == -1;
57          else
# Line 68 | Line 71 | char  *fname;
71          int  i;
72  
73          if (dofilter) {
74 <                if (fname == NULL)
75 <                        fname = "";
76 <                sprintf(buf, FILTER, fname);
74 >                if (fname == NULL) {
75 >                        sprintf(buf, FILTER, "");
76 >                        fname = "<stdin>";
77 >                } else
78 >                        sprintf(buf, FILTER, fname);
79                  if ((input = popen(buf, "r")) == NULL) {
80                          fprintf(stderr, "Cannot execute: %s\n", buf);
81                          return(-1);
82                  }
78                fname = buf;
83          } else if (fname == NULL) {
84                  input = stdin;
85                  fname = "<stdin>";
# Line 93 | Line 97 | char  *fname;
97                  fprintf(stderr, "%s: bad picture size\n", fname);
98                  return(-1);
99          }
100 <        if (xres > NCOLS || yres > NROWS) {
100 >        if (xres > NCOLS) {
101                  fprintf(stderr, "%s: resolution mismatch\n", fname);
102                  return(-1);
103          }
# Line 101 | Line 105 | char  *fname;
105          fputs("\0333\042", stdout);
106                                  /* clear line buffer */
107          clearlbuf();
104 #ifdef _IOLBF
105        stdout->_flag &= ~_IOLBF;
106 #endif
108                                  /* put out scanlines */
109          for (i = yres-1; i >= 0; i--) {
110                  if (freadcolrs(scanline, xres, input) < 0) {
# Line 145 | Line 146 | int  y;
146                  fputs("\033\031", stdout);
147  
148                  for (j = 0; j < 3; j++) {
149 +                        i = (NCOLS + len)/2;            /* center image */
150                          fputs("\033%O", stdout);
151 <                        putchar(len & 255);
152 <                        putchar(len >> 8);
151 >                        putchar(i & 255);
152 >                        putchar(i >> 8);
153 >                        while (i-- > len) {
154 >                                putchar(0);
155 >                                putchar(0);
156 >                                putchar(0);
157 >                        }
158                          for (i = 0; i < len; i++) {
159                                  c = lpat[i][j] | colbit(scan[i],i,j);
160                                                          /* repeat this row */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines