From 9655ed4740f08899698052f232256fcf7b77c58e Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 3 Jan 2015 21:33:30 +0000 Subject: Various fixes to XYZ/RGB transforms. --- src/transfer_function.cc | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'src/transfer_function.cc') diff --git a/src/transfer_function.cc b/src/transfer_function.cc index 2c7e3e52..d889cbbc 100644 --- a/src/transfer_function.cc +++ b/src/transfer_function.cc @@ -22,21 +22,28 @@ using std::pow; using std::map; +using boost::shared_ptr; using namespace dcp; +TransferFunction::TransferFunction (bool inverse) + : _inverse (inverse) +{ + +} + TransferFunction::~TransferFunction () { - for (map::const_iterator i = _luts.begin(); i != _luts.end(); ++i) { + for (map::const_iterator i = _luts.begin(); i != _luts.end(); ++i) { delete[] i->second; } _luts.clear (); } -float const * +double const * TransferFunction::lut (int bit_depth) const { - map::const_iterator i = _luts.find (bit_depth); + map::const_iterator i = _luts.find (bit_depth); if (i != _luts.end ()) { return i->second; } @@ -44,3 +51,9 @@ TransferFunction::lut (int bit_depth) const _luts[bit_depth] = make_lut (bit_depth); return _luts[bit_depth]; } + +bool +TransferFunction::about_equal (shared_ptr other, double) const +{ + return _inverse == other->_inverse; +} -- cgit v1.2.3