igor ru.po
[goodguy/history.git] / cinelerra-5.1 / plugins / threshold / thresholdwindow.h
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
5  *
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.
10  *
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.
15  *
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
19  *
20  */
21
22 #ifndef THRESHOLDWINDOW_H
23 #define THRESHOLDWINDOW_H
24
25 #include "colorpicker.h"
26 #include "guicast.h"
27 #include "pluginvclient.h"
28 #include "threshold.inc"
29 #include "thresholdwindow.inc"
30
31 class ThresholdMin : public BC_TumbleTextBox
32 {
33 public:
34         ThresholdMin(ThresholdMain *plugin,
35                 ThresholdWindow *gui,
36                 int x,
37                 int y,
38                 int w);
39         int handle_event();
40         ThresholdMain *plugin;
41         ThresholdWindow *gui;
42 };
43
44 class ThresholdMax : public BC_TumbleTextBox
45 {
46 public:
47         ThresholdMax(ThresholdMain *plugin,
48                 ThresholdWindow *gui,
49                 int x,
50                 int y,
51                 int w);
52         int handle_event();
53         ThresholdMain *plugin;
54         ThresholdWindow *gui;
55 };
56
57 class ThresholdPlot : public BC_CheckBox
58 {
59 public:
60         ThresholdPlot(ThresholdMain *plugin,
61                 int x,
62                 int y);
63         int handle_event();
64         ThresholdMain *plugin;
65 };
66
67 class ThresholdLowColorButton : public BC_GenericButton
68 {
69 public:
70         ThresholdLowColorButton(ThresholdMain *plugin, ThresholdWindow *window, int x, int y);
71         int handle_event();
72         ThresholdMain *plugin;
73         ThresholdWindow *window;
74 };
75
76 class ThresholdMidColorButton : public BC_GenericButton
77 {
78 public:
79         ThresholdMidColorButton(ThresholdMain *plugin, ThresholdWindow *window, int x, int y);
80         int handle_event();
81         ThresholdMain *plugin;
82         ThresholdWindow *window;
83 };
84
85 class ThresholdHighColorButton : public BC_GenericButton
86 {
87 public:
88         ThresholdHighColorButton(ThresholdMain *plugin, ThresholdWindow *window, int x, int y);
89         int handle_event();
90         ThresholdMain *plugin;
91         ThresholdWindow *window;
92 };
93
94 class ThresholdLowColorThread : public ColorThread
95 {
96 public:
97         ThresholdLowColorThread(ThresholdMain *plugin, ThresholdWindow *window);
98         virtual int handle_new_color(int output, int alpha);
99         ThresholdMain *plugin;
100         ThresholdWindow *window;
101 };
102
103 class ThresholdMidColorThread : public ColorThread
104 {
105 public:
106         ThresholdMidColorThread(ThresholdMain *plugin, ThresholdWindow *window);
107         virtual int handle_new_color(int output, int alpha);
108         ThresholdMain *plugin;
109         ThresholdWindow *window;
110 };
111
112 class ThresholdHighColorThread : public ColorThread
113 {
114 public:
115         ThresholdHighColorThread(ThresholdMain *plugin, ThresholdWindow *window);
116         virtual int handle_new_color(int output, int alpha);
117         ThresholdMain *plugin;
118         ThresholdWindow *window;
119 };
120
121 class ThresholdCanvas : public BC_SubWindow
122 {
123 public:
124         ThresholdCanvas(ThresholdMain *plugin,
125                 ThresholdWindow *gui,
126                 int x,
127                 int y,
128                 int w,
129                 int h);
130         int button_press_event();
131         int button_release_event();
132         int cursor_motion_event();
133         void draw();
134
135         ThresholdMain *plugin;
136         ThresholdWindow *gui;
137         int state;
138         enum
139         {
140                 NO_OPERATION,
141                 DRAG_SELECTION
142         };
143         int x1;
144         int x2;
145         int center_x;
146 };
147
148 class ThresholdWindow : public PluginClientWindow
149 {
150 public:
151         ThresholdWindow(ThresholdMain *plugin);
152         ~ThresholdWindow();
153
154         void create_objects();
155         void update_low_color();
156         void update_mid_color();
157         void update_high_color();
158
159         ThresholdMain *plugin;
160         ThresholdMin *min;
161         ThresholdMax *max;
162         ThresholdCanvas *canvas;
163         ThresholdPlot *plot;
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;
170
171         int low_color_x,  low_color_y;
172         int mid_color_x,  mid_color_y;
173         int high_color_x, high_color_y;
174 };
175
176 #endif
177
178
179
180
181
182