| 49 | extern float AverageSpectrumSamples(const float *lambda, const float *vals, |
| 50 | int n, float lambdaStart, float lambdaEnd); |
| 51 | inline void XYZToRGB(const float xyz[3], float rgb[3]) { |
| 52 | rgb[0] = 3.240479f * xyz[0] - 1.537150f * xyz[1] - 0.498535f * xyz[2]; |
| 53 | rgb[1] = -0.969256f * xyz[0] + 1.875991f * xyz[1] + 0.041556f * xyz[2]; |
| 54 | rgb[2] = 0.055648f * xyz[0] - 0.204043f * xyz[1] + 1.057311f * xyz[2]; |
| 55 | } |
| 56 | |
| 57 | inline void RGBToXYZ(const float rgb[3], float xyz[3]) { |
| 58 | xyz[0] = 0.412453f * rgb[0] + 0.357580f * rgb[1] + 0.180423f * rgb[2]; |