histmatching: make sure we use an sRGB profile for generating the target rendering

This commit is contained in:
Alberto Griggio 2018-01-30 10:47:18 +01:00
parent 5effd15bb3
commit ffbd97960f
4 changed files with 6 additions and 4 deletions

View File

@ -171,6 +171,7 @@ void RawImageSource::getAutoMatchedToneCurve(std::vector<double> &outCurve)
ProcParams neutral;
neutral.raw.bayersensor.method = RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::FAST);
neutral.raw.xtranssensor.method = RAWParams::XTransSensor::getMethodString(RAWParams::XTransSensor::Method::FAST);
neutral.icm.output = "sRGB";
std::unique_ptr<IImage8> source;
{

View File

@ -348,7 +348,7 @@ public:
void localContrast(LabImage *lab);
void colorToningLabGrid(LabImage *lab, int xstart, int xend, int ystart, int yend, bool MultiThread);
Image8* lab2rgb (LabImage* lab, int cx, int cy, int cw, int ch, const procparams::ColorManagementParams &icm);
Image8* lab2rgb (LabImage* lab, int cx, int cy, int cw, int ch, const procparams::ColorManagementParams &icm, bool consider_histogram_settings=true);
Imagefloat* lab2rgbOut (LabImage* lab, int cx, int cy, int cw, int ch, const procparams::ColorManagementParams &icm, GammaValues *ga = nullptr);
// CieImage *ciec;

View File

@ -122,7 +122,7 @@ void ImProcFunctions::lab2monitorRgb (LabImage* lab, Image8* image)
//
// If output profile used, divide by 327.68 then apply the "profile" profile (eventually with a standard gamma)
// otherwise divide by 327.68, convert to xyz and apply the RGB transform, before converting with gamma2curve
Image8* ImProcFunctions::lab2rgb (LabImage* lab, int cx, int cy, int cw, int ch, const procparams::ColorManagementParams &icm)
Image8* ImProcFunctions::lab2rgb (LabImage* lab, int cx, int cy, int cw, int ch, const procparams::ColorManagementParams &icm, bool consider_histogram_settings)
{
//gamutmap(lab);
@ -147,7 +147,7 @@ Image8* ImProcFunctions::lab2rgb (LabImage* lab, int cx, int cy, int cw, int ch,
bool standard_gamma;
if(settings->HistogramWorking) {
if(settings->HistogramWorking && consider_histogram_settings) {
profile = icm.working;
standard_gamma = true;
} else {

View File

@ -137,6 +137,7 @@ extern Options options;
namespace rtengine
{
using namespace procparams;
Thumbnail* Thumbnail::loadFromImage (const Glib::ustring& fname, int &w, int &h, int fixwh, double wbEq, bool inspectorMode)
@ -1303,7 +1304,7 @@ IImage8* Thumbnail::processImage (const procparams::ProcParams& params, eSensorT
readyImg = new Image8 (fw, fh);
ipf.lab2monitorRgb (labView, readyImg);
} else {
readyImg = ipf.lab2rgb(labView, 0, 0, fw, fh, params.icm);
readyImg = ipf.lab2rgb(labView, 0, 0, fw, fh, params.icm, false);
}
delete labView;
delete baseImg;