package com.haxademic.core.image.filters.shaders;

import processing.core.PApplet;

public class ChromaColorFilter
extends BaseFilter {

	public static ChromaColorFilter instance;
	
	public ChromaColorFilter(PApplet p) {
		super(p, "shaders/filters/chroma-color.glsl");
		setThresholdSensitivity(0.1f);
		setSmoothing(0.7f);
		setColorToReplace(0, 0, 0);
	}
	
	public static ChromaColorFilter instance(PApplet p) {
		if(instance != null) return instance;
		instance = new ChromaColorFilter(p);
		return instance;
	}
	
	public void setThresholdSensitivity(float thresholdSensitivity) {
		shader.set("thresholdSensitivity", thresholdSensitivity);
	}
	
	public void setSmoothing(float smoothing) {
		shader.set("smoothing", smoothing);
	}
	
	public void setColorToReplace(float colorToReplaceR, float colorToReplaceG, float colorToReplaceB) {
		shader.set("colorToReplace", colorToReplaceR, colorToReplaceG, colorToReplaceB);
	}
	
}

@@ -921,10 +921,283 @@
 );%0A%09%7D%0A%09%0A
+%09public void presetGreenScreen() %7B%0A%09%09setThresholdSensitivity(0.73f);%0A%09%09setSmoothing(0.08f);%0A%09%09setColorToReplace(0.71f, 0.99f, 0.02f);%0A%09%7D%0A%09%0A%09public void presetBlackKnockout() %7B%0A%09%09setThresholdSensitivity(0.2f);%0A%09%09setSmoothing(0.1f);%0A%09%09setColorToReplace(0.0f, 0.0f, 0.0f);%0A%09%7D%0A
 %7D%0A

Add a couple of chrome presets