X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Frgb_xyz.cc;h=a44678f0b0ef79c1f7732fd042eeda1ae946cdf6;hb=8f7a014e6d11c107b520ac3c869b1cc7bef1bbd0;hp=3d8f245193c2cd74ab2ba723b4b887e7a40c83ac;hpb=e4042b767869c0438b61fdbfac1534cd4937da10;p=libdcp.git diff --git a/src/rgb_xyz.cc b/src/rgb_xyz.cc index 3d8f2451..a44678f0 100644 --- a/src/rgb_xyz.cc +++ b/src/rgb_xyz.cc @@ -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 (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); } }