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

Comparing ray/src/cv/mgf2rad.c (file contents):
Revision 2.34 by greg, Fri Jan 5 16:33:36 2024 UTC vs.
Revision 2.35 by greg, Wed Jan 17 00:43:45 2024 UTC

# Line 26 | Line 26 | double  emult = 1.;                    /* emitter multiplier */
26  
27   FILE    *matfp;                         /* material output file */
28  
29 + int     dospectra = 0;                  /* output spectral colors? */
30  
31 +
32   extern int r_comment(int ac, char **av);
33   extern int r_color(int ac, char **av);
34   extern int r_cone(int ac, char **av);
# Line 107 | Line 109 | main(
109                          }
110                          printf(" %s", argv[i]);
111                          break;
112 +                case 's':                       /* spectral color output? */
113 +                        dospectra = !dospectra;
114 +                        break;
115                  default:
116                          goto userr;
117                  }
# Line 132 | Line 137 | main(
137                  }
138          exit(0);
139   userr:
140 <        fprintf(stderr, "Usage: %s [-g dist][-e mult][-m matf] [file.mgf] ..\n",
140 >        fprintf(stderr, "Usage: %s [-s][-g dist][-e mult][-m matf] [file.mgf] ..\n",
141                          argv[0]);
142          exit(1);
143   }
# Line 688 | Line 693 | specolor(      /* check if color has spectra and output acc
693          double  mult;
694          int     cbeg, cend, i;
695  
696 <        if (!(clr->flags & C_CDSPEC)) {         /* not defined spectrally? */
696 >        if (!dospectra | !(clr->flags & C_CDSPEC)) {
697                  cvtcolor(radrgb, clr, intensity);
698 <                return("void");
698 >                return("void");                 /* just use RGB */
699          }
700          setcolor(radrgb, intensity, intensity, intensity);
701          for (cbeg = 0; cbeg < C_CNSS; cbeg++)   /* trim zeros off beginning */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines