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

Comparing ray/src/cv/rad2mgf.c (file contents):
Revision 2.1 by greg, Thu Jul 7 17:30:33 1994 UTC vs.
Revision 2.10 by greg, Thu Apr 13 14:43:30 1995 UTC

# Line 9 | Line 9 | static char SCCSid[] = "$SunId$ LBL";
9   */
10  
11   #include <stdio.h>
12 + #include <math.h>
13   #include <string.h>
14   #include "fvect.h"
15   #include "object.h"
16   #include "color.h"
17   #include "lookup.h"
18  
19 + #define PI      3.14159265358979323846
20 +
21 + #define C_1SIDEDTHICK   0.005
22 +
23   int     o_face(), o_cone(), o_sphere(), o_ring(), o_cylinder();
24   int     o_instance(), o_source(), o_illum();
25 < int     o_plastic(), o_metal(), o_glass(), o_mirror(), o_trans(), o_light();
25 > int     o_plastic(), o_metal(), o_glass(), o_dielectric(),
26 >                o_mirror(), o_trans(), o_light();
27  
28   extern void     free();
29   extern char     *malloc();
# Line 26 | Line 32 | LUTAB  rmats = LU_SINIT(free,NULL);            /* defined materia
32  
33   LUTAB   rdispatch = LU_SINIT(NULL,NULL);        /* function dispatch table */
34  
35 < char    curmat[80];             /* current material */
35 > char    curmat[80];                             /* current material */
36 > char    curobj[128] = "Untitled";               /* current object name */
37  
38 < double  unit_mult = 1.;         /* units multiplier */
38 > double  unit_mult = 1.;                         /* units multiplier */
39  
40 + #define hasmult         (unit_mult < .999 || unit_mult > 1.001)
41  
42 + /*
43 + * Stuff for tracking and reusing vertices:
44 + */
45 +
46 + char    VKFMT[] = "%+16.9e %+16.9e %+16.9e";
47 + #define VKLEN           64
48 +
49 + #define mkvkey(k,v)     sprintf(k, VKFMT, (v)[0], (v)[1], (v)[2])
50 +
51 + #define NVERTS          256
52 +
53 + long    vclock;         /* incremented at each vertex request */
54 +
55 + struct vert {
56 +        long    lused;          /* when last used (0 if unassigned) */
57 +        FVECT   p;              /* track point position only */
58 + } vert[NVERTS];         /* our vertex cache */
59 +
60 + LUTAB   vertab = LU_SINIT(free,NULL);   /* our vertex lookup table */
61 +
62 +
63   main(argc, argv)
64   int     argc;
65   char    **argv;
# Line 57 | Line 86 | char   **argv;
86                                  goto unkopt;
87                          }
88                          break;
89 +                default:
90 +                        goto unkopt;
91                  }
92          init();
93          if (i >= argc)
# Line 85 | Line 116 | char   *inp;
116          register int    c;
117  
118          if (inp == NULL) {
119 <                inp = "the standard input";
119 >                inp = "standard input";
120                  fp = stdin;
121          } else if (inp[0] == '!') {
122                  if ((fp = popen(inp+1, "r")) == NULL) {
# Line 209 | Line 240 | char   *id;
240   {
241          if (!strcmp(id, curmat))        /* already set? */
242                  return;
243 +        if (!strcmp(id, VOIDID))        /* cannot set */
244 +                return;
245          printf("m %s\n", id);
246          strcpy(curmat, id);
247   }
248  
249  
250 + setobj(id)                      /* set object name to this one */
251 + char    *id;
252 + {
253 +        register char   *cp, *cp2;
254 +        char    *end = NULL;
255 +        int     diff = 0;
256 +                                /* use all but final suffix */
257 +        for (cp = id; *cp; cp++)
258 +                if (*cp == '.')
259 +                        end = cp;
260 +        if (end == NULL)
261 +                end = cp;
262 +                                /* copy to current object */
263 +        for (cp = id, cp2 = curobj; cp < end; *cp2++ = *cp++)
264 +                diff += *cp != *cp2;
265 +        if (!diff && !*cp2)
266 +                return;
267 +        *cp2 = '\0';
268 +        fputs("o\no ", stdout);
269 +        puts(curobj);
270 + }
271 +
272 +
273   init()                  /* initialize dispatch table and output */
274   {
275 +        lu_init(&vertab, NVERTS);
276          lu_init(&rdispatch, 22);
277          add2dispatch("polygon", o_face);
278          add2dispatch("cone", o_cone);
# Line 231 | Line 288 | init()                 /* initialize dispatch table and output */
288          add2dispatch("metal", o_metal);
289          add2dispatch("metal2", o_metal);
290          add2dispatch("glass", o_glass);
291 +        add2dispatch("dielectric", o_dielectric);
292          add2dispatch("trans", o_trans);
293          add2dispatch("trans2", o_trans);
294          add2dispatch("mirror", o_mirror);
# Line 239 | Line 297 | init()                 /* initialize dispatch table and output */
297          add2dispatch("glow", o_light);
298          add2dispatch("illum", o_illum);
299          puts("# The following was converted from Radiance scene input");
300 <        if (unit_mult < .999 || unit_mult > 1.001)
300 >        if (hasmult)
301                  printf("xf -s %.4e\n", unit_mult);
302 +        printf("o %s\n", curobj);
303   }
304  
305  
306   uninit()                        /* mark end of MGF file */
307   {
308 <        if (unit_mult < .999 || unit_mult > 1.001)
308 >        puts("o");
309 >        if (hasmult)
310                  puts("xf");
311          puts("# End of data converted from Radiance scene input");
312          lu_done(&rdispatch);
313          lu_done(&rmats);
314 +        lu_done(&vertab);
315   }
316  
317  
318 + clrverts()                      /* clear vertex table */
319 + {
320 +        register int    i;
321 +
322 +        lu_done(&vertab);
323 +        for (i = 0; i < NVERTS; i++)
324 +                vert[i].lused = 0;
325 +        lu_init(&vertab, NVERTS);
326 + }
327 +
328 +
329   add2dispatch(name, func)        /* add function to dispatch table */
330   char    *name;
331   int     (*func)();
# Line 271 | Line 343 | int    (*func)();
343   }
344  
345  
274 char    VKFMT[] = "%+1.9e %+1.9e %+1.9e";
275 #define VKLEN           64
276
277 #define mkvkey(k,v)     sprintf(k, VKFMT, (v)[0], (v)[1], (v)[2])
278
279 #define NVERTS          256
280
281 long    clock;          /* incremented at each vertex request */
282
283 struct vert {
284        long    lused;          /* when last used (0 if unassigned) */
285        FVECT   p;              /* track point position only */
286 } vert[NVERTS];
287
288 LUTAB   vertab = LU_SINIT(free,NULL);   /* our vertex lookup table */
289
290
346   char *
347 < getvertid(vp)                   /* get/set vertex ID for this point */
347 > getvertid(vname, vp)            /* get/set vertex ID for this point */
348 > char    *vname;
349   FVECT   vp;
350   {
351 <        static char     vname[6];
296 <        char    vkey[VKLEN];
351 >        static char     vkey[VKLEN];
352          register LUENT  *lp;
353          register int    i, vndx;
354  
355 <        if (!vertab.tsiz && !lu_init(&vertab, NVERTS))
301 <                goto memerr;
302 <        clock++;                        /* increment counter */
355 >        vclock++;                       /* increment counter */
356          mkvkey(vkey, vp);
357          if ((lp = lu_find(&vertab, vkey)) == NULL)
358                  goto memerr;
# Line 319 | Line 372 | FVECT  vp;
372                          mkvkey(vkey, vert[vndx].p);
373                          lu_delete(&vertab, vkey);
374                  }
375 <                vert[vndx].lused = clock;                       /* assign it */
376 <                VCOPY(vert[vndx].p, vp);
324 <                printf("v v%d =\np %.15g %.15g %.15g\n",        /* print it */
375 >                VCOPY(vert[vndx].p, vp);                        /* assign it */
376 >                printf("v v%d =\n\tp %.15g %.15g %.15g\n",      /* print it */
377                                  vndx, vp[0], vp[1], vp[2]);
378                  lp->data = (char *)&vert[vndx];                 /* set it */
379          } else
380                  vndx = (struct vert *)lp->data - vert;
381 +        vert[vndx].lused = vclock;              /* record this use */
382          sprintf(vname, "v%d", vndx);
383          return(vname);
384   memerr:
# Line 340 | Line 393 | char   *mod, *typ, *id;
393   FUNARGS *fa;
394   {
395          char    entbuf[512];
396 <        register char   *cp1, *cp2;
396 >        register char   *cp;
397          register int    i;
398  
399          if (fa->nfargs < 9 | fa->nfargs % 3)
400                  return(-1);
401          setmat(mod);
402 <        printf("o %s\n", id);
403 <        cp1 = entbuf;
404 <        *cp1++ = 'f';
402 >        setobj(id);
403 >        cp = entbuf;
404 >        *cp++ = 'f';
405          for (i = 0; i < fa->nfargs; i += 3) {
406 <                cp2 = getvertid(fa->farg + i);
407 <                *cp1++ = ' ';
408 <                while ((*cp1 = *cp2++))
409 <                        cp1++;
406 >                *cp++ = ' ';
407 >                getvertid(cp, fa->farg + i);
408 >                while (*cp)
409 >                        cp++;
410          }
411          puts(entbuf);
359        puts("o");
412          return(0);
413   }
414  
# Line 366 | Line 418 | o_cone(mod, typ, id, fa)       /* print out a cone */
418   char    *mod, *typ, *id;
419   register FUNARGS        *fa;
420   {
421 +        char    v1[6], v2[6];
422 +
423          if (fa->nfargs != 8)
424                  return(-1);
425          setmat(mod);
426 <        printf("o %s\n", id);
427 <        printf("v cv1 =\np %.12g %.12g %.12g\n",
428 <                        fa->farg[0], fa->farg[1], fa->farg[2]);
375 <        printf("v cv2 =\np %.12g %.12g %.12g\n",
376 <                        fa->farg[3], fa->farg[4], fa->farg[5]);
426 >        setobj(id);
427 >        getvertid(v1, fa->farg);
428 >        getvertid(v2, fa->farg + 3);
429          if (typ[1] == 'u')                      /* cup -> inverted cone */
430 <                printf("cone cv1 %.12g cv2 %.12g\n",
431 <                                -fa->farg[6], -fa->farg[7]);
430 >                printf("cone %s %.12g %s %.12g\n",
431 >                                v1, -fa->farg[6], v2, -fa->farg[7]);
432          else
433 <                printf("cone cv1 %.12g cv2 %.12g\n",
434 <                                fa->farg[6], fa->farg[7]);
383 <        puts("o");
433 >                printf("cone %s %.12g %s %.12g\n",
434 >                                v1, fa->farg[6], v2, fa->farg[7]);
435          return(0);
436   }
437  
# Line 390 | Line 441 | o_sphere(mod, typ, id, fa)     /* print out a sphere */
441   char    *mod, *typ, *id;
442   register FUNARGS        *fa;
443   {
444 +        char    cent[6];
445 +
446          if (fa->nfargs != 4)
447                  return(-1);
448          setmat(mod);
449 <        printf("o %s\n", id);
450 <        printf("v cent =\np %.12g %.12g %.12g\n",
451 <                        fa->farg[0], fa->farg[1], fa->farg[2]);
399 <        printf("sph cent %.12g\n", typ[0]=='b' ? -fa->farg[3] : fa->farg[3]);
400 <        puts("o");
449 >        setobj(id);
450 >        printf("sph %s %.12g\n", getvertid(cent, fa->farg),
451 >                        typ[0]=='b' ? -fa->farg[3] : fa->farg[3]);
452          return(0);
453   }
454  
# Line 407 | Line 458 | o_cylinder(mod, typ, id, fa)   /* print out a cylinder *
458   char    *mod, *typ, *id;
459   register FUNARGS        *fa;
460   {
461 +        char    v1[6], v2[6];
462 +
463          if (fa->nfargs != 7)
464                  return(-1);
465          setmat(mod);
466 <        printf("o %s\n", id);
467 <        printf("v cv1 =\np %.12g %.12g %.12g\n",
468 <                        fa->farg[0], fa->farg[1], fa->farg[2]);
469 <        printf("v cv2 =\np %.12g %.12g %.12g\n",
470 <                        fa->farg[3], fa->farg[4], fa->farg[5]);
418 <        printf("cyl cv1 %.12g cv2\n",
419 <                        typ[0]=='t' ? -fa->farg[6] : fa->farg[6]);
420 <        puts("o");
466 >        setobj(id);
467 >        getvertid(v1, fa->farg);
468 >        getvertid(v2, fa->farg + 3);
469 >        printf("cyl %s %.12g %s\n", v1,
470 >                        typ[0]=='t' ? -fa->farg[6] : fa->farg[6], v2);
471          return(0);
472   }
473  
# Line 430 | Line 480 | register FUNARGS       *fa;
480          if (fa->nfargs != 8)
481                  return(-1);
482          setmat(mod);
483 <        printf("o %s\n", id);
484 <        printf("v cent =\np %.12g %.12g %.12g\n",
483 >        setobj(id);
484 >        printf("v cent =\n\tp %.12g %.12g %.12g\n",
485                          fa->farg[0], fa->farg[1], fa->farg[2]);
486 <        printf("n %.12g %.12g %.12g\n",
486 >        printf("\tn %.12g %.12g %.12g\n",
487                          fa->farg[3], fa->farg[4], fa->farg[5]);
488          if (fa->farg[6] < fa->farg[7])
489                  printf("ring cent %.12g %.12g\n",
# Line 441 | Line 491 | register FUNARGS       *fa;
491          else
492                  printf("ring cent %.12g %.12g\n",
493                                  fa->farg[7], fa->farg[6]);
444        puts("o");
494          return(0);
495   }
496  
# Line 451 | Line 500 | o_instance(mod, typ, id, fa)   /* convert an instance */
500   char    *mod, *typ, *id;
501   FUNARGS *fa;
502   {
503 <        return(0);              /* this is too damned difficult! */
503 >        register int    i;
504 >        register char   *cp;
505 >        char    *start = NULL, *end = NULL;
506 >        /*
507 >         * We don't really know how to do this, so we just create
508 >         * a reference to an undefined MGF file and it's the user's
509 >         * responsibility to create this file and put the appropriate
510 >         * stuff into it.
511 >         */
512 >        if (fa->nsargs < 1)
513 >                return(-1);
514 >        setmat(mod);                    /* only works if surfaces are void */
515 >        setobj(id);
516 >        for (cp = fa->sarg[0]; *cp; cp++)       /* construct MGF file name */
517 >                if (*cp == '/')
518 >                        start = cp+1;
519 >                else if (*cp == '.')
520 >                        end = cp;
521 >        if (start == NULL)
522 >                start = fa->sarg[0];
523 >        if (end == NULL || start >= end)
524 >                end = cp;
525 >        fputs("i ", stdout);                    /* print include entity */
526 >        for (cp = start; cp < end; cp++)
527 >                putchar(*cp);
528 >        fputs(".mgf", stdout);                  /* add MGF suffix */
529 >        for (i = 1; i < fa->nsargs; i++) {      /* add transform */
530 >                putchar(' ');
531 >                fputs(fa->sarg[i], stdout);
532 >        }
533 >        putchar('\n');
534 >        clrverts();                     /* vertex id's no longer reliable */
535 >        return(0);
536   }
537  
538  
# Line 475 | Line 556 | FUNARGS        *fa;
556          }
557                                          /* else create invisible material */
558          newmat(id, NULL);
559 <        puts("ts 1 0");
559 >        puts("\tts 1 0");
560          return(0);
561   }
562  
# Line 493 | Line 574 | register FUNARGS       *fa;
574          newmat(id, NULL);
575          rrgb[0] = fa->farg[0]; rrgb[1] = fa->farg[1]; rrgb[2] = fa->farg[2];
576          rgb_cie(cxyz, rrgb);
577 <        puts("c");                              /* put diffuse component */
577 >        puts("\tc");                            /* put diffuse component */
578          d = cxyz[0] + cxyz[1] + cxyz[2];
579          if (d > FTINY)
580 <                printf("cxy %.4f %.4f\n", cxyz[0]/d, cxyz[1]/d);
581 <        printf("rd %.4f\n", cxyz[1]*(1. - fa->farg[3]));
582 <        puts("c");                              /* put specular component */
583 <        printf("rs %.4f %.4f\n", fa->farg[3],
584 <                        typ[7]=='2' ? .5*(fa->farg[4] + fa->farg[5]) :
585 <                                        fa->farg[4]);
580 >                printf("\t\tcxy %.4f %.4f\n", cxyz[0]/d, cxyz[1]/d);
581 >        printf("\trd %.4f\n", cxyz[1]*(1. - fa->farg[3]));
582 >        if (fa->farg[3] > FTINY) {              /* put specular component */
583 >                puts("\tc");
584 >                printf("\trs %.4f %.4f\n", fa->farg[3],
585 >                                typ[7]=='2' ? .5*(fa->farg[4] + fa->farg[5]) :
586 >                                                fa->farg[4]);
587 >        }
588          return(0);
589   }
590  
# Line 519 | Line 602 | register FUNARGS       *fa;
602          newmat(id, NULL);
603          rrgb[0] = fa->farg[0]; rrgb[1] = fa->farg[1]; rrgb[2] = fa->farg[2];
604          rgb_cie(cxyz, rrgb);
605 <        puts("c");                              /* put diffuse component */
605 >        puts("\tc");                            /* put diffuse component */
606          d = cxyz[0] + cxyz[1] + cxyz[2];
607          if (d > FTINY)
608 <                printf("cxy %.4f %.4f\n", cxyz[0]/d, cxyz[1]/d);
609 <        printf("rd %.4f\n", cxyz[1]*(1. - fa->farg[3]));
608 >                printf("\t\tcxy %.4f %.4f\n", cxyz[0]/d, cxyz[1]/d);
609 >        printf("\trd %.4f\n", cxyz[1]*(1. - fa->farg[3]));
610                                                  /* put specular component */
611 <        printf("rs %.4f %.4f\n", cxyz[1]*fa->farg[3],
611 >        printf("\trs %.4f %.4f\n", cxyz[1]*fa->farg[3],
612                          typ[5]=='2' ? .5*(fa->farg[4] + fa->farg[5]) :
613                                          fa->farg[4]);
614          return(0);
# Line 546 | Line 629 | register FUNARGS       *fa;
629          newmat(id, NULL);
630          if (fa->nfargs == 4)
631                  nrfr = fa->farg[3];
632 +        printf("\tir %f 0\n", nrfr);
633          F = (1. - nrfr)/(1. + nrfr);            /* use normal incidence */
634          F *= F;
635          for (i = 0; i < 3; i++) {
636 <                rrgb[i] = (1. - F)*(1. - F)/(1. - F*F*fa->farg[i]*fa->farg[i]);
553 <                trgb[i] = F * (1. + (1. - 2.*F)*fa->farg[i]) /
636 >                trgb[i] = fa->farg[i] * (1. - F)*(1. - F) /
637                                  (1. - F*F*fa->farg[i]*fa->farg[i]);
638 +                rrgb[i] = F * (1. + (1. - 2.*F)*fa->farg[i]) /
639 +                                (1. - F*F*fa->farg[i]*fa->farg[i]);
640          }
641          rgb_cie(cxyz, rrgb);                    /* put reflected component */
642 <        puts("c");
642 >        puts("\tc");
643          d = cxyz[0] + cxyz[1] + cxyz[2];
644          if (d > FTINY)
645 <                printf("cxy %.4f %.4f\n", cxyz[0]/d, cxyz[1]/d);
646 <        printf("rs %.4f 0\n", cxyz[1]);
645 >                printf("\t\tcxy %.4f %.4f\n", cxyz[0]/d, cxyz[1]/d);
646 >        printf("\trs %.4f 0\n", cxyz[1]);
647          rgb_cie(cxyz, trgb);                    /* put transmitted component */
648 <        puts("c");
648 >        puts("\tc");
649          d = cxyz[0] + cxyz[1] + cxyz[2];
650          if (d > FTINY)
651 <                printf("cxy %.4f %.4f\n", cxyz[0]/d, cxyz[1]/d);
652 <        printf("ts %.4f 0\n", cxyz[1]);
651 >                printf("\t\tcxy %.4f %.4f\n", cxyz[0]/d, cxyz[1]/d);
652 >        printf("\tts %.4f 0\n", cxyz[1]);
653          return(0);
654   }
655  
656  
657   int
658 + o_dielectric(mod, typ, id, fa)  /* convert a dielectric material */
659 + char    *mod, *typ, *id;
660 + register FUNARGS        *fa;
661 + {
662 +        COLOR   cxyz, trgb;
663 +        double  F, d;
664 +        register int    i;
665 +
666 +        if (fa->nfargs != 5)
667 +                return(-1);
668 +        newmat(id, NULL);
669 +        F = (1. - fa->farg[3])/(1. + fa->farg[3]);      /* normal incidence */
670 +        F *= F;
671 +        for (i = 0; i < 3; i++)
672 +                trgb[i] = (1. - F)*pow(fa->farg[i], C_1SIDEDTHICK/unit_mult);
673 +        printf("\tir %f 0\n", fa->farg[3]);     /* put index of refraction */
674 +        printf("\tsides 1\n");
675 +        puts("\tc");                            /* put reflected component */
676 +        printf("\trs %.4f 0\n", F);
677 +        rgb_cie(cxyz, trgb);                    /* put transmitted component */
678 +        puts("\tc");
679 +        d = cxyz[0] + cxyz[1] + cxyz[2];
680 +        if (d > FTINY)
681 +                printf("\t\tcxy %.4f %.4f\n", cxyz[0]/d, cxyz[1]/d);
682 +        printf("\tts %.4f 0\n", cxyz[1]);
683 +        return(0);
684 + }
685 +
686 +
687 + int
688   o_mirror(mod, typ, id, fa)      /* convert a mirror material */
689   char    *mod, *typ, *id;
690   register FUNARGS        *fa;
# Line 586 | Line 701 | register FUNARGS       *fa;
701          newmat(id, NULL);
702          rrgb[0] = fa->farg[0]; rrgb[1] = fa->farg[1]; rrgb[2] = fa->farg[2];
703          rgb_cie(cxyz, rrgb);
704 <        puts("c");                              /* put specular component */
704 >        puts("\tc");                            /* put specular component */
705          d = cxyz[0] + cxyz[1] + cxyz[2];
706          if (d > FTINY)
707 <                printf("cxy %.4f %.4f\n", cxyz[0]/d, cxyz[1]/d);
708 <        printf("rs %.4f 0\n", cxyz[1]);
707 >                printf("\t\tcxy %.4f %.4f\n", cxyz[0]/d, cxyz[1]/d);
708 >        printf("\trs %.4f 0\n", cxyz[1]);
709          return(0);
710   }
711  
# Line 619 | Line 734 | register FUNARGS       *fa;
734          newmat(id, NULL);
735          rrgb[0] = fa->farg[0]; rrgb[1] = fa->farg[1]; rrgb[2] = fa->farg[2];
736          rgb_cie(cxyz, rrgb);
737 <        puts("c");                              /* put transmitted diffuse */
737 >        puts("\tc");                            /* put transmitted diffuse */
738          d = cxyz[0] + cxyz[1] + cxyz[2];
739          if (d > FTINY)
740 <                printf("cxy %.4f %.4f\n", cxyz[0]/d, cxyz[1]/d);
741 <        printf("td %.4f\n", cxyz[1]*trans*(1. - fa->farg[3])*(1. - tspec));
740 >                printf("\t\tcxy %.4f %.4f\n", cxyz[0]/d, cxyz[1]/d);
741 >        printf("\ttd %.4f\n", cxyz[1]*trans*(1. - fa->farg[3])*(1. - tspec));
742                                                  /* put transmitted specular */
743 <        printf("ts %.4f %.4f\n", cxyz[1]*trans*tspec*(1. - fa->farg[3]), rough);
743 >        printf("\tts %.4f %.4f\n", cxyz[1]*trans*tspec*(1. - fa->farg[3]), rough);
744                                                  /* put reflected diffuse */
745 <        printf("rd %.4f\n", cxyz[1]*(1. - fa->farg[3])*(1. - trans));
746 <        puts("c");                              /* put reflected specular */
747 <        printf("rs %.4f %.4f\n", fa->farg[3], rough);
745 >        printf("\trd %.4f\n", cxyz[1]*(1. - fa->farg[3])*(1. - trans));
746 >        puts("\tc");                            /* put reflected specular */
747 >        printf("\trs %.4f %.4f\n", fa->farg[3], rough);
748          return(0);
749   }
750  
# Line 648 | Line 763 | register FUNARGS       *fa;
763          rrgb[0] = fa->farg[0]; rrgb[1] = fa->farg[1]; rrgb[2] = fa->farg[2];
764          rgb_cie(cxyz, rrgb);
765          d = cxyz[0] + cxyz[1] + cxyz[2];
766 <        puts("c");
766 >        puts("\tc");
767          if (d > FTINY)
768 <                printf("cxy %.4f %.4f\n", cxyz[0]/d, cxyz[1]/d);
769 <        printf("ed %.4g\n", cxyz[1]);
768 >                printf("\t\tcxy %.4f %.4f\n", cxyz[0]/d, cxyz[1]/d);
769 >        printf("\ted %.4g\n", cxyz[1]*(PI*WHTEFFICACY));
770          return(0);
771   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines