Add new LocalTime constructor.
[libdcp.git] / src / transfer_function.h
index 4105f3d4860d544369010744c04fbcb3fa00cff5..c8248ccebd04181593b2f00f9e801aaf45368a78 100644 (file)
 
 */
 
+/** @file  src/transfer_function.h
+ *  @brief TransferFunction class.
+ */
+
 #ifndef LIBDCP_TRANSFER_FUNCTION_H
 #define LIBDCP_TRANSFER_FUNCTION_H
 
 
 namespace dcp {
 
+/** @class TransferFunction
+ *  @brief A transfer function represented by a lookup table.
+ */
 class TransferFunction : public boost::noncopyable
 {
 public:
-       TransferFunction (bool inverse);
-       
        virtual ~TransferFunction ();
 
        /** @return A look-up table (of size 2^bit_depth) whose values range from 0 to 1 */
-       double const * lut (int bit_depth) const;
+       double const * lut (int bit_depth, bool inverse) const;
 
-       virtual bool about_equal (boost::shared_ptr<const TransferFunction> other, double epsilon) const;
+       virtual bool about_equal (boost::shared_ptr<const TransferFunction> other, double epsilon) const = 0;
 
 protected:
-       virtual double * make_lut (int bit_depth) const = 0;
-
-       bool _inverse;
+       /** Make a LUT and return an array allocated by new */
+       virtual double * make_lut (int bit_depth, bool inverse) const = 0;
 
 private:
-       mutable std::map<int, double*> _luts;
+       mutable std::map<std::pair<int, bool>, double*> _luts;
        /** mutex to protect _luts */
        mutable boost::mutex _mutex;
 };