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

Comparing ray/src/px/pfilt.c (file contents):
Revision 1.12 by greg, Wed Nov 28 11:13:23 1990 UTC vs.
Revision 1.14 by greg, Sat Dec 8 13:23:47 1990 UTC

# Line 17 | Line 17 | static char SCCSid[] = "$SunId$ LBL";
17   #include  "color.h"
18  
19   extern char  *malloc();
20 + extern float  *matchlamp();
21  
22   #define  CHECKRAD       1.5     /* radius to check for filtering */
23  
# Line 44 | Line 45 | double  spread = 1e-4;         /* spread for star points */
45  
46   char  *tfname = NULL;
47  
48 + char  *lampdat = "lamp.tab";    /* lamp data file */
49 +
50   int  xres, yres;                /* resolution of input */
51   double  inpaspect = 1.0;        /* pixel aspect ratio of input */
52   int  correctaspect = 0;         /* aspect ratio correction? */
# Line 67 | Line 70 | char  **argv;
70          extern long  ftell();
71          extern int  quit(), headline();
72          FILE  *fin;
73 +        float  *lampcolor;
74 +        char  *lamptype = NULL;
75          long  fpos;
76          double  outaspect = 0.0;
77          double  d;
# Line 134 | Line 139 | char  **argv;
139                                  }
140                                  i++;
141                                  break;
142 +                        case 'f':
143 +                                lampdat = argv[++i];
144 +                                break;
145 +                        case 't':
146 +                                lamptype = argv[++i];
147 +                                break;
148                          case '1':
149                                  singlepass = 1;
150                                  break;
# Line 167 | Line 178 | char  **argv;
178                          }
179                  else
180                          break;
181 <                        
181 >                                        /* get lamp data (if necessary) */
182 >        if (lamptype != NULL) {
183 >                if (loadlamps(lampdat) < 0)
184 >                        quit(1);
185 >                if ((lampcolor = matchlamp(lamptype)) == NULL) {
186 >                        fprintf(stderr, "%s: unknown lamp type\n", lamptype);
187 >                        quit(1);
188 >                }
189 >                colval(exposure,RED) /= lampcolor[0];
190 >                colval(exposure,GRN) /= lampcolor[1];
191 >                colval(exposure,BLU) /= lampcolor[2];
192 >                freelamps();
193 >        }
194 >                                        /* open input file */
195          if (i == argc) {
196                  if (singlepass)
197                          fin = stdin;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines