diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-01-03 21:33:30 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-01-03 21:33:30 +0000 |
| commit | 9655ed4740f08899698052f232256fcf7b77c58e (patch) | |
| tree | 195e8f30ec4c5dd5beeecfb371acf7a3ceaa7898 /src/transfer_function.cc | |
| parent | 986bb0acba0aa73fc2ac0190a32e8fa8c6e636b4 (diff) | |
Various fixes to XYZ/RGB transforms.
Diffstat (limited to 'src/transfer_function.cc')
| -rw-r--r-- | src/transfer_function.cc | 19 |
1 files changed, 16 insertions, 3 deletions
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<int, float*>::const_iterator i = _luts.begin(); i != _luts.end(); ++i) { + for (map<int, double*>::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<int, float*>::const_iterator i = _luts.find (bit_depth); + map<int, double*>::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<const TransferFunction> other, double) const +{ + return _inverse == other->_inverse; +} |
