<commit_before>package com.gabmus.co2photoeditor;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.opengl.GLES20;
import android.opengl.GLSurfaceView;
import android.opengl.GLUtils;

class FilterSurfaceView extends GLSurfaceView
{

    public final FilterRenderer renderer;
    public MainActivity activity;

    public FilterSurfaceView(Context context, MainActivity act)
    {

        super(context);
        setEGLContextClientVersion(2);
        activity = act;
        renderer = new FilterRenderer(this);
        setRenderer(renderer);
    }

    public Bitmap toLoad = null;


    public boolean IsUsedBitmap()
    {
        return !default_b;
    }
    private boolean startup = true;
    private boolean default_b = true;
    public void LoadBitmap(Bitmap bmp)
    {
        if (!startup && default_b) default_b = false;
        startup = false;
        toLoad = bmp;
        renderer.BOOL_LoadTexture = true;
    }
    public void LoadTexture(Bitmap bmp)
    {
        renderer.ImageHeigth = bmp.getHeight();
        renderer.ImageWidth = bmp.getWidth();
        renderer.hToFilterTexture = loadTexture(bmp);
        if (renderer.target1 != null)
        renderer.target1.Release();
        if (renderer.target2 != null)
        renderer.target2.Release();
        if (renderer.saveTarget != null)
            renderer.saveTarget.Release();
        if (renderer.blur1 != null) renderer.blur1.Release();
        if (renderer.blur2 != null) renderer.blur2.Release();
        renderer.target1 = new RenderTarget2D(bmp.getWidth(), bmp.getHeight());
        renderer.target2 = new RenderTarget2D(bmp.getWidth(), bmp.getHeight());
        renderer.saveTarget = new RenderTarget2D(bmp.getWidth(), bmp.getHeight());
        renderer.blur1 = new RenderTarget2D(bmp.getWidth() /2, bmp.getHeight() / 2);
        renderer.blur2 = new RenderTarget2D(bmp.getWidth() / 2, bmp.getHeight() / 2);
    }

    private int[] loadTexture(Bitmap bitmap)
    {
        final int[] textureHandle = new int[1];


        GLES20.glGenTextures(1, textureHandle, 0);
        if (textureHandle[0] == 0)throw(new RuntimeException("SHEEEEET"));

        GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, textureHandle[0]);

        GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_NEAREST);
        GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_NEAREST);

        GLUtils.texImage2D(GLES20.GL_TEXTURE_2D, 0, bitmap, 0);
        bitmap.recycle();


        return textureHandle;
    }

    public void SaveImage(String location)
    {
        renderer.SaveImage = true;
        renderer.SavePath = location;
    }


    public Bitmap generateTestBitmap()
    {
        int width = getWidth();
        int height = getHeight();
        Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
        bitmap.setPixel(10, 10, 0xFFFFFFFF);
        Canvas c = new Canvas(bitmap);
        Paint p = new Paint();
        p.setColor(0x0000FFFF);
        for (int x = 0; x < width; x++) {
            for (int y = 0; y < height; y++)
            {
                bitmap.setPixel(x, y, 0x9FF9F9FF);
            }
        }
        p.setColor(0xFFFFFFFF);
        c.drawLine(2, 52, 152, 350, p);
        p.setColor(0xFF00FFFF);
        p.setTextSize(15);
        c.drawText("CASHMADAFFACCA", 300, 300, p);

        //Bitmap bemp = BitmapFactory.decodeResource(getResources(), R.drawable.abc_list_selector_disabled_holo_light);
        return bitmap;
    }

    public Bitmap generateTestBitmap2()
    {
        int width = 600;
        int height = 800;
        Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
        bitmap.setPixel(10, 10, 0xFFFFFFFF);
        Canvas c = new Canvas(bitmap);
        Paint p = new Paint();
        p.setColor(0xFFFFFFFF);
        c.drawLine(2, 52, 152, 350, p);
        p.setColor(0xFF0FFFFF);
        p.setTextSize(15);
        c.drawText("CASHMADAFFACCA2", 300, 300, p);

        //Bitmap bemp = BitmapFactory.decodeResource(getResources(), R.drawable.abc_list_selector_disabled_holo_light);
        return bitmap;
    }
}<commit_msg>bloom<commit_after>package com.gabmus.co2photoeditor;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.opengl.GLES20;
import android.opengl.GLSurfaceView;
import android.opengl.GLUtils;

class FilterSurfaceView extends GLSurfaceView
{

    public final FilterRenderer renderer;
    public MainActivity activity;

    public FilterSurfaceView(Context context, MainActivity act)
    {

        super(context);
        setEGLContextClientVersion(2);
        activity = act;
        renderer = new FilterRenderer(this);
        setRenderer(renderer);
    }

    public Bitmap toLoad = null;


    public boolean IsUsedBitmap()
    {
        return !default_b;
    }
    private boolean startup = true;
    private boolean default_b = true;
    public void LoadBitmap(Bitmap bmp)
    {
        if (!startup && default_b) default_b = false;
        startup = false;
        toLoad = bmp;
        renderer.BOOL_LoadTexture = true;
    }
    public void LoadTexture(Bitmap bmp)
    {
        renderer.ImageHeigth = bmp.getHeight();
        renderer.ImageWidth = bmp.getWidth();
        renderer.hToFilterTexture = loadTexture(bmp);
        if (renderer.target1 != null)
        renderer.target1.Release();
        if (renderer.target2 != null)
        renderer.target2.Release();
        if (renderer.saveTarget != null)
            renderer.saveTarget.Release();
        if (renderer.blur1 != null) renderer.blur1.Release();
        if (renderer.blur2 != null) renderer.blur2.Release();
        renderer.target1 = new RenderTarget2D(bmp.getWidth(), bmp.getHeight());
        renderer.target2 = new RenderTarget2D(bmp.getWidth(), bmp.getHeight());
        renderer.saveTarget = new RenderTarget2D(bmp.getWidth(), bmp.getHeight());
        renderer.blur1 = new RenderTarget2D(bmp.getWidth() /2, bmp.getHeight() / 2);
        renderer.blur2 = new RenderTarget2D(bmp.getWidth() / 2, bmp.getHeight() / 2);
    }

    private int[] loadTexture(Bitmap bitmap)
    {
        final int[] textureHandle = new int[1];


        GLES20.glGenTextures(1, textureHandle, 0);
        if (textureHandle[0] == 0)throw(new RuntimeException("SHEEEEET"));

        GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, textureHandle[0]);

        GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_NEAREST);
        GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_NEAREST);

        GLUtils.texImage2D(GLES20.GL_TEXTURE_2D, 0, bitmap, 0);
        bitmap.recycle();


        return textureHandle;
    }

    public void SaveImage(String location)
    {
        renderer.SaveImage = true;
        renderer.SavePath = location;
    }


    public Bitmap generateTestBitmap()
    {
        int width = getWidth();
        int height = getHeight();
        Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
        bitmap.setPixel(10, 10, 0xFFFFFFFF);
        Canvas c = new Canvas(bitmap);
        Paint p = new Paint();
        p.setColor(0x0000FFFF);
        for (int x = 0; x < width; x++) {
            for (int y = 0; y < height; y++)
            {
                bitmap.setPixel(x, y, 0xFF000000);
            }
        }

        //Bitmap bemp = BitmapFactory.decodeResource(getResources(), R.drawable.abc_list_selector_disabled_holo_light);
        return bitmap;
    }

}
{'fraction_non_alphanumeric': 0.11067708333333333, 'fraction_numerical': 0.029296875, 'mean_word_length': 2.6927884615384614, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 5, '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': '6000168', 'n_tokens_mistral': 2585, 'n_tokens_neox': 2403, 'n_words': 483}