Another patch for highlight rolloff. Fixes black spots issue.
This commit is contained in:
parent
3f697139a1
commit
373f826dbe
@ -735,7 +735,7 @@ void CurveFactory::complexCurve (double ecomp, double black, double hlcompr, dou
|
|||||||
float toneslope=(shouldery-toey)/(shoulderx-toex);
|
float toneslope=(shouldery-toey)/(shoulderx-toex);
|
||||||
if (shoulderx<1) {//a>1; positive EC
|
if (shoulderx<1) {//a>1; positive EC
|
||||||
//move shoulder down if there is highlight rolloff
|
//move shoulder down if there is highlight rolloff
|
||||||
shouldery = shouldery-(0.2)*(hlcompr/100.0);
|
shouldery = shouldery-(0.3)*(hlcompr/100.0);
|
||||||
shoulderx = shoulderx - (1-shouldery)/toneslope;
|
shoulderx = shoulderx - (1-shouldery)/toneslope;
|
||||||
} else {//a<1; negative EC
|
} else {//a<1; negative EC
|
||||||
//if (shoulderx>1) {
|
//if (shoulderx>1) {
|
||||||
|
@ -324,19 +324,19 @@ void ImProcFunctions::rgbProc (Image16* working, LabImage* lab, int* tonecurve1,
|
|||||||
/*r = tonecurve[r];
|
/*r = tonecurve[r];
|
||||||
g = tonecurve[g];
|
g = tonecurve[g];
|
||||||
b = tonecurve[b];*/
|
b = tonecurve[b];*/
|
||||||
//int Y = (int)(0.299*r + 0.587*g + 0.114*b);
|
int Y = (int)(0.299*r + 0.587*g + 0.114*b);
|
||||||
//float tonefactor = (Y>0 ? (float)tonecurve[Y]/Y : 0);
|
float tonefactor = (Y>0 ? (float)tonecurve1[Y]/Y : 1);
|
||||||
float rtonefactor = (r>0 ? (float)tonecurve1[r]/r : 0);
|
/*float rtonefactor = (r>0 ? (float)tonecurve1[r]/r : 1);
|
||||||
float gtonefactor = (g>0 ? (float)tonecurve1[g]/g : 0);
|
float gtonefactor = (g>0 ? (float)tonecurve1[g]/g : 1);
|
||||||
float btonefactor = (b>0 ? (float)tonecurve1[b]/b : 0);
|
float btonefactor = (b>0 ? (float)tonecurve1[b]/b : 1);
|
||||||
float tonefactor = MIN(rtonefactor, MIN(gtonefactor,btonefactor));
|
float tonefactor = MIN(rtonefactor, MIN(gtonefactor,btonefactor));*/
|
||||||
|
|
||||||
r *= tonefactor;
|
r *= tonefactor;
|
||||||
g *= tonefactor;
|
g *= tonefactor;
|
||||||
b *= tonefactor;
|
b *= tonefactor;
|
||||||
r = tonecurve2[r];
|
r = tonecurve2[CLIP(r)];
|
||||||
g = tonecurve2[g];
|
g = tonecurve2[CLIP(g)];
|
||||||
b = tonecurve2[b];
|
b = tonecurve2[CLIP(b)];
|
||||||
|
|
||||||
int x = (toxyz[0][0] * r + toxyz[1][0] * g + toxyz[2][0] * b) >> 15;
|
int x = (toxyz[0][0] * r + toxyz[1][0] * g + toxyz[2][0] * b) >> 15;
|
||||||
int y = (toxyz[0][1] * r + toxyz[1][1] * g + toxyz[2][1] * b) >> 15;
|
int y = (toxyz[0][1] * r + toxyz[1][1] * g + toxyz[2][1] * b) >> 15;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user