<commit_before>#include "MainFrame.h"
#include <wx/aboutdlg.h>
#include "utils/RGBImage.hpp"


MainFrame::MainFrame(wxWindow* parent)
    : MainFrameBaseClass(parent)
{
    RGBImage rgbImage(1000, 1000);
    for(int y = 0; y < rgbImage.height(); ++y){
        for(int x = 0; x < rgbImage.width(); ++x){
            rgbImage.setPixel(x, y, x*y);
        }
    }
    
    wxImage image(rgbImage.width(), rgbImage.height(), rgbImage.data());
    rgbImage.releaseOwnership();
    
    wxBitmap bitmap(image);
    
    m_outputBitmap->SetBitmap(bitmap);
    
}

MainFrame::~MainFrame()<commit_msg>generating image using prime numbers; isPrime posibly wrong<commit_after>#include "MainFrame.h"
#include <wx/aboutdlg.h>
#include "utils/RGBImage.hpp"
#include <cmath>

bool isPrime(int x) {
    if(x <= 2){
        return true;
    }
    
    int root = std::sqrt(x)+1;
    
    for(int i = 2; i < root; ++i){
        if((x % i) == 0){
            return false;
        }
    }
    return true;
}
MainFrame::MainFrame(wxWindow* parent)
    : MainFrameBaseClass(parent)
{
    RGBImage rgbImage(1000, 1000);
    for(int y = 0; y < rgbImage.height(); ++y){
        for(int x = 0; x < rgbImage.width(); ++x){
            int index = x + y*rgbImage.width();
            if(isPrime(index)){
                rgbImage.setPixel(x, y, 0x00FF00);
            } else {
                rgbImage.setPixel(x, y, 0x000000);
            }
        }
    }
    
    wxImage image(rgbImage.width(), rgbImage.height(), rgbImage.data());
    rgbImage.releaseOwnership();
    
    wxBitmap bitmap(image);
    
    m_outputBitmap->SetBitmap(bitmap);
    
}

MainFrame::~MainFrame()
{'fraction_non_alphanumeric': 0.15342631898120074, 'fraction_numerical': 0.021831412977562158, 'mean_word_length': 2.459119496855346, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 8, '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': '4199448', 'n_tokens_mistral': 614, 'n_tokens_neox': 564, 'n_words': 112}