Fix erroneous extra character.
[libdcp.git] / src / rgb_xyz.cc
index 3d8f245193c2cd74ab2ba723b4b887e7a40c83ac..a44678f0b0ef79c1f7732fd042eeda1ae946cdf6 100644 (file)
@@ -57,7 +57,7 @@ dcp::xyz_to_rgba (
        uint8_t* argb
        )
 {
-       int const max_colour = pow (2, 12) - 1;
+       int const max_colour = pow (2, 16) - 1;
 
        struct {
                double x, y, z;
@@ -168,7 +168,7 @@ dcp::xyz_to_rgb (
        };
 
        int const height = xyz_image->size().height;
-       int const width = xyz_image->size().height;
+       int const width = xyz_image->size().width;
 
        for (int y = 0; y < height; ++y) {
                uint16_t* rgb_line = reinterpret_cast<uint16_t*> (rgb + y * stride);
@@ -305,9 +305,9 @@ dcp::rgb_to_xyz (
                        d.z = min (65535.0, d.z);
 
                        /* Out gamma LUT */
-                       *xyz_x++ = lut_out[lrint(d.x)] * 4095;
-                       *xyz_y++ = lut_out[lrint(d.y)] * 4095;
-                       *xyz_z++ = lut_out[lrint(d.z)] * 4095;
+                       *xyz_x++ = lrint (lut_out[lrint(d.x)] * 4095);
+                       *xyz_y++ = lrint (lut_out[lrint(d.y)] * 4095);
+                       *xyz_z++ = lrint (lut_out[lrint(d.z)] * 4095);
                }
        }