<commit_before>package com.haxademic.sketch.shader;

import com.haxademic.core.app.P;
import com.haxademic.core.app.PAppletHax;
import com.haxademic.core.image.filters.shaders.BadTVLinesFilter;
import com.haxademic.core.image.filters.shaders.BrightnessFilter;
import com.haxademic.core.image.filters.shaders.ChromaColorFilter;
import com.haxademic.core.image.filters.shaders.CubicLensDistortionFilter;
import com.haxademic.core.image.filters.shaders.DeformTunnelFanFilter;
import com.haxademic.core.image.filters.shaders.HueFilter;
import com.haxademic.core.image.filters.shaders.RadialRipplesFilter;
import com.haxademic.core.image.filters.shaders.SaturationFilter;
import com.haxademic.core.image.filters.shaders.SphereDistortionFilter;
import com.haxademic.core.image.filters.shaders.VignetteFilter;
import com.haxademic.core.math.MathUtil;
import com.haxademic.core.math.easing.EasingFloat;
import com.haxademic.core.system.FileUtil;

import processing.core.PGraphics;
import processing.opengl.PShader;

@SuppressWarnings("serial")
public class ShaderBasicTest
extends PAppletHax {
	
	protected PGraphics _buffer;
	protected PShader _textureShader;
	protected String _textureShaderFile;
	protected float _timeEaseInc = 0;
	protected EasingFloat _timeEaser = new EasingFloat(0, 15);
	float _frames = 100;

	public void setup() {
		super.setup();
		
		_textureShaderFile = FileUtil.getHaxademicDataPath() + "shaders/textures/flame-wisps.glsl";
		_textureShader = p.loadShader( _textureShaderFile );
		
		_buffer = createGraphics( width,  height, P2D );
	}

	public void draw() {
		background(0, 0, 0);
	
		// rendering progress
		float percentComplete = ((float)(p.frameCount%_frames)/_frames);
		float radsComplete = P.TWO_PI * percentComplete;

		_timeEaser.update();
		_timeEaseInc = _timeEaser.value();

		applyTime( _textureShader );
		// applyResolution( _textureShader );
		// applyMouse( _textureShader );
		
		
		_buffer.filter( _textureShader );		
		PGraphics filterTargetCanvas = _buffer;
		<commit_msg>Add color correction filter<commit_after>package com.haxademic.sketch.shader;

import com.haxademic.core.app.P;
import com.haxademic.core.app.PAppletHax;
import com.haxademic.core.image.filters.shaders.BadTVLinesFilter;
import com.haxademic.core.image.filters.shaders.BrightnessFilter;
import com.haxademic.core.image.filters.shaders.ChromaColorFilter;
import com.haxademic.core.image.filters.shaders.ColorCorrectionFilter;
import com.haxademic.core.image.filters.shaders.CubicLensDistortionFilter;
import com.haxademic.core.image.filters.shaders.DeformTunnelFanFilter;
import com.haxademic.core.image.filters.shaders.HueFilter;
import com.haxademic.core.image.filters.shaders.RadialRipplesFilter;
import com.haxademic.core.image.filters.shaders.SaturationFilter;
import com.haxademic.core.image.filters.shaders.SphereDistortionFilter;
import com.haxademic.core.image.filters.shaders.VignetteFilter;
import com.haxademic.core.math.MathUtil;
import com.haxademic.core.math.easing.EasingFloat;
import com.haxademic.core.system.FileUtil;

import processing.core.PGraphics;
import processing.opengl.PShader;

@SuppressWarnings("serial")
public class ShaderBasicTest
extends PAppletHax {
	
	protected PGraphics _buffer;
	protected PShader _textureShader;
	protected String _textureShaderFile;
	protected float _timeEaseInc = 0;
	protected EasingFloat _timeEaser = new EasingFloat(0, 15);
	float _frames = 100;

	public void setup() {
		super.setup();
		
		_textureShaderFile = FileUtil.getHaxademicDataPath() + "shaders/textures/flame-wisps.glsl";
		_textureShader = p.loadShader( _textureShaderFile );
		
		_buffer = createGraphics( width,  height, P2D );
	}

	public void draw() {
		background(0, 0, 0);
	
		// rendering progress
		float percentComplete = ((float)(p.frameCount%_frames)/_frames);
		float radsComplete = P.TWO_PI * percentComplete;

		_timeEaser.update();
		_timeEaseInc = _timeEaser.value();

		applyTime( _textureShader );
		// applyResolution( _textureShader );
		// applyMouse( _textureShader );
		
		
		_buffer.filter( _textureShader );		
		PGraphics filterTargetCanvas = _buffer;
		
		ColorCorrectionFilter.instance(p).setBrightness(0.1f * P.cos(radsComplete));
		ColorCorrectionFilter.instance(p).setContrast(1f + 0.1f * P.sin(radsComplete));
		ColorCorrectionFilter.instance(p).setGamma(1f + 0.2f * P.sin(radsComplete));
		ColorCorrectionFilter.instance(p).applyTo(filterTargetCanvas);

{'fraction_non_alphanumeric': 0.10716708116662899, 'fraction_numerical': 0.006782726656115758, 'mean_word_length': 5.672699849170438, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4327916', 'n_tokens_mistral': 1601, 'n_tokens_neox': 1505, 'n_words': 230}