summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-05-05 02:11:32 +0200
committerCarl Hetherington <cth@carlh.net>2025-10-14 20:50:53 +0200
commitfbe4e1ca774fce6608de7ab910b0e346453682b2 (patch)
tree0a88e595e45007db5fb219dad4b07deb7ddf310d /src
parent2e9e778462a86e9c35e1758eb95cced4ddd5468d (diff)
Add scale parameter to make_inverse_gamma_lut().
Diffstat (limited to 'src')
-rw-r--r--src/colour_conversion.cc6
-rw-r--r--src/colour_conversion.h2
2 files changed, 4 insertions, 4 deletions
diff --git a/src/colour_conversion.cc b/src/colour_conversion.cc
index 8a3c8bff..5e3da078 100644
--- a/src/colour_conversion.cc
+++ b/src/colour_conversion.cc
@@ -545,10 +545,10 @@ dcp::combined_rgb_to_xyz(ColourConversion const & conversion, double* matrix)
PiecewiseLUT2
-dcp::make_inverse_gamma_lut(shared_ptr<const TransferFunction> fn)
+dcp::make_inverse_gamma_lut(shared_ptr<const TransferFunction> fn, int scale)
{
/* The parameters here were chosen by trial and error to reduce errors when running rgb_xyz_lut_test */
- return PiecewiseLUT2(fn, 0.062, 16, 12, true, 4095);
+ return PiecewiseLUT2(fn, 0.062, 16, 12, true, scale);
}
@@ -573,7 +573,7 @@ rgb_to_xyz_internal(
} d;
auto lut_in = conversion.in()->double_lut(0, 1, 12, false);
- auto lut_out = make_inverse_gamma_lut(conversion.out_j2k());
+ auto lut_out = make_inverse_gamma_lut(conversion.out_j2k(), 4095);
/* This is is the product of the RGB to XYZ matrix, the Bradford transform and the DCI companding */
double fast_matrix[9];
diff --git a/src/colour_conversion.h b/src/colour_conversion.h
index 3c39b45a..ea470e22 100644
--- a/src/colour_conversion.h
+++ b/src/colour_conversion.h
@@ -245,7 +245,7 @@ extern void xyz_to_rgb(
);
-extern PiecewiseLUT2 make_inverse_gamma_lut(std::shared_ptr<const TransferFunction> fn);
+extern PiecewiseLUT2 make_inverse_gamma_lut(std::shared_ptr<const TransferFunction> fn, int scale);
/** @param rgb RGB data; packed RGB 16:16:16, 48bpp, 16R, 16G, 16B,