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