4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #ifndef THRESHOLDWINDOW_H
23 #define THRESHOLDWINDOW_H
25 #include "colorpicker.h"
27 #include "pluginvclient.h"
28 #include "threshold.inc"
29 #include "thresholdwindow.inc"
31 class ThresholdMin : public BC_TumbleTextBox
34 ThresholdMin(ThresholdMain *plugin,
40 ThresholdMain *plugin;
44 class ThresholdMax : public BC_TumbleTextBox
47 ThresholdMax(ThresholdMain *plugin,
53 ThresholdMain *plugin;
57 class ThresholdPlot : public BC_CheckBox
60 ThresholdPlot(ThresholdMain *plugin,
64 ThresholdMain *plugin;
67 class ThresholdLowColorButton : public BC_GenericButton
70 ThresholdLowColorButton(ThresholdMain *plugin, ThresholdWindow *window, int x, int y);
72 ThresholdMain *plugin;
73 ThresholdWindow *window;
76 class ThresholdMidColorButton : public BC_GenericButton
79 ThresholdMidColorButton(ThresholdMain *plugin, ThresholdWindow *window, int x, int y);
81 ThresholdMain *plugin;
82 ThresholdWindow *window;
85 class ThresholdHighColorButton : public BC_GenericButton
88 ThresholdHighColorButton(ThresholdMain *plugin, ThresholdWindow *window, int x, int y);
90 ThresholdMain *plugin;
91 ThresholdWindow *window;
94 class ThresholdLowColorThread : public ColorThread
97 ThresholdLowColorThread(ThresholdMain *plugin, ThresholdWindow *window);
98 virtual int handle_new_color(int output, int alpha);
99 ThresholdMain *plugin;
100 ThresholdWindow *window;
103 class ThresholdMidColorThread : public ColorThread
106 ThresholdMidColorThread(ThresholdMain *plugin, ThresholdWindow *window);
107 virtual int handle_new_color(int output, int alpha);
108 ThresholdMain *plugin;
109 ThresholdWindow *window;
112 class ThresholdHighColorThread : public ColorThread
115 ThresholdHighColorThread(ThresholdMain *plugin, ThresholdWindow *window);
116 virtual int handle_new_color(int output, int alpha);
117 ThresholdMain *plugin;
118 ThresholdWindow *window;
121 class ThresholdCanvas : public BC_SubWindow
124 ThresholdCanvas(ThresholdMain *plugin,
125 ThresholdWindow *gui,
130 int button_press_event();
131 int button_release_event();
132 int cursor_motion_event();
135 ThresholdMain *plugin;
136 ThresholdWindow *gui;
148 class ThresholdWindow : public PluginClientWindow
151 ThresholdWindow(ThresholdMain *plugin);
154 void create_objects();
155 void update_low_color();
156 void update_mid_color();
157 void update_high_color();
159 ThresholdMain *plugin;
162 ThresholdCanvas *canvas;
164 ThresholdLowColorButton *low_color;
165 ThresholdMidColorButton *mid_color;
166 ThresholdHighColorButton *high_color;
167 ThresholdLowColorThread *low_color_thread;
168 ThresholdMidColorThread *mid_color_thread;
169 ThresholdHighColorThread *high_color_thread;
171 int low_color_x, low_color_y;
172 int mid_color_x, mid_color_y;
173 int high_color_x, high_color_y;