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 |
|
|
} |