diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-05-04 21:32:44 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-10-14 20:50:53 +0200 |
| commit | 108310f31934a2d788e2e103fd2eac6a3882cf84 (patch) | |
| tree | 8bd2e54a5de0a17a6706561fa7517dd0bf4570c7 /src | |
| parent | 761cdec89c02945e3d6804686f559dd252084d6f (diff) | |
Rename TransferFunction::out() -> TransferFunction::out_j2k().
Diffstat (limited to 'src')
| -rw-r--r-- | src/colour_conversion.cc | 10 | ||||
| -rw-r--r-- | src/colour_conversion.h | 17 | ||||
| -rw-r--r-- | src/rgb_xyz.cc | 6 |
3 files changed, 18 insertions, 15 deletions
diff --git a/src/colour_conversion.cc b/src/colour_conversion.cc index 5c442d77..6b220e8e 100644 --- a/src/colour_conversion.cc +++ b/src/colour_conversion.cc @@ -180,7 +180,7 @@ ColourConversion::ColourConversion( Chromaticity blue, Chromaticity white, optional<Chromaticity> adjusted_white, - shared_ptr<const TransferFunction> out + shared_ptr<const TransferFunction> out_j2k ) : _in(in) , _yuv_to_rgb(yuv_to_rgb) @@ -189,7 +189,7 @@ ColourConversion::ColourConversion( , _blue(blue) , _white(white) , _adjusted_white(adjusted_white) - , _out(out) + , _out_j2k(out_j2k) { } @@ -204,9 +204,9 @@ ColourConversion::about_equal(ColourConversion const & other, float epsilon) con !_green.about_equal(other._green, epsilon) || !_blue.about_equal(other._blue, epsilon) || !_white.about_equal(other._white, epsilon) || - (!_out && other._out) || - (_out && !other._out) || - (_out && !_out->about_equal(other._out, epsilon))) { + (!_out_j2k && other._out_j2k) || + (_out_j2k && !other._out_j2k) || + (_out_j2k && !_out_j2k->about_equal(other._out_j2k, epsilon))) { return false; } diff --git a/src/colour_conversion.h b/src/colour_conversion.h index 3cfbf969..aaab720e 100644 --- a/src/colour_conversion.h +++ b/src/colour_conversion.h @@ -83,7 +83,7 @@ public: Chromaticity blue, Chromaticity white, boost::optional<Chromaticity> adjusted_white, - std::shared_ptr<const TransferFunction> out + std::shared_ptr<const TransferFunction> out_j2k ); std::shared_ptr<const TransferFunction> in() const { @@ -114,8 +114,9 @@ public: return _adjusted_white; } - std::shared_ptr<const TransferFunction> out() const { - return _out; + /** Output transfer function when going to XYZ for JPEG2000 */ + std::shared_ptr<const TransferFunction> out_j2k() const { + return _out_j2k; } void set_in(std::shared_ptr<const TransferFunction> f) { @@ -150,8 +151,8 @@ public: _adjusted_white = boost::optional<Chromaticity>(); } - void set_out(std::shared_ptr<const TransferFunction> f) { - _out = f; + void set_out_j2k(std::shared_ptr<const TransferFunction> f) { + _out_j2k = f; } bool about_equal(ColourConversion const & other, float epsilon) const; @@ -179,8 +180,10 @@ protected: Chromaticity _white; /** White point that we are adjusting to using a Bradford matrix */ boost::optional<Chromaticity> _adjusted_white; - /** Output transfer function (probably an inverse gamma function, or something similar) */ - std::shared_ptr<const TransferFunction> _out; + /** Output transfer function to be used when going to XYZ for JPEG2000 + * Probably an inverse gamma function, or something similar. + */ + std::shared_ptr<const TransferFunction> _out_j2k; }; diff --git a/src/rgb_xyz.cc b/src/rgb_xyz.cc index c9854107..eaf1931b 100644 --- a/src/rgb_xyz.cc +++ b/src/rgb_xyz.cc @@ -81,7 +81,7 @@ dcp::xyz_to_rgba ( int* xyz_y = xyz_image->data (1); int* xyz_z = xyz_image->data (2); - auto lut_in = conversion.out()->double_lut(0, 1, 12, false); + auto lut_in = conversion.out_j2k()->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 (); @@ -158,7 +158,7 @@ dcp::xyz_to_rgb ( int* xyz_y = xyz_image->data (1); int* xyz_z = xyz_image->data (2); - auto lut_in = conversion.out()->double_lut(0, 1, 12, false); + auto lut_in = conversion.out_j2k()->double_lut(0, 1, 12, false); auto lut_out = conversion.in()->double_lut(0, 1, 16, true); auto const matrix = conversion.xyz_to_rgb (); @@ -287,7 +287,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()); + auto lut_out = make_inverse_gamma_lut(conversion.out_j2k()); /* This is is the product of the RGB to XYZ matrix, the Bradford transform and the DCI companding */ double fast_matrix[9]; |
