Rename lut -> double_lut.
authorCarl Hetherington <cth@carlh.net>
Sat, 21 Oct 2023 20:40:17 +0000 (22:40 +0200)
committerCarl Hetherington <cth@carlh.net>
Sat, 21 Oct 2023 22:05:28 +0000 (00:05 +0200)
13 files changed:
src/gamma_transfer_function.cc
src/gamma_transfer_function.h
src/identity_transfer_function.cc
src/identity_transfer_function.h
src/modified_gamma_transfer_function.cc
src/modified_gamma_transfer_function.h
src/piecewise_lut.h
src/rgb_xyz.cc
src/s_gamut3_transfer_function.cc
src/s_gamut3_transfer_function.h
src/transfer_function.cc
src/transfer_function.h
test/colour_conversion_test.cc

index ff9073a1954441691865bddc098efc82902b1d18..83c9929f2ae3247ca82c2e825d9d4f3e08f3b6bc 100644 (file)
@@ -56,7 +56,7 @@ GammaTransferFunction::GammaTransferFunction (double gamma)
 
 
 vector<double>
-GammaTransferFunction::make_lut (double from, double to, int bit_depth, bool inverse) const
+GammaTransferFunction::make_double_lut(double from, double to, int bit_depth, bool inverse) const
 {
        int const bit_length = int(std::pow(2.0f, bit_depth));
        auto lut = vector<double>(bit_length);
index e7294000f2214060202ab3a17febd8d21df0cc4f..79804ad652afd8b966315dcd2797db9e54049d75 100644 (file)
@@ -58,7 +58,7 @@ public:
        bool about_equal (std::shared_ptr<const TransferFunction> other, double epsilon) const override;
 
 protected:
-       std::vector<double> make_lut (double from, double to, int bit_depth, bool inverse) const override;
+       std::vector<double> make_double_lut(double from, double to, int bit_depth, bool inverse) const override;
 
 private:
        double _gamma;
index b6f03d07f69a09df33864b7c01b13d98d89e1485..a2260ee2639e93a932f215e67d97539c18c81ab5 100644 (file)
@@ -49,7 +49,7 @@ using namespace dcp;
 
 
 vector<double>
-IdentityTransferFunction::make_lut (double from, double to, int bit_depth, bool) const
+IdentityTransferFunction::make_double_lut(double from, double to, int bit_depth, bool) const
 {
        int const bit_length = int(std::pow(2.0f, bit_depth));
        auto lut = vector<double>(bit_length);
index f6e80abbd69af319a83740481c68da3de32e4916..d111e057e533212598182166cde3e5d67bddd341 100644 (file)
@@ -49,7 +49,7 @@ public:
        bool about_equal (std::shared_ptr<const TransferFunction> other, double epsilon) const override;
 
 protected:
-       std::vector<double> make_lut (double from, double to, int bit_depth, bool inverse) const override;
+       std::vector<double> make_double_lut(double from, double to, int bit_depth, bool inverse) const override;
 };
 
 
index 991e642e9dab8069c61901cd01d5b045d9549d1d..a54a090a829ed40abd45893fd5c2be974f1c43ef 100644 (file)
@@ -59,7 +59,7 @@ ModifiedGammaTransferFunction::ModifiedGammaTransferFunction (double power, doub
 
 
 vector<double>
-ModifiedGammaTransferFunction::make_lut (double from, double to, int bit_depth, bool inverse) const
+ModifiedGammaTransferFunction::make_double_lut(double from, double to, int bit_depth, bool inverse) const
 {
        int const bit_length = int(std::pow(2.0f, bit_depth));
        auto lut = vector<double>(bit_length);
index 0427dd6170e4de18410c4c265762c21e463cc3c3..ae27be858161331988ba86f2d94f34e61e0f38d7 100644 (file)
@@ -77,7 +77,7 @@ public:
        bool about_equal (std::shared_ptr<const TransferFunction>, double epsilon) const override;
 
 protected:
-       std::vector<double> make_lut (double from, double to, int bit_depth, bool inverse) const override;
+       std::vector<double> make_double_lut(double from, double to, int bit_depth, bool inverse) const override;
 
 private:
        double _power;
index 772e0aed8d4bcd60fba4230e7e3b869d2563d77d..f2f21a92e456c59d6aa5ead06bccb8a45ac50bf6 100644 (file)
@@ -49,8 +49,8 @@ class PiecewiseLUT2
 public:
        PiecewiseLUT2(std::shared_ptr<const TransferFunction> fn, double boundary, int low_bits, int high_bits, bool inverse)
                : _boundary(boundary)
-               , _low(fn->lut(0, boundary, low_bits, inverse))
-               , _high(fn->lut(boundary, 1, high_bits, inverse))
+               , _low(fn->double_lut(0, boundary, low_bits, inverse))
+               , _high(fn->double_lut(boundary, 1, high_bits, inverse))
                , _low_scale(static_cast<int>(std::pow(2.0f, low_bits)) - 1)
                , _high_scale(static_cast<int>(std::pow(2.0f, high_bits)) - 1)
        {
index e6c5105d6fc9f5877b5a0569bd21c653e3eda2ae..cd0c7f60b007b5812ee5d180d3e284cf64729cac 100644 (file)
@@ -81,8 +81,8 @@ dcp::xyz_to_rgba (
        int* xyz_y = xyz_image->data (1);
        int* xyz_z = xyz_image->data (2);
 
-       auto lut_in = conversion.out()->lut(0, 1, 12, false);
-       auto lut_out = conversion.in()->lut(0, 1, 16, true);
+       auto lut_in = conversion.out()->double_lut(0, 1, 12, false);
+       auto lut_out = conversion.in()->double_lut(0, 1, 16, true);
        boost::numeric::ublas::matrix<double> const matrix = conversion.xyz_to_rgb ();
 
        double fast_matrix[9] = {
@@ -158,8 +158,8 @@ dcp::xyz_to_rgb (
        int* xyz_y = xyz_image->data (1);
        int* xyz_z = xyz_image->data (2);
 
-       auto lut_in = conversion.out()->lut(0, 1, 12, false);
-       auto lut_out = conversion.in()->lut(0, 1, 16, true);
+       auto lut_in = conversion.out()->double_lut(0, 1, 12, false);
+       auto lut_out = conversion.in()->double_lut(0, 1, 16, true);
        auto const matrix = conversion.xyz_to_rgb ();
 
        double fast_matrix[9] = {
@@ -287,7 +287,7 @@ rgb_to_xyz_internal(
                double x, y, z;
        } d;
 
-       auto lut_in = conversion.in()->lut(0, 1, 12, false);
+       auto lut_in = conversion.in()->double_lut(0, 1, 12, false);
        auto lut_out = make_inverse_gamma_lut(conversion.out());
 
        /* This is is the product of the RGB to XYZ matrix, the Bradford transform and the DCI companding */
index 512a29510b7b0b48f5fbce0844fe3152dfe3a397..831fcb53769ee8b0d3dc67470c9d1d8123b44b51 100644 (file)
@@ -49,7 +49,7 @@ using namespace dcp;
 
 
 vector<double>
-SGamut3TransferFunction::make_lut (double from, double to, int bit_depth, bool inverse) const
+SGamut3TransferFunction::make_double_lut(double from, double to, int bit_depth, bool inverse) const
 {
        int const bit_length = int(std::pow(2.0f, bit_depth));
        auto lut = vector<double>(bit_length);
index 50b4875ab93bb9ca0553877809b8215bc83df3d3..6d69f2965e56dbed273e8d16168ebc360e5d4492 100644 (file)
@@ -49,7 +49,7 @@ public:
        bool about_equal (std::shared_ptr<const TransferFunction> other, double epsilon) const override;
 
 protected:
-       std::vector<double> make_lut (double from, double to, int bit_depth, bool inverse) const override;
+       std::vector<double> make_double_lut(double from, double to, int bit_depth, bool inverse) const override;
 };
 
 
index 7b17fd363f8035542fddf2e605969e0dcdb88aa3..be507af1f4c968a084a7d09ff61a77754181ff5d 100644 (file)
@@ -50,7 +50,7 @@ using namespace dcp;
 
 
 vector<double> const&
-TransferFunction::lut (double from, double to, int bit_depth, bool inverse) const
+TransferFunction::double_lut(double from, double to, int bit_depth, bool inverse) const
 {
        boost::mutex::scoped_lock lm (_mutex);
 
@@ -61,7 +61,7 @@ TransferFunction::lut (double from, double to, int bit_depth, bool inverse) cons
                return i->second;
        }
 
-       _luts[descriptor] = make_lut(from, to, bit_depth, inverse);
+       _luts[descriptor] = make_double_lut(from, to, bit_depth, inverse);
        return _luts[descriptor];
 }
 
index 9dc517e3b0aca837b0e7aa445bb1aa47567e9619..033c30454e25ebf835deb3514b451029c81df6c5 100644 (file)
@@ -61,12 +61,12 @@ public:
        virtual ~TransferFunction () {}
 
        /** @return A look-up table (of size 2^bit_depth) */
-       std::vector<double> const& lut (double from, double to, int bit_depth, bool inverse) const;
+       std::vector<double> const& double_lut(double from, double to, int bit_depth, bool inverse) const;
 
        virtual bool about_equal (std::shared_ptr<const TransferFunction> other, double epsilon) const = 0;
 
 protected:
-       virtual std::vector<double> make_lut (double from, double to, int bit_depth, bool inverse) const = 0;
+       virtual std::vector<double> make_double_lut(double from, double to, int bit_depth, bool inverse) const = 0;
 
 private:
        struct LUTDescriptor {
index 73de297a0a9055e82bba5a91cf5b64f8a7b950f0..b8695ae910043d35da492f7b3e0dda46f8c079ed 100644 (file)
@@ -44,7 +44,7 @@ using namespace dcp;
 static void
 check_gamma (shared_ptr<const TransferFunction> tf, int bit_depth, bool inverse, float gamma)
 {
-       auto lut = tf->lut(0, 1, bit_depth, inverse);
+       auto lut = tf->double_lut(0, 1, bit_depth, inverse);
        int const count = rint (pow (2.0, bit_depth));
 
        for (int i = 0; i < count; ++i) {
@@ -55,7 +55,7 @@ check_gamma (shared_ptr<const TransferFunction> tf, int bit_depth, bool inverse,
 static void
 check_modified_gamma (shared_ptr<const TransferFunction> tf, int bit_depth, bool inverse, double power, double threshold, double A, double B)
 {
-       auto lut = tf->lut(0, 1, bit_depth, inverse);
+       auto lut = tf->double_lut(0, 1, bit_depth, inverse);
        int const count = rint (pow (2.0, bit_depth));
 
        for (int i = 0; i < count; ++i) {