Avoid Lab L values which lead to negative Y values when converting Lab to XYZ, fixes #4334

This commit is contained in:
heckflosse
2018-01-25 21:27:10 +01:00
parent c0ceeb2c95
commit 83bc6140bd

View File

@@ -62,7 +62,7 @@ void ImProcFunctions::localContrast(LabImage *lab)
bufval *= (bufval > 0.f) ? light : dark;
}
lab->L[y][x] += bufval;
lab->L[y][x] = std::max(0.0001f, lab->L[y][x] + bufval);
}
}
}