Improvement histogram curves CIECAM see issue1640

This commit is contained in:
jdc
2012-12-05 09:24:15 +01:00
parent 1960d09286
commit f2e950521f
17 changed files with 225 additions and 91 deletions

View File

@@ -101,6 +101,7 @@ DetailedCrop* ImProcCoordinator::createCrop () {
return new Crop (this);
}
// todo: bitmask containing desired actions, taken from changesSinceLast
// cropCall: calling crop, used to prevent self-updates
void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) {
@@ -318,8 +319,6 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) {
for (int y=0; y<pW; y++) {
pos=CLIP((int)(oprevl->L[x][y]));
lhist16[pos]++;
poscc=CLIP((int)sqrt(oprevl->a[x][y]*oprevl->a[x][y] + oprevl->b[x][y]*oprevl->b[x][y]));
lhist16Clad[poscc]++;
if (y>=y1 && y<y2 && x>=x1 && x<x2) {lhist16Cropped[pos]++;lhist16CroppedClad[poscc]++;}
}
@@ -338,29 +337,17 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) {
if (todo & M_LUMACURVE) {
CurveFactory::complexsgnCurve (autili, butili,ccutili,cclutili, params.labCurve.chromaticity, params.labCurve.rstprotection,
params.labCurve.acurve, params.labCurve.bcurve,params.labCurve.cccurve,params.labCurve.lccurve, chroma_acurve, chroma_bcurve, satcurve,lhskcurve,
lhist16Clad, lhist16CroppedClad, histCCurve, scale==1 ? 1 : 16);
lhist16Clad,lhist16CroppedClad, histCCurve, scale==1 ? 1 : 16);
}
if (todo & (M_LUMINANCE+M_COLOR) ) {
nprevl->CopyFrom(oprevl);
// ipf.EPDToneMap(nprevl,0,scale);
progress ("Applying Color Boost...",100*readyphase/numofphases);
int poscc;
ipf.chromiLuminanceCurve (nprevl, nprevl, chroma_acurve, chroma_bcurve, satcurve,lhskcurve, lumacurve, utili, autili, butili, ccutili,cclutili);
if(!ccutili){
for (int x=0; x<pH; x++)
for (int y=0; y<pW; y++) {
poscc=CLIP((int)sqrt(nprevl->a[x][y]*nprevl->a[x][y] + nprevl->b[x][y]*nprevl->b[x][y]));
lhist16ClabAF[poscc]++;
}
CurveFactory::updatechroma (
params.labCurve.cccurve,
lhist16ClabAF, lhist16CroppedCCAM,histCCurve,
scale==1 ? 1 : 16);
}
ipf.chromiLuminanceCurve (pW,nprevl, nprevl, chroma_acurve, chroma_bcurve, satcurve,lhskcurve, lumacurve, utili, autili, butili, ccutili,cclutili, histCCurve);
ipf.vibrance(nprevl);
ipf.EPDToneMap(nprevl,0,scale);
@@ -412,11 +399,11 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) {
for (int y=0; y<pW; y++) {
pos=CLIP((int)(nprevl->L[x][y]));
posc=CLIP((int)sqrt(nprevl->a[x][y]*nprevl->a[x][y] + nprevl->b[x][y]*nprevl->b[x][y]));
lhist16CCAM[posc]++;
lhist16CAM[pos]++;
if(!params.colorappearance.datacie) lhist16CCAM[posc]++;
if(!params.colorappearance.datacie)lhist16CAM[pos]++;
if (y>=y1 && y<y2 && x>=x1 && x<x2) {lhist16CroppedCAM[pos]++;lhist16CroppedCCAM[posc]++;}
}
LUTu dummy;
CurveFactory::curveLightBrightColor (
params.colorappearance.curveMode, params.colorappearance.curve,
params.colorappearance.curveMode2, params.colorappearance.curve2,
@@ -428,20 +415,7 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) {
customColCurve3,
scale==1 ? 1 : 1);
ipf.ciecam_02 (nprevl, &params, customColCurve1,customColCurve2,customColCurve3);
//update histogram chroma
/* if(!customColCurve3){
for (int x=0; x<pH; x++)
for (int y=0; y<pW; y++) {
posc=CLIP((int)sqrt(nprevl->a[x][y]*nprevl->a[x][y] + nprevl->b[x][y]*nprevl->b[x][y]));
lhist16CCAMAF[posc]++;
}
CurveFactory::updatechroma(
params.colorappearance.curve3,
lhist16CCAMAF, lhist16CroppedCCAM,histCCAM,
scale==1 ? 1 : 1);
//end update histogram chroma
} */
ipf.ciecam_02 (pW, nprevl, &params, customColCurve1,customColCurve2,customColCurve3, histLCAM, histCCAM);
}
// process crop, if needed
for (size_t i=0; i<crops.size(); i++)