MCPcopy Create free account
hub / github.com/TheRealMJP/DeferredTexturing / XYZToRGB

Function XYZToRGB

SampleFramework12/v1.00/Graphics/Spectrum.h:51–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49extern float AverageSpectrumSamples(const float *lambda, const float *vals,
50 int n, float lambdaStart, float lambdaEnd);
51inline 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
57inline void RGBToXYZ(const float rgb[3], float xyz[3]) {
58 xyz[0] = 0.412453f * rgb[0] + 0.357580f * rgb[1] + 0.180423f * rgb[2];

Callers 3

ToRGBMethod · 0.85
FromXYZMethod · 0.85
FromXYZMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected