Warning, /plasma/kwin/src/plugins/invert/shaders/invert_core.frag is written in an unsupported language. File is not indexed.
0001 #version 140
0002
0003 #include "colormanagement.glsl"
0004 #include "saturation.glsl"
0005
0006 uniform sampler2D sampler;
0007 uniform vec4 modulation;
0008
0009 in vec2 texcoord0;
0010
0011 out vec4 fragColor;
0012
0013 void main()
0014 {
0015 vec4 tex = texture(sampler, texcoord0);
0016 tex = sourceEncodingToNitsInDestinationColorspace(tex);
0017 tex = adjustSaturation(tex);
0018
0019 // to preserve perceptual contrast, apply the inversion in gamma 2.2 space
0020 tex = nitsToEncoding(tex, gamma22_EOTF);
0021 tex.rgb /= max(0.001, tex.a);
0022 tex.rgb = vec3(1.0) - tex.rgb;
0023 tex *= modulation;
0024 tex.rgb *= tex.a;
0025 tex = encodingToNits(tex, gamma22_EOTF);
0026
0027 fragColor = nitsToDestinationEncoding(tex);
0028 }