diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-05-24 23:02:38 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-05-24 23:02:38 +0100 |
| commit | cb7c3db37d196b6e9ddad60937bd5314a95eadb2 (patch) | |
| tree | b686e05142b39208e4af8ab0a01e3b47c5256378 /src/colour_conversion.cc | |
| parent | 096b175a661234d9e02a852cce9f56c4577b8259 (diff) | |
| parent | 85c699d29aab7ca7f7218b3f7f859e10c9025e37 (diff) | |
Merge branch '1.0' of ssh://main.carlh.net/home/carl/git/libdcp into 1.0
Diffstat (limited to 'src/colour_conversion.cc')
| -rw-r--r-- | src/colour_conversion.cc | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/colour_conversion.cc b/src/colour_conversion.cc index 8c48c2e1..46bc717e 100644 --- a/src/colour_conversion.cc +++ b/src/colour_conversion.cc @@ -97,6 +97,44 @@ ColourConversion::p3_to_xyz () return *c; } +ColourConversion const & +ColourConversion::rec1886_to_xyz () +{ + /* According to Olivier on DCP-o-matic bug #832, Rec. 1886 is Rec. 709 with + 2.4 gamma, so here goes ... + */ + static ColourConversion* c = new ColourConversion ( + shared_ptr<const TransferFunction> (new GammaTransferFunction (2.4)), + YUV_TO_RGB_REC709, + Chromaticity (0.64, 0.33), + Chromaticity (0.3, 0.6), + Chromaticity (0.15, 0.06), + /* D65 */ + Chromaticity (0.3127, 0.329), + optional<Chromaticity> (), + shared_ptr<const TransferFunction> (new GammaTransferFunction (2.6)) + ); + return *c; +} + +ColourConversion const & +ColourConversion::rec2020_to_xyz () +{ + /* From Wikipedia */ + static ColourConversion* c = new ColourConversion ( + shared_ptr<const TransferFunction> (new ModifiedGammaTransferFunction (1 / 0.45, 0.08145, 0.0993, 4.5)), + YUV_TO_RGB_REC709, + Chromaticity (0.708, 0.292), + Chromaticity (0.170, 0.797), + Chromaticity (0.131, 0.046), + /* D65 */ + Chromaticity (0.3127, 0.329), + optional<Chromaticity> (), + shared_ptr<const TransferFunction> (new GammaTransferFunction (2.6)) + ); + return *c; +} + ColourConversion::ColourConversion ( shared_ptr<const TransferFunction> in, YUVToRGB yuv_to_rgb, |
