X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fcolour_conversion.cc;h=8c48c2e1f08f5abf93b580c71b68e59196987534;hb=c4db5b5396c6401c63d80777a812e8adc642ce02;hp=59aadf1a865fb28530ed011966b2d9314692c54f;hpb=b223c577907878025ea926caf138f8008ac1c6bf;p=libdcp.git diff --git a/src/colour_conversion.cc b/src/colour_conversion.cc index 59aadf1a..8c48c2e1 100644 --- a/src/colour_conversion.cc +++ b/src/colour_conversion.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Carl Hetherington + Copyright (C) 2014-2015 Carl Hetherington This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -51,7 +51,7 @@ ColourConversion const & ColourConversion::rec601_to_xyz () { static ColourConversion* c = new ColourConversion ( - shared_ptr (new ModifiedGammaTransferFunction (1 / 0.45, 0.081, 0.099, 4.5)), + shared_ptr (new GammaTransferFunction (2.2)), YUV_TO_RGB_REC601, Chromaticity (0.64, 0.33), Chromaticity (0.3, 0.6), @@ -68,7 +68,7 @@ ColourConversion const & ColourConversion::rec709_to_xyz () { static ColourConversion* c = new ColourConversion ( - shared_ptr (new ModifiedGammaTransferFunction (1 / 0.45, 0.081, 0.099, 4.5)), + shared_ptr (new GammaTransferFunction (2.2)), YUV_TO_RGB_REC709, Chromaticity (0.64, 0.33), Chromaticity (0.3, 0.6), @@ -81,6 +81,22 @@ ColourConversion::rec709_to_xyz () return *c; } +ColourConversion const & +ColourConversion::p3_to_xyz () +{ + static ColourConversion* c = new ColourConversion ( + shared_ptr (new GammaTransferFunction (2.6)), + YUV_TO_RGB_REC709, + Chromaticity (0.68, 0.32), + Chromaticity (0.265, 0.69), + Chromaticity (0.15, 0.06), + Chromaticity (0.314, 0.351), + optional (), + shared_ptr (new GammaTransferFunction (2.6)) + ); + return *c; +} + ColourConversion::ColourConversion ( shared_ptr in, YUVToRGB yuv_to_rgb, @@ -100,7 +116,7 @@ ColourConversion::ColourConversion ( , _adjusted_white (adjusted_white) , _out (out) { - + } bool @@ -173,7 +189,7 @@ ColourConversion::xyz_to_rgb () const /* backsubstitute to get the inverse */ lu_substitute (A, pm, xyz_to_rgb); - + return xyz_to_rgb; }