<commit_before>// precision highp float;

varying vec2 vTextureCoord;
uniform sampler2D uSampler;

uniform vec4 filterArea;
uniform vec4 filterClamp;
uniform vec2 dimensions;
uniform float aspect;

uniform sampler2D displacementMap;
uniform float offset;
uniform float sinDir;
uniform float cosDir;
uniform int fillMode;

uniform float seed;
uniform vec2 red;
uniform vec2 green;
uniform vec2 blue;

const int TRANSPARENT = 0;
const int ORIGINAL = 1;
const int LOOP = 2;
const int MIRROR = 3;

void main(void)
{
    vec2 coord = (vTextureCoord * filterArea.xy) / dimensions;

    if (coord.x > 1.0 || coord.y > 1.0) {
        return;
    }

    float cx = coord.x - 0.5;
    float cy = (coord.y - 0.5) * aspect;

    float ny = (-sinDir * cx + cosDir * cy) / aspect + 0.5;

    ny = ny < 0. ? 1. + ny : (ny > 1. ? ny - 1. : ny);

    vec4 dc = texture2D(displacementMap, vec2(0.5, ny));

    float displacement = (dc.r - 0.5) * (offset / filterArea.x);

    coord += vec2(cosDir * displacement, sinDir * displacement * aspect);

    if( coord.x > 1.0 ) {
        if ( fillMode == ORIGINAL) {
            gl_FragColor = texture2D(uSampler, vTextureCoord);
            return;
        } else if ( fillMode == LOOP) {
            coord.x -= 1.0;
        } else if ( fillMode == MIRROR) {
            coord.x = 1.0 - (coord.x - 1.0);
        } else {
            gl_FragColor = vec4(0., 0., 0., 0.);
            return;
        }
    } else if( coord.x < 0.0 ) {
        if ( fillMode == ORIGINAL) {
            gl_FragColor = texture2D(uSampler, vTextureCoord);
            return;
        } else if ( fillMode == LOOP) {
            coord.x += 1.0;
        } else if ( fillMode == MIRROR) {
            coord.x *= -1.0;
        } else {
            gl_FragColor = vec4(0., 0., 0., 0.);
            return;
        }
    }

    if( coord.y > 1.0 ) {
        if ( fillMode == ORIGINAL) {
            gl_FragColor = texture2D(uSampler, vTextureCoord);
            return;
        } else if ( fillMode == LOOP) {
            coord.y -= 1.0;
        } else if ( fillMode == MIRROR) {
            coord.y = 1.0 - (coord.y - 1.0);
        } else {
            gl_FragColor = vec4(0., 0., 0., 0.);
            return;<commit_msg>cosmetic<commit_after>// precision highp float;

varying vec2 vTextureCoord;
uniform sampler2D uSampler;

uniform vec4 filterArea;
uniform vec4 filterClamp;
uniform vec2 dimensions;
uniform float aspect;

uniform sampler2D displacementMap;
uniform float offset;
uniform float sinDir;
uniform float cosDir;
uniform int fillMode;

uniform float seed;
uniform vec2 red;
uniform vec2 green;
uniform vec2 blue;

const int TRANSPARENT = 0;
const int ORIGINAL = 1;
const int LOOP = 2;
const int MIRROR = 3;

void main(void)
{
    vec2 coord = (vTextureCoord * filterArea.xy) / dimensions;

    if (coord.x > 1.0 || coord.y > 1.0) {
        return;
    }

    float cx = coord.x - 0.5;
    float cy = (coord.y - 0.5) * aspect;

    float ny = (-sinDir * cx + cosDir * cy) / aspect + 0.5;

    // repeat
    // ny = ny > 1.0 ? ny - 1.0 : (ny < 0.0 ? 1.0 + ny : ny);

    // mirror
    ny = ny > 1.0 ? 2.0 - ny : (ny < 0.0 ? -ny : ny);

    vec4 dc = texture2D(displacementMap, vec2(0.5, ny));

    float displacement = (dc.r - 0.5) * (offset / filterArea.x);

    coord += vec2(cosDir * displacement, sinDir * displacement * aspect);

    if( coord.x > 1.0 ) {
        if ( fillMode == ORIGINAL) {
            gl_FragColor = texture2D(uSampler, vTextureCoord);
            return;
        } else if ( fillMode == LOOP) {
            coord.x -= 1.0;
        } else if ( fillMode == MIRROR) {
            coord.x = 2.0 - coord.x;
        } else {
            gl_FragColor = vec4(0., 0., 0., 0.);
            return;
        }
    } else if( coord.x < 0.0 ) {
        if ( fillMode == ORIGINAL) {
            gl_FragColor = texture2D(uSampler, vTextureCoord);
            return;
        } else if ( fillMode == LOOP) {
            coord.x += 1.0;
        } else if ( fillMode == MIRROR) {
            coord.x *= -1.0;
        } else {
            gl_FragColor = vec4(0., 0., 0., 0.);
            return;
        }
    }

    if( coord.y > 1.0 ) {
        if ( fillMode == ORIGINAL) {
            gl_FragColor = texture2D(uSampler, vTextureCoord);
            return;
        } else if ( fillMode == LOOP) {
            coord.y -= 1.0;
        } else if ( fillMode == MIRROR) {
            coord.y = 2.0 - coord.y;
        } else {
            gl_FragColor = vec4(0., 0., 0., 0.);
            return;
{'fraction_non_alphanumeric': 0.13423563345906367, 'fraction_numerical': 0.03505657865542489, 'mean_word_length': 1.7538179596823458, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 14, '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': '4487445', 'n_tokens_mistral': 1669, 'n_tokens_neox': 1564, 'n_words': 436}