Fix build on OS X.
[libdcp.git] / src / rgb_xyz.cc
index 22b2bdecb17ed09fe4b45fe453afeac55c940d70..dea2106c0665d02ddf0b1f09e48d7c14a21b02e2 100644 (file)
@@ -60,7 +60,7 @@ libdcp::xyz_to_rgb (shared_ptr<const XYZFrame> xyz_frame, shared_ptr<const LUT>
                uint8_t* argb_line = argb;
                for (int x = 0; x < xyz_frame->size().width; ++x) {
 
-                       assert (*xyz_x >= 0 && *xyz_y >= 0 && *xyz_z >= 0 && *xyz_x < 4096 && *xyz_x < 4096 && *xyz_z < 4096);
+                       assert (*xyz_x >= 0 && *xyz_y >= 0 && *xyz_z >= 0 && *xyz_x < 4096 && *xyz_y < 4096 && *xyz_z < 4096);
                        
                        /* In gamma LUT */
                        s.x = lut_in->lut()[*xyz_x++];
@@ -100,7 +100,7 @@ libdcp::xyz_to_rgb (shared_ptr<const XYZFrame> xyz_frame, shared_ptr<const LUT>
 }
 
 shared_ptr<libdcp::XYZFrame>
-libdcp::rgb_to_xyz (shared_ptr<const Image> rgb, shared_ptr<const LUT> lut_in, shared_ptr<const LUT> lut_out, float const colour_matrix[3][3])
+libdcp::rgb_to_xyz (shared_ptr<const Image> rgb, shared_ptr<const LUT> lut_in, shared_ptr<const LUT> lut_out, double const colour_matrix[3][3])
 {
        assert (lut_in->bit_depth() == 12);
        assert (lut_out->bit_depth() == 16);
@@ -142,6 +142,10 @@ libdcp::rgb_to_xyz (shared_ptr<const Image> rgb, shared_ptr<const LUT> lut_in, s
                        d.x = d.x * DCI_COEFFICIENT * 65535;
                        d.y = d.y * DCI_COEFFICIENT * 65535;
                        d.z = d.z * DCI_COEFFICIENT * 65535;
+
+                       assert (d.x >= 0 && d.x < 65536);
+                       assert (d.y >= 0 && d.y < 65536);
+                       assert (d.z >= 0 && d.z < 65536);
                        
                        /* Out gamma LUT */
                        xyz->data(0)[jn] = lut_out->lut()[(int) d.x] * 4096;