some tweaks to the L*a*b* correction grid module

This commit is contained in:
Alberto Griggio 2018-01-08 14:34:54 +01:00
parent 041990d216
commit 7353ff864b
5 changed files with 8 additions and 9 deletions

View File

@ -7199,7 +7199,7 @@ SSEFUNCTION void ImProcFunctions::lab2rgb (const LabImage &src, Imagefloat &dst,
*/ */
void ImProcFunctions::colorToningLabGrid(LabImage *lab) void ImProcFunctions::colorToningLabGrid(LabImage *lab)
{ {
const float factor = ColorToningParams::LABGRID_CORR_MAX * 1.6f; const float factor = ColorToningParams::LABGRID_CORR_MAX * 3.f;
float a_scale = (params->colorToning.labgridAHigh - params->colorToning.labgridALow) / factor; float a_scale = (params->colorToning.labgridAHigh - params->colorToning.labgridALow) / factor;
float a_base = params->colorToning.labgridALow; float a_base = params->colorToning.labgridALow;
float b_scale = (params->colorToning.labgridBHigh - params->colorToning.labgridBLow) / factor; float b_scale = (params->colorToning.labgridBHigh - params->colorToning.labgridBLow) / factor;

View File

@ -618,6 +618,8 @@ bool LocalContrastParams::operator!=(const LocalContrastParams &other) const
} }
const double ColorToningParams::LABGRID_CORR_MAX = 12000.f;
ColorToningParams::ColorToningParams() : ColorToningParams::ColorToningParams() :
enabled(false), enabled(false),
autosat(true), autosat(true),

View File

@ -452,7 +452,7 @@ struct ColorToningParams {
double labgridBLow; double labgridBLow;
double labgridAHigh; double labgridAHigh;
double labgridBHigh; double labgridBHigh;
static constexpr double LABGRID_CORR_MAX = 8000.f; static const double LABGRID_CORR_MAX;
ColorToningParams(); ColorToningParams();

View File

@ -124,14 +124,12 @@ public:
float x, y, z; float x, y, z;
int ii = i - cells/2; int ii = i - cells/2;
int jj = j - cells/2; int jj = j - cells/2;
float a = step * (ii + 0.5) * 1.5; float a = step * (ii + 0.5);
float b = step * (jj + 0.5) * 1.5; float b = step * (jj + 0.5);
Color::Lab2XYZ(25000.f, a, b, x, y, z); Color::Lab2XYZ(25000.f, a, b, x, y, z);
Color::xyz2srgb(x, y, z, R, G, B); Color::xyz2srgb(x, y, z, R, G, B);
cr->set_source_rgb(R / 65535.f, G / 65535.f, B / 65535.f); cr->set_source_rgb(R / 65535.f, G / 65535.f, B / 65535.f);
cr->rectangle(width * i / (float)cells, height * j / (float)cells, cr->rectangle(width * i / float(cells), height * j / float(cells), width / float(cells) - 1, height / float(cells) - 1);
width / (float)cells - 1,
height / (float)cells - 1);
cr->fill(); cr->fill();
} }
} }

View File

@ -174,7 +174,6 @@ public:
bool labgridBLow; bool labgridBLow;
bool labgridAHigh; bool labgridAHigh;
bool labgridBHigh; bool labgridBHigh;
bool labgridSaturation;
}; };
class SharpenEdgeParamsEdited class SharpenEdgeParamsEdited