summaryrefslogtreecommitdiff
path: root/src/gamma_transfer_function.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2021-01-23 15:35:24 +0100
committerCarl Hetherington <cth@carlh.net>2021-01-23 15:35:24 +0100
commit6c37cc1979b2a01205a888c4c98f3334685ee8dd (patch)
tree9de52a3053e57bdf79a7986319cb097b33e46b5c /src/gamma_transfer_function.cc
parentb75d977a38f039fd68ed5d4055ae70b4bf631603 (diff)
Tidying.
Diffstat (limited to 'src/gamma_transfer_function.cc')
-rw-r--r--src/gamma_transfer_function.cc14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/gamma_transfer_function.cc b/src/gamma_transfer_function.cc
index c7c16f24..34501d98 100644
--- a/src/gamma_transfer_function.cc
+++ b/src/gamma_transfer_function.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net>
This file is part of libdcp.
@@ -31,24 +31,29 @@
files in the program, then also delete it here.
*/
+
/** @file src/gamma_transfer_function.cc
- * @brief GammaTransferFunction class.
+ * @brief GammaTransferFunction class
*/
+
#include "gamma_transfer_function.h"
#include <cmath>
+
using std::pow;
using std::shared_ptr;
using std::dynamic_pointer_cast;
using namespace dcp;
+
GammaTransferFunction::GammaTransferFunction (double gamma)
: _gamma (gamma)
{
}
+
double *
GammaTransferFunction::make_lut (int bit_depth, bool inverse) const
{
@@ -62,13 +67,14 @@ GammaTransferFunction::make_lut (int bit_depth, bool inverse) const
return lut;
}
+
bool
GammaTransferFunction::about_equal (shared_ptr<const TransferFunction> other, double epsilon) const
{
- shared_ptr<const GammaTransferFunction> o = dynamic_pointer_cast<const GammaTransferFunction> (other);
+ auto o = dynamic_pointer_cast<const GammaTransferFunction>(other);
if (!o) {
return false;
}
- return fabs (_gamma - o->_gamma) < epsilon;
+ return fabs(_gamma - o->_gamma) < epsilon;
}