diff options
Diffstat (limited to 'src')
-rwxr-xr-x[-rw-r--r--] | src/effects/BrightnessContrast.qml | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/effects/BrightnessContrast.qml b/src/effects/BrightnessContrast.qml index 5e0f16a..545be08 100644..100755 --- a/src/effects/BrightnessContrast.qml +++ b/src/effects/BrightnessContrast.qml @@ -84,10 +84,8 @@ Item { highp float c = 1.0 + contrast; highp float contrastGainFactor = 1.0 + c * c * c * c * step(0.0, contrast); pixelColor.rgb = ((pixelColor.rgb - 0.5) * (contrastGainFactor * contrast + 1.0)) + 0.5; - pixelColor.rgb += brightness; - pixelColor.rgb *= pixelColor.a; - pixelColor.rgb = mix(pixelColor.rgb, vec3(1.0, 1.0, 1.0), brightness); - gl_FragColor = pixelColor * qt_Opacity; + pixelColor.rgb = mix(pixelColor.rgb, vec3(step(0.0, brightness)), abs(brightness)); + gl_FragColor = vec4(pixelColor.rgb * pixelColor.a, pixelColor.a) * qt_Opacity; } " } |