20 |
|
* Radiance (θ,φ) luminaire coordinates and then apply photometric and |
21 |
|
* tilt data to generate Radiance light. θ is altitude from the |
22 |
|
* negative z-axis and φ is azimuth from the positive x-axis, |
23 |
< |
* increasing towards the positive y-axis. [??? Greg, is there a |
24 |
< |
* source for this convention?] This system matches none of the usual |
25 |
< |
* goniophotometric conventions, but it is closest to IES type C; V in |
26 |
< |
* type C photometry is θ in Radiance and L is -φ. |
23 |
> |
* increasing towards the positive y-axis. This system matches none of |
24 |
> |
* the usual goniophotometric conventions, but it is closest to IES |
25 |
> |
* type C; V in type C photometry is θ in Radiance and L is -φ. |
26 |
|
* |
27 |
|
* The ies2rad scene description for a luminaire LUM, with tilt data, |
28 |
|
* uses the following Radiance scene description primitives: |
206 |
|
#define U_METERS 2 |
207 |
|
|
208 |
|
/* string lengths */ |
209 |
< |
/* Maximum input line is 132 characters including CR LF at end. */ |
210 |
< |
#define MAXLINE 133 |
209 |
> |
/* Maximum input line is 256 characters including CR LF at end. */ |
210 |
> |
#define MAXLINE 257 |
211 |
|
#define RMAXWORD 76 |
212 |
|
|
213 |
|
/* End of LM-63-related #defines */ |
727 |
|
char *hdl /* header line */ |
728 |
|
) |
729 |
|
{ |
730 |
+ |
/* Skip leading spaces */ |
731 |
+ |
while (isspace(*hdl)) |
732 |
+ |
hdl++; |
733 |
|
/* The line has to begin with '[' */ |
734 |
|
if (*hdl++ != '[') |
735 |
|
return(0); |
865 |
|
* in the "[LAMP]" and "[LAMPCAT]" keyword lines; |
866 |
|
* otherwise check all lines. */ |
867 |
|
if (lampcolor == NULL && checklamp(buf)) |
868 |
< |
lampcolor = matchlamp( buf[0] == '[' ? |
868 |
> |
lampcolor = matchlamp(*sskip2(buf,0) == '[' ? |
869 |
|
keyargs(buf) : buf ); |
870 |
|
/* Look for a materials and geometry file in the keywords. */ |
871 |
|
if (keymatch(K_LMG, buf)) { |
886 |
|
} else if (lamptype == NULL) |
887 |
|
fprintf(outfp,"# CIE(x,y) = (%f,%f)\n# Depreciation = %.1f%%\n", |
888 |
|
lampcolor[3], lampcolor[4], 100.*lampcolor[5]); |
889 |
+ |
|
890 |
|
/* If the file ended before a "TILT=" line, that's an error. */ |
891 |
|
if (feof(inpfp)) { |
892 |
|
fprintf(stderr, "%s: not in IES format\n", inpname); |