<commit_before>#pragma once

#include "ofMain.h"
#include "ofxFXObject.h"
#include "ofxUI.h"
#include "FarnebackPlus.h"
#include "json.h"

typedef Json::Value ShaderMap;

class BaseEffect : public ofxFXObject {

public:
    string name;    
    bool enabled = false;
    
    ofxUISuperCanvas *settings;
    
    FarnebackPlus *farneback;
    
    vector<ofxUIWidget*> widgets;
    void setWidgetVisibility( bool visible ) {
        for ( int i=0; i<widgets.size(); i++ ) {
            widgets[i]->setVisible( visible );
        }
    }

    #if 1
    void disableGuiEvents() {
      /*
      for(std::vector<ofxUIWidget*>::iterator it = widgets.begin(); it != widgets.end(); ++it) {
        (*it)->disableAppDrawCallback();
      }
      */
      //settings->disableAppEventCallbacks();
      settings->disableAppDrawCallback();
    }
    #endif
    
    string getPathToShader() {
        return pathToShader;
    }
    
    void addWidget( ofxUIWidget *widget ) {
        widgets.push_back( widget );
    }
    
    // use this for hot-loading shader while app is running
    void reloadShader() {
        parseShader();
        compileCode();
    }
    
    float amount;
    void setAmount( float v ) {
        amount = v;
    }
    
    ofColor color;
    virtual void setColor( ofColor color ) {
        this->color.set( color );
    }
    
    ofTextureData diffuseTexture;
    void setDiffuseTexture( ofTextureData & diffuseTexture ) {
        this->diffuseTexture = diffuseTexture;
    }
    
    ofTextureData vectorField;
    void setVectorField( ofTextureData & vectorField ) {<commit_msg>Initialising amount to one in BaseEffect<commit_after>#pragma once

#include "ofMain.h"
#include "ofxFXObject.h"
#include "ofxUI.h"
#include "FarnebackPlus.h"
#include "json.h"

typedef Json::Value ShaderMap;

class BaseEffect : public ofxFXObject {

public:
    string name;    
    bool enabled = false;
    
    ofxUISuperCanvas *settings;
    
    FarnebackPlus *farneback;
    
    vector<ofxUIWidget*> widgets;
    void setWidgetVisibility( bool visible ) {
        for ( int i=0; i<widgets.size(); i++ ) {
            widgets[i]->setVisible( visible );
        }
    }

    #if 1
    void disableGuiEvents() {
      /*
      for(std::vector<ofxUIWidget*>::iterator it = widgets.begin(); it != widgets.end(); ++it) {
        (*it)->disableAppDrawCallback();
      }
      */
      //settings->disableAppEventCallbacks();
      settings->disableAppDrawCallback();
    }
    #endif
    
    string getPathToShader() {
        return pathToShader;
    }
    
    void addWidget( ofxUIWidget *widget ) {
        widgets.push_back( widget );
    }
    
    // use this for hot-loading shader while app is running
    void reloadShader() {
        parseShader();
        compileCode();
    }
    
    float amount = 1.0f     ;
    void setAmount( float v ) {
        amount = v;
    }
    
    ofColor color;
    virtual void setColor( ofColor color ) {
        this->color.set( color );
    }
    
    ofTextureData diffuseTexture;
    void setDiffuseTexture( ofTextureData & diffuseTexture ) {
        this->diffuseTexture = diffuseTexture;
    }
    
    ofTextureData vectorField;
    void setVectorField( ofTextureData & vectorField ) {
{'fraction_non_alphanumeric': 0.11100832562442182, 'fraction_numerical': 0.0018501387604070306, 'mean_word_length': 2.337448559670782, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 19, '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': '2331205', 'n_tokens_mistral': 1019, 'n_tokens_neox': 991, 'n_words': 226}