From 80f86c7189c4b88ee51fddbef5874e312aedf648 Mon Sep 17 00:00:00 2001 From: heckflosse Date: Sat, 14 May 2016 19:29:26 +0200 Subject: [PATCH] Histogram of working space does not show 'gray2C' for gray regions, fixes #3283, fixes #3213, kudos to mmmtok for providing the patch --- rtengine/iplab2rgb.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rtengine/iplab2rgb.cc b/rtengine/iplab2rgb.cc index 21e5ca794..79a45c99e 100644 --- a/rtengine/iplab2rgb.cc +++ b/rtengine/iplab2rgb.cc @@ -202,7 +202,7 @@ Image8* ImProcFunctions::lab2rgb (LabImage* lab, int cx, int cy, int cw, int ch, } } else { - const auto rgb_xyz = iccStore->workingSpaceMatrix (profile); + const auto xyz_rgb = iccStore->workingSpaceInverseMatrix (profile); #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) if (multiThread) @@ -227,7 +227,7 @@ Image8* ImProcFunctions::lab2rgb (LabImage* lab, int cx, int cy, int cw, int ch, float z_ = 65535.0 * Color::f2xyz(fz) * Color::D50z; float y_ = (LL > Color::epskap) ? 65535.0 * fy * fy * fy : 65535.0 * LL / Color::kappa; - Color::xyz2rgb(x_, y_, z_, R, G, B, rgb_xyz); + Color::xyz2rgb(x_, y_, z_, R, G, B, xyz_rgb); image->data[ix++] = (int)Color::gamma2curve[CLIP(R)] >> 8; image->data[ix++] = (int)Color::gamma2curve[CLIP(G)] >> 8;