ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/cv/lampcolor.c
Revision: 1.1
Committed: Thu Mar 14 13:55:03 1991 UTC (33 years, 7 months ago) by greg
Content type: text/plain
Branch: MAIN
Log Message:
Initial revision

File Contents

# User Rev Content
1 greg 1.1 /* Copyright (c) 1991 Regents of the University of California */
2    
3     #ifndef lint
4     static char SCCSid[] = "$SunId$ LBL";
5     #endif
6    
7     /*
8     * Do dah program to convert lamp color from table.
9     */
10    
11     #include <stdio.h>
12    
13     extern float *matchlamp();
14    
15    
16     main(argc, argv)
17     int argc;
18     char *argv[];
19     {
20     char *lamptab = "lamp.tab";
21     float *lcol;
22     char buf[80];
23    
24     if (argc > 1) lamptab = argv[1];
25     if (loadlamps(lamptab) == 0) {
26     perror(lamptab);
27     exit(1);
28     }
29     for ( ; ; ) {
30     printf("Enter lamp type: ");
31     buf[0] = '\0';
32     gets(buf);
33     if (!buf[0]) exit(0);
34     if ((lcol = matchlamp(buf)) == NULL)
35     printf("No match in table\n");
36     else
37     printf("RGB = (%f,%f,%f)\n", lcol[0], lcol[1], lcol[2]);
38     }
39     }