/*
- Copyright (C) 2014 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2014-2015 Carl Hetherington <cth@carlh.net>
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
ColourConversion::rec601_to_xyz ()
{
static ColourConversion* c = new ColourConversion (
- shared_ptr<const TransferFunction> (new ModifiedGammaTransferFunction (1 / 0.45, 0.081, 0.099, 4.5)),
+ shared_ptr<const TransferFunction> (new GammaTransferFunction (2.2)),
YUV_TO_RGB_REC601,
Chromaticity (0.64, 0.33),
Chromaticity (0.3, 0.6),
ColourConversion::rec709_to_xyz ()
{
static ColourConversion* c = new ColourConversion (
- shared_ptr<const TransferFunction> (new ModifiedGammaTransferFunction (1 / 0.45, 0.081, 0.099, 4.5)),
+ shared_ptr<const TransferFunction> (new GammaTransferFunction (2.2)),
YUV_TO_RGB_REC709,
Chromaticity (0.64, 0.33),
Chromaticity (0.3, 0.6),
return *c;
}
+ColourConversion const &
+ColourConversion::p3_to_xyz ()
+{
+ static ColourConversion* c = new ColourConversion (
+ shared_ptr<const TransferFunction> (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<Chromaticity> (),
+ shared_ptr<const TransferFunction> (new GammaTransferFunction (2.6))
+ );
+ return *c;
+}
+
ColourConversion::ColourConversion (
shared_ptr<const TransferFunction> in,
YUVToRGB yuv_to_rgb,
, _adjusted_white (adjusted_white)
, _out (out)
{
-
+
}
bool
/* backsubstitute to get the inverse */
lu_substitute (A, pm, xyz_to_rgb);
-
+
return xyz_to_rgb;
}