Fix incorrect sampled L*a*b* values

Use LCMS to convert values back into L*a*b*. The pipette buffer has the
output or working profile applied with LCMS. Performing the inverse
operation fixes the incorrect values shown in the navigator, histogram
indicator bars, and lockable color pickers.
This commit is contained in:
Lawrence Lee
2023-05-28 18:15:27 -07:00
parent 6a11c59b79
commit 8accebe416
10 changed files with 144 additions and 36 deletions

View File

@@ -403,7 +403,7 @@ void CropWindow::buttonPress (int button, int type, int bstate, int x, int y)
// Add a new Color Picker
rtengine::Coord imgPos;
screenCoordToImage(x, y, imgPos.x, imgPos.y);
LockableColorPicker *newPicker = new LockableColorPicker(this, &cropHandler.colorParams->outputProfile, &cropHandler.colorParams->workingProfile);
LockableColorPicker *newPicker = new LockableColorPicker(this, cropHandler.colorParams.get());
colorPickers.push_back(newPicker);
hoveredPicker = newPicker;
updateHoveredPicker(&imgPos);
@@ -1095,10 +1095,10 @@ void CropWindow::pointerMoved (int bstate, int x, int y)
printf("Using \"%s\" output\n", outputProfile.c_str());
if(outputProfile==options.rtSettings.srgb) printf("OK SRGB2");
*/
pmlistener->pointerMoved (false, cropHandler.colorParams->outputProfile, cropHandler.colorParams->workingProfile, mx, my, -1, -1, -1);
pmlistener->pointerMoved (false, *cropHandler.colorParams, mx, my, -1, -1, -1);
if (pmhlistener) {
pmhlistener->pointerMoved (false, cropHandler.colorParams->outputProfile, cropHandler.colorParams->workingProfile, mx, my, -1, -1, -1);
pmhlistener->pointerMoved (false, *cropHandler.colorParams, mx, my, -1, -1, -1);
}
} else {
@@ -1145,11 +1145,11 @@ void CropWindow::pointerMoved (int bstate, int x, int y)
// Updates the Navigator
// TODO: possible double color conversion if rval, gval, bval come from cropHandler.cropPixbuftrue ? see issue #4583
pmlistener->pointerMoved (true, cropHandler.colorParams->outputProfile, cropHandler.colorParams->workingProfile, mx, my, rval, gval, bval, isRaw);
pmlistener->pointerMoved (true, *cropHandler.colorParams, mx, my, rval, gval, bval, isRaw);
if (pmhlistener) {
// Updates the HistogramRGBArea
pmhlistener->pointerMoved (true, cropHandler.colorParams->outputProfile, cropHandler.colorParams->workingProfile, mx, my, rval, gval, bval);
pmhlistener->pointerMoved (true, *cropHandler.colorParams, mx, my, rval, gval, bval);
}
}
}