diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-05-24 12:25:22 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-05-24 12:25:22 +0100 |
| commit | 85c699d29aab7ca7f7218b3f7f859e10c9025e37 (patch) | |
| tree | 0789324c390795f6628f2008d645b54000e4e088 /src/colour_conversion.cc | |
| parent | 043d382cb7360f35e97b9057045c6a255b905443 (diff) | |
Add somewhat speculative Rec 1886 and Rec 2020 colour conversions.
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, |
