olaf neophyte and de.po updates, valgrind tweaks, delete green lady, inkscape dpi=96
[goodguy/history.git] / cinelerra-5.1 / plugins / histogram_bezier / bistogramwindow.C
index b1329e57e35c08588b27b982fc03284b31e317e5..8aa9c49ec03fea62f6ffa33c889e9278c75ef584 100644 (file)
@@ -35,10 +35,16 @@ HistogramWindow::HistogramWindow(HistogramMain *plugin)
  : PluginClientWindow(plugin, 440, 480, 440, 480, 0)
 {
        this->plugin = plugin;
+       max_picon = 0;
+       mid_picon = 0;
+       min_picon = 0;
 }
 
 HistogramWindow::~HistogramWindow()
 {
+       delete max_picon;
+       delete mid_picon;
+       delete min_picon;
 }
 
 #include "min_picon_png.h"
@@ -258,13 +264,13 @@ void HistogramWindow::update_mode()
 
 void HistogramWindow::draw_canvas_overlay()
 {
-       canvas->set_color(0x00ff00);
        int y1;
 
 // Calculate output curve
        plugin->tabulate_curve(plugin->mode, 0);
 
 // Draw output line
+       canvas->set_color(0xffff00);
        for(int i = 0; i < canvas_w; i++)
        {
                float input = (float)i /
@@ -281,11 +287,13 @@ void HistogramWindow::draw_canvas_overlay()
                y1 = y2;
        }
 
+       int x0 = 0, y0 = 0;
 // Draw output points
        HistogramPoint *current = plugin->config.points[plugin->mode].first;
        int number = 0;
        while(current)
        {
+               canvas->set_color(0x00ff00);
                int x = (int)((current->x - HIST_MIN_INPUT) * canvas_w / FLOAT_RANGE);
                int y = (int)(canvas_h - current->y * canvas_h);
                if(number == plugin->current_point)
@@ -293,26 +301,27 @@ void HistogramWindow::draw_canvas_overlay()
                else
                        canvas->draw_rectangle(x - BOX_SIZE / 2, y - BOX_SIZE / 2, BOX_SIZE, BOX_SIZE);
 
+               if( number > 0 )
+                       canvas->draw_line(x0, y0, x, y);
+               x0 = x;  y0 = y;
 //Draw gradients
-       if (plugin->config.smoothMode > HISTOGRAM_LINEAR)
-       {
-               int x1,x2,y1,y2;
-               canvas->set_color(0x0000ff);
-               x2 = (int)((current->x + current->xoffset_right - HIST_MIN_INPUT) * canvas_w / FLOAT_RANGE);
-               x1 = (int)((current->x + current->xoffset_left - HIST_MIN_INPUT) * canvas_w / FLOAT_RANGE);
-               y2 = (int)(canvas_h - (current->y + current->xoffset_right * current->gradient) * canvas_h);
-               y1 = (int)(canvas_h - (current->y + current->xoffset_left * current->gradient) * canvas_h);
-/*             x2 = x + (title3_x - title2_x)/20;
-               x1 = x - (title3_x - title2_x)/20;
-               y1 = y + (int)(current->gradient * (float)(canvas_h)/20.0);
-               y2 = y - (int)(current->gradient * (float)(canvas_h)/20.0);
-//             int y2 = (int)(canvas_h - canvas_h * (current->y + current->gradient /10));*/
-               canvas->draw_line(x1,y1,x2,y2);
-
-               canvas->draw_circle(x1 - BOX_SIZE / 4, y1 - BOX_SIZE / 4, BOX_SIZE/2, BOX_SIZE/2);
-               canvas->draw_circle(x2 - BOX_SIZE / 4, y2 - BOX_SIZE / 4, BOX_SIZE/2, BOX_SIZE/2);
-               canvas->set_color(0x00ff00);
-       }
+               if (plugin->config.smoothMode > HISTOGRAM_LINEAR) {
+                       int x1,x2,y1,y2;
+                       canvas->set_color(0x0000ff);
+                       x2 = (int)((current->x + current->xoffset_right - HIST_MIN_INPUT) * canvas_w / FLOAT_RANGE);
+                       x1 = (int)((current->x + current->xoffset_left - HIST_MIN_INPUT) * canvas_w / FLOAT_RANGE);
+                       y2 = (int)(canvas_h - (current->y + current->xoffset_right * current->gradient) * canvas_h);
+                       y1 = (int)(canvas_h - (current->y + current->xoffset_left * current->gradient) * canvas_h);
+/*                     x2 = x + (title3_x - title2_x)/20;
+                       x1 = x - (title3_x - title2_x)/20;
+                       y1 = y + (int)(current->gradient * (float)(canvas_h)/20.0);
+                       y2 = y - (int)(current->gradient * (float)(canvas_h)/20.0);
+//                     int y2 = (int)(canvas_h - canvas_h * (current->y + current->gradient /10));*/
+                       canvas->draw_line(x1,y1,x2,y2);
+
+                       canvas->draw_circle(x1 - BOX_SIZE / 4, y1 - BOX_SIZE / 4, BOX_SIZE/2, BOX_SIZE/2);
+                       canvas->draw_circle(x2 - BOX_SIZE / 4, y2 - BOX_SIZE / 4, BOX_SIZE/2, BOX_SIZE/2);
+               }
 
                current = NEXT;
                number++;
@@ -431,8 +440,8 @@ int HistogramCanvas::button_press_event()
                                        dragID = 1;
                                        break;
                                }
-                               if (plugin->config.smoothMode == HISTOGRAM_LINEAR)
-                                 break;
+//                             if (plugin->config.smoothMode == HISTOGRAM_LINEAR)
+//                               break;
 
                                int xright =
                                  (int)((current->x + current->xoffset_right - HIST_MIN_INPUT) * gui->canvas_w / FLOAT_RANGE);