Changes to the contrast/brightness/gamma formula for both hardware and shader gamma correction. Mainly makes a correction with the shader version where contrast/brightness being negative values would clip them inappropriately.
This commit is contained in:
parent
af699dcebc
commit
72491049e0
2 changed files with 3 additions and 3 deletions
|
|
@ -250,8 +250,8 @@ void OpenGLFrameBuffer::DoSetGamma()
|
|||
for (int i = 0; i < 256; i++)
|
||||
{
|
||||
double val = i * contrast - (contrast - 1) * 127;
|
||||
if(gamma != 1) val = pow(val, invgamma) / norm;
|
||||
val += bright * 128;
|
||||
if(gamma != 1) val = pow(val, invgamma) / norm;
|
||||
|
||||
gammaTable[i] = gammaTable[i + 256] = gammaTable[i + 512] = (WORD)clamp<double>(val*256, 0, 0xffff);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue