Fix some value and code duplication in parameter initialization.

This commit is contained in:
Adam Reichold
2016-02-07 13:35:16 +01:00
parent d2c13ff1aa
commit 246115ecb2
2 changed files with 13 additions and 30 deletions

View File

@@ -41,8 +41,6 @@ const int numprof = 7;
void ImProcFunctions::lab2monitorRgb (LabImage* lab, Image8* image)
{
//gamutmap(lab);
if (monitorTransform) {
int W = lab->W;
@@ -386,15 +384,7 @@ Image16* ImProcFunctions::lab2rgb16b (LabImage* lab, int cx, int cy, int cw, int
Image16* image = new Image16 (cw, ch);
float p1, p2, p3, p4, p5, p6; //primaries
//default primaries
p1 = 0.7347; //Prophoto primaries
p2 = 0.2653;
p3 = 0.1596;
p4 = 0.8404;
p5 = 0.0366;
p6 = 0.0001;
//double ga0,ga1,ga2,ga3,ga4,ga5=0.0,ga6=0.0;//gamma parameters
double g_a0, g_a1, g_a2, g_a3, g_a4, g_a5; //gamma parameters
double pwr;
double ts;
@@ -409,15 +399,7 @@ Image16* ImProcFunctions::lab2rgb16b (LabImage* lab, int cx, int cy, int cw, int
//primaries for 7 working profiles ==> output profiles
// eventually to adapt primaries if RT used special profiles !
if(profi == "ProPhoto") {
p1 = 0.7347; //Prophoto primaries
p2 = 0.2653;
p3 = 0.1596;
p4 = 0.8404;
p5 = 0.0366;
p6 = 0.0001;
select_temp = 1;
} else if (profi == "WideGamut") {
if (profi == "WideGamut") {
p1 = 0.7350; //Widegamut primaries
p2 = 0.2650;
p3 = 0.1150;
@@ -465,6 +447,14 @@ Image16* ImProcFunctions::lab2rgb16b (LabImage* lab, int cx, int cy, int cw, int
p5 = 0.1300;
p6 = 0.0350;
select_temp = 1;
} else {
p1 = 0.7347; //ProPhoto and default primaries
p2 = 0.2653;
p3 = 0.1596;
p4 = 0.8404;
p5 = 0.0366;
p6 = 0.0001;
select_temp = 1;
}
if (!freegamma) {//if Free gamma not selected