From ad7244de981a7dd0b9b4f8f3d62d4704f1968012 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 5 May 2022 20:31:26 +0200 Subject: Use std::vector for LUTs. --- src/transfer_function.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/transfer_function.h') 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 #include #include +#include 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 const& lut (int bit_depth, bool inverse) const; virtual bool about_equal (std::shared_ptr 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 make_lut (int bit_depth, bool inverse) const = 0; private: - mutable std::map, double*> _luts; + mutable std::map, std::vector> _luts; /** mutex to protect _luts */ mutable boost::mutex _mutex; }; -- cgit v1.2.3