<commit_before>/**
 * @author <NAME> / Copyright Orange 2013
 * 
 * Apply a mask based on color distance to the input frame
 * 
 * threshold: the distance threshold (0 to 1)
 * 
 */
(function(global) {

    // Register this filter
    global.addFilter(
        // Filter name
        'colormask',
        // Vertex Shader (null uses default)
        null,
        // Fragment Shader (null uses default)        
        '\
        uniform sampler2D texture;\
        uniform sampler2D reference;\
        uniform float ts;\
        varying vec2 texCoord;\
        void main() {\
            vec4 color = texture2D(texture, texCoord);\
            vec4 rcolor = texture2D(reference, texCoord);\
            float dist2 = pow(color.r-rcolor.r,2.0);\
            dist2 += pow(color.g-rcolor.g,2.0);\
            dist2 += pow(color.b-rcolor.b,2.0);\
        \
            gl_FragColor = dist2>ts*ts ? color: vec4(0.0,0.0,0.0,color.a);\
        }\
        ',
        // Uniforms callback
        function (gl, program, frameIn, frameOut, reference, threshold) {
            // Bind reference texture at position 1
            gl.activeTexture(gl.TEXTURE1);
            gl.bindTexture(gl.TEXTURE_2D, reference.asTexture());
            // Set reference uniform to position 1
            var refLocation = gl.getUniformLocation(program, "reference");
            gl.uniform1i(refLocation, 1);
            // Set threshold
            var tsLocation = gl.getUniformLocation(program, "ts");
            gl.uniform1f(tsLocation, threshold);
        }
    );
    
})(glimp);<commit_msg>Set mask alpha to 0<commit_after>/**
 * @author <NAME> / Copyright Orange 2013
 * 
 * Apply a mask based on color distance to the input frame
 * 
 * threshold: the distance threshold (0 to 1)
 * 
 */
(function(global) {

    // Register this filter
    global.addFilter(
        // Filter name
        'colormask',
        // Vertex Shader (null uses default)
        null,
        // Fragment Shader (null uses default)        
        '\
        uniform sampler2D texture;\
        uniform sampler2D reference;\
        uniform float ts;\
        varying vec2 texCoord;\
        void main() {\
            vec4 color = texture2D(texture, texCoord);\
            vec4 rcolor = texture2D(reference, texCoord);\
            float dist2 = pow(color.r-rcolor.r,2.0);\
            dist2 += pow(color.g-rcolor.g,2.0);\
            dist2 += pow(color.b-rcolor.b,2.0);\
        \
            gl_FragColor = dist2>ts*ts ? color: vec4(0.0,0.0,0.0,0);\
        }\
        ',
        // Uniforms callback
        function (gl, program, frameIn, frameOut, reference, threshold) {
            // Bind reference texture at position 1
            gl.activeTexture(gl.TEXTURE1);
            gl.bindTexture(gl.TEXTURE_2D, reference.asTexture());
            // Set reference uniform to position 1
            var refLocation = gl.getUniformLocation(program, "reference");
            gl.uniform1i(refLocation, 1);
            // Set threshold
            var tsLocation = gl.getUniformLocation(program, "ts");
            gl.uniform1f(tsLocation, threshold);
        }
    );
    
})(glimp);
{'fraction_non_alphanumeric': 0.11785260482846252, 'fraction_numerical': 0.0241423125794155, 'mean_word_length': 1.8065953654188949, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '1274972', 'n_tokens_mistral': 938, 'n_tokens_neox': 894, 'n_words': 233}