-// Always plot to set the curves if automatic
- if(config.plot || config.automatic) send_render_gui(frame);
+ if( !engine )
+ {
+ int cpus = input->get_w() * input->get_h() / 0x80000 + 2;
+ int smps = get_project_smp();
+ if( cpus > smps ) cpus = smps;
+ engine = new HistogramEngine(this, cpus, cpus);
+ }
+// if to plot histogram
+ if(config.plot) send_render_gui(frame);