Fix scaling ranges to be the same as they used to be.
authorCarl Hetherington <cth@carlh.net>
Fri, 6 May 2022 08:32:02 +0000 (10:32 +0200)
committerCarl Hetherington <cth@carlh.net>
Fri, 6 May 2022 21:47:55 +0000 (23:47 +0200)
src/rgb_xyz.cc

index bbd06a97db3cbb2b083f187f2369f2c7f62315f6..5c01f1c52d8a3906850cc76dda0a5b2a69b0b893 100644 (file)
@@ -321,9 +321,9 @@ dcp::rgb_to_xyz (
                        d.z = min (1.0, d.z);
 
                        /* Out gamma LUT */
-                       *xyz_x++ = lrint((d.x < piece ? lut_out_low[lrint((d.x / piece) * 65536)] : lut_out_high[lrint(((d.x - piece) / (1 - piece)) * 4096)]) * 4095);
-                       *xyz_y++ = lrint((d.y < piece ? lut_out_low[lrint((d.y / piece) * 65536)] : lut_out_high[lrint(((d.y - piece) / (1 - piece)) * 4096)]) * 4095);
-                       *xyz_z++ = lrint((d.z < piece ? lut_out_low[lrint((d.z / piece) * 65536)] : lut_out_high[lrint(((d.z - piece) / (1 - piece)) * 4096)]) * 4095);
+                       *xyz_x++ = lrint((d.x < piece ? lut_out_low[lrint((d.x / piece) * 65535)] : lut_out_high[lrint(((d.x - piece) / (1 - piece)) * 4095)]) * 4095);
+                       *xyz_y++ = lrint((d.y < piece ? lut_out_low[lrint((d.y / piece) * 65535)] : lut_out_high[lrint(((d.y - piece) / (1 - piece)) * 4095)]) * 4095);
+                       *xyz_z++ = lrint((d.z < piece ? lut_out_low[lrint((d.z / piece) * 65535)] : lut_out_high[lrint(((d.z - piece) / (1 - piece)) * 4095)]) * 4095);
                }
        }