Commit 4e8e5cf5 authored by Dmitry Kazakov's avatar Dmitry Kazakov

Don't let Luminosity to grow larger than 1.0

parent 30f57cd8
...@@ -543,14 +543,14 @@ void KoColorSpace::increaseLuminosity(quint8 * pixel, qreal step) const{ ...@@ -543,14 +543,14 @@ void KoColorSpace::increaseLuminosity(quint8 * pixel, qreal step) const{
qreal hue, sat, luma = 0.0; qreal hue, sat, luma = 0.0;
toHSY(channelValues, &hue, &sat, &luma); toHSY(channelValues, &hue, &sat, &luma);
luma = pow(luma, 1/2.2); luma = pow(luma, 1/2.2);
luma += step; luma = qMin(1.0, luma + step);
luma = pow(luma, 2.2); luma = pow(luma, 2.2);
channelValues = fromHSY(&hue, &sat, &luma); channelValues = fromHSY(&hue, &sat, &luma);
profile()->delinearizeFloatValue(channelValues); profile()->delinearizeFloatValue(channelValues);
} else { } else {
qreal hue, sat, luma = 0.0; qreal hue, sat, luma = 0.0;
toHSY(channelValues, &hue, &sat, &luma); toHSY(channelValues, &hue, &sat, &luma);
luma += step; luma = qMin(1.0, luma + step);
channelValues = fromHSY(&hue, &sat, &luma); channelValues = fromHSY(&hue, &sat, &luma);
} }
for (int i=0;i<channelnumber;i++){ for (int i=0;i<channelnumber;i++){
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment