From ceaf7bc52712cb60708ed5eb5c62c5e463dd8e89 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 24 Jan 2021 04:15:26 +0100 Subject: Tidying. --- src/identity_transfer_function.cc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/identity_transfer_function.cc') diff --git a/src/identity_transfer_function.cc b/src/identity_transfer_function.cc index ef18825b..c01e6698 100644 --- a/src/identity_transfer_function.cc +++ b/src/identity_transfer_function.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2016 Carl Hetherington + Copyright (C) 2016-2021 Carl Hetherington This file is part of libdcp. @@ -31,23 +31,27 @@ files in the program, then also delete it here. */ + /** @file src/identity_transfer_function.cc - * @brief IdentityTransferFunction class. + * @brief IdentityTransferFunction class */ + #include "identity_transfer_function.h" #include + using std::pow; using std::shared_ptr; using std::dynamic_pointer_cast; using namespace dcp; + double * IdentityTransferFunction::make_lut (int bit_depth, bool) const { int const bit_length = int(std::pow(2.0f, bit_depth)); - double* lut = new double[bit_length]; + auto lut = new double[bit_length]; for (int i = 0; i < bit_length; ++i) { lut[i] = double(i) / (bit_length - 1); } @@ -55,9 +59,10 @@ IdentityTransferFunction::make_lut (int bit_depth, bool) const return lut; } + bool IdentityTransferFunction::about_equal (shared_ptr other, double) const { - shared_ptr o = dynamic_pointer_cast (other); + auto o = dynamic_pointer_cast(other); return static_cast(o); } -- cgit v1.2.3