Various fixes to XYZ/RGB transforms.
[libdcp.git] / src / transfer_function.cc
index 2c7e3e520e3f65692b6885d56f86bda31cd5b175..d889cbbc7cf15f704046ddb4b6c16df8978455b2 100644 (file)
 
 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;
+}