diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-06-02 16:08:11 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-06-02 16:08:11 +0200 |
| commit | f2d6161203f8b5c50b021dbe65a9109ea1577fd7 (patch) | |
| tree | 52dce64ded7d924f562f96f0238c5e01fd619191 /src | |
| parent | 4e885dc225c5c12e11367602cc4bf429520d9b3b (diff) | |
Remove notifications about clamped values when converting RGB to XYZ.
Diffstat (limited to 'src')
| -rw-r--r-- | src/rgb_xyz.cc | 13 | ||||
| -rw-r--r-- | src/rgb_xyz.h | 3 |
2 files changed, 2 insertions, 14 deletions
diff --git a/src/rgb_xyz.cc b/src/rgb_xyz.cc index d0774e7c..77b61416 100644 --- a/src/rgb_xyz.cc +++ b/src/rgb_xyz.cc @@ -283,8 +283,7 @@ dcp::rgb_to_xyz ( uint8_t const * rgb, dcp::Size size, int stride, - ColourConversion const & conversion, - optional<NoteHandler> note + ColourConversion const & conversion ) { shared_ptr<OpenJPEGImage> xyz (new OpenJPEGImage (size)); @@ -304,7 +303,6 @@ dcp::rgb_to_xyz ( double fast_matrix[9]; combined_rgb_to_xyz (conversion, fast_matrix); - int clamped = 0; int* xyz_x = xyz->data (0); int* xyz_y = xyz->data (1); int* xyz_z = xyz->data (2); @@ -323,11 +321,6 @@ dcp::rgb_to_xyz ( d.z = s.r * fast_matrix[6] + s.g * fast_matrix[7] + s.b * fast_matrix[8]; /* Clamp */ - - if (d.x < 0 || d.y < 0 || d.z < 0 || d.x > 65535 || d.y > 65535 || d.z > 65535) { - ++clamped; - } - d.x = max (0.0, d.x); d.y = max (0.0, d.y); d.z = max (0.0, d.z); @@ -342,9 +335,5 @@ dcp::rgb_to_xyz ( } } - if (clamped && note) { - note.get() (DCP_NOTE, String::compose ("%1 XYZ value(s) clamped", clamped)); - } - return xyz; } diff --git a/src/rgb_xyz.h b/src/rgb_xyz.h index 652f5522..e414d07e 100644 --- a/src/rgb_xyz.h +++ b/src/rgb_xyz.h @@ -61,8 +61,7 @@ extern boost::shared_ptr<OpenJPEGImage> rgb_to_xyz ( uint8_t const * rgb, dcp::Size size, int stride, - ColourConversion const & conversion, - boost::optional<NoteHandler> note = boost::optional<NoteHandler> () + ColourConversion const & conversion ); extern void combined_rgb_to_xyz (ColourConversion const & conversion, double* matrix); |
