ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/px/panim.c
(Generate patch)

Comparing ray/src/px/panim.c (file contents):
Revision 1.4 by greg, Fri Jan 26 08:17:35 1990 UTC vs.
Revision 1.5 by greg, Wed Feb 28 11:39:09 1990 UTC

# Line 20 | Line 20 | static char SCCSid[] = "$SunId$ LBL";
20  
21   #define GAMMA           2.0             /* gamma correction factor */
22  
23 + FILE    *popen();
24 +
25 + char    *pcom = NULL;                   /* pipe command */
26 +
27   BYTE    gammamap[256];                  /* gamma correction table */
28  
29  
# Line 35 | Line 39 | char   *argv[];
39          for (progname = *argv++; --argc; argv++)
40                  if (!strcmp(*argv, "-p") && argv[1]) {
41                          port = atoi(*++argv); argc--;
42 +                } else if (!strcmp(*argv, "-u") && argv[1]) {
43 +                        pcom = *++argv; argc--;
44                  } else
45                          break;
46          if (!argc) {
47                  fputs("Usage: ", stderr);
48                  fputs(progname, stderr);
49 <                fputs(" [-p port] hostname [-c copies][-r record] [frame] ..\n",
49 >                fputs(" [-p port] [-u uncompress] hostname [-c copies][-r record] [frame] ..\n",
50                                  stderr);
51                  exit(1);
52          }
# Line 71 | Line 77 | char   *argv[];
77   sendframe(file)                 /* convert and send a frame */
78   char    *file;
79   {
80 +        char    command[128];
81          COLR    scanin[SCANLINE];
82          int     xres, yres;
83          int     xbeg, ybeg;
# Line 79 | Line 86 | char   *file;
86          register int    x;
87                                                  /* open file */
88          if (file == NULL) {
89 <                fp = stdin;
89 >                if (pcom != NULL)
90 >                        fp = popen(pcom, "r");
91 >                else
92 >                        fp = stdin;
93                  file = "<stdin>";
94 <        } else if ((fp = fopen(file, "r")) == NULL) {
94 >        } else {
95 >                if (pcom != NULL) {
96 >                        sprintf(command, "( %s ) < %s", pcom, file);
97 >                        fp = popen(command, "r");
98 >                } else
99 >                        fp = fopen(file, "r");
100 >        }
101 >        if (fp == NULL) {
102                  perror(file);
103                  exit(1);
104          }
# Line 115 | Line 132 | char   *file;
132                                                  /* send frame */
133          scry_send_frame();
134                                                  /* close file */
135 <        fclose(fp);
135 >        if (pcom != NULL)
136 >                pclose(fp);
137 >        else
138 >                fclose(fp);
139   }
140  
141  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines