From e1e7de8d73bedd0c741e7df0390068c67867e09f Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 24 Jan 2021 22:56:33 +0100 Subject: Tidying. --- src/transfer_function.cc | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'src/transfer_function.cc') diff --git a/src/transfer_function.cc b/src/transfer_function.cc index 8746c828..00968e2f 100644 --- a/src/transfer_function.cc +++ b/src/transfer_function.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2014 Carl Hetherington + Copyright (C) 2012-2021 Carl Hetherington This file is part of libdcp. @@ -31,9 +31,16 @@ files in the program, then also delete it here. */ + +/* @file src/transfer_function.cc + * @brief TransferFunction + */ + + #include "transfer_function.h" #include + using std::pow; using std::map; using std::pair; @@ -41,23 +48,25 @@ using std::make_pair; using std::shared_ptr; using namespace dcp; + TransferFunction::~TransferFunction () { boost::mutex::scoped_lock lm (_mutex); - for (map, double*>::const_iterator i = _luts.begin(); i != _luts.end(); ++i) { - delete[] i->second; + for (auto const& i: _luts) { + delete[] i.second; } _luts.clear (); } + double const * TransferFunction::lut (int bit_depth, bool inverse) const { boost::mutex::scoped_lock lm (_mutex); - map, double*>::const_iterator i = _luts.find (make_pair (bit_depth, inverse)); + auto i = _luts.find (make_pair (bit_depth, inverse)); if (i != _luts.end ()) { return i->second; } -- cgit v1.2.3