@@ -71,6 +71,11 @@ uniform vec3 blacklevel;
uniform float gamma;
uniform float contrastExp;
+#if defined(APPLY_LSC)
+uniform bool lsc_enabled;
+uniform sampler2D lsc_tex;
+#endif
+
float apply_contrast(float value)
{
// Apply simple S-curve
@@ -232,6 +237,11 @@ void main(void)
*/
rgb = (rgb - blacklevel) / (1.0 - blacklevel);
+#if defined(APPLY_LSC)
+ if (lsc_enabled)
+ rgb = rgb * texture2D(lsc_tex, textureOut).rgb;
+#endif
+
/* Apply AWB gains, and saturate each channel at sensor range */
rgb = clamp(rgb * awb, vec3(0.0), vec3(1.0));
@@ -30,6 +30,11 @@ uniform vec3 blacklevel;
uniform float gamma;
uniform float contrastExp;
+#if defined(APPLY_LSC)
+uniform bool lsc_enabled;
+uniform sampler2D lsc_tex;
+#endif
+
float apply_contrast(float value)
{
// Apply simple S-curve
@@ -135,6 +140,11 @@ void main(void) {
*/
rgb = (rgb - blacklevel) / (1.0 - blacklevel);
+#if defined(APPLY_LSC)
+ if (lsc_enabled)
+ rgb = rgb * texture2D(lsc_tex, center.xy).rgb;
+#endif
+
/* Apply AWB gains, and saturate each channel at sensor range */
rgb = clamp(rgb * awb, vec3(0.0), vec3(1.0));