summaryrefslogtreecommitdiff
path: root/src/transfer_function.h
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-05-05 20:31:26 +0200
committerCarl Hetherington <cth@carlh.net>2022-05-05 21:09:40 +0200
commitad7244de981a7dd0b9b4f8f3d62d4704f1968012 (patch)
tree2d5818563e35585b3a45d42b2a7ffd51584592fc /src/transfer_function.h
parentf755fd20c0c026128e23a165e3b524a275d6f803 (diff)
Use std::vector for LUTs.
Diffstat (limited to 'src/transfer_function.h')
-rw-r--r--src/transfer_function.h12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/transfer_function.h b/src/transfer_function.h
index a52011ec..04678733 100644
--- a/src/transfer_function.h
+++ b/src/transfer_function.h
@@ -44,6 +44,7 @@
#include <boost/thread/mutex.hpp>
#include <map>
#include <memory>
+#include <vector>
namespace dcp {
@@ -57,22 +58,19 @@ class TransferFunction
public:
TransferFunction () {}
- TransferFunction (TransferFunction const&) = delete;
- TransferFunction& operator= (TransferFunction const&) = delete;
-
- virtual ~TransferFunction ();
+ 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, bool inverse) const;
+ std::vector<double> const& lut (int bit_depth, bool inverse) const;
virtual bool about_equal (std::shared_ptr<const TransferFunction> other, double epsilon) const = 0;
protected:
/** Make a LUT and return an array allocated by new */
- virtual double * make_lut (int bit_depth, bool inverse) const = 0;
+ virtual std::vector<double> make_lut (int bit_depth, bool inverse) const = 0;
private:
- mutable std::map<std::pair<int, bool>, double*> _luts;
+ mutable std::map<std::pair<int, bool>, std::vector<double>> _luts;
/** mutex to protect _luts */
mutable boost::mutex _mutex;
};