9a7bab4ea5e2de4b3edafe3dd7b18c91113636aa
[goodguy/history.git] / cinelerra-5.1 / plugins / histogram_bezier / bistogramwindow.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 HISTOGRAMWINDOW_H
23 #define HISTOGRAMWINDOW_H
24
25
26
27 #include "bistogram.inc"
28 #include "bistogramwindow.inc"
29 #include "pluginvclient.h"
30
31
32 class HistogramSmoothMode : public BC_PopupMenu
33 {
34 public:
35         HistogramSmoothMode(HistogramMain *client,
36                 HistogramWindow *window,
37                 int x,
38                 int y);
39         void create_objects();
40         static char* to_text(int shape);
41         static int from_text(char *text);
42         int handle_event();
43         HistogramMain *plugin;
44         HistogramWindow *gui;
45 };
46
47 class HistogramSlider : public BC_SubWindow
48 {
49 public:
50         HistogramSlider(HistogramMain *plugin,
51                 HistogramWindow *gui,
52                 int x,
53                 int y,
54                 int w,
55                 int h,
56                 int is_input);
57
58         void update();
59         int button_press_event();
60         int button_release_event();
61         int cursor_motion_event();
62         int input_to_pixel(float input);
63
64         int operation;
65         enum
66         {
67                 NONE,
68                 DRAG_INPUT,
69                 DRAG_MIN_OUTPUT,
70                 DRAG_MAX_OUTPUT,
71         };
72         int is_input;
73         HistogramMain *plugin;
74         HistogramWindow *gui;
75 };
76
77 class HistogramAuto : public BC_CheckBox
78 {
79 public:
80         HistogramAuto(HistogramMain *plugin,
81                 int x,
82                 int y);
83         int handle_event();
84         HistogramMain *plugin;
85 };
86
87 class HistogramSplit : public BC_CheckBox
88 {
89 public:
90         HistogramSplit(HistogramMain *plugin,
91                 int x,
92                 int y);
93         int handle_event();
94         HistogramMain *plugin;
95 };
96
97 class HistogramMode : public BC_Radial
98 {
99 public:
100         HistogramMode(HistogramMain *plugin,
101                 int x,
102                 int y,
103                 int value,
104                 char *text);
105         int handle_event();
106         HistogramMain *plugin;
107         int value;
108 };
109
110 class HistogramReset : public BC_GenericButton
111 {
112 public:
113         HistogramReset(HistogramMain *plugin,
114                 int x,
115                 int y);
116         int handle_event();
117         HistogramMain *plugin;
118 };
119
120
121 class HistogramOutputText : public BC_TumbleTextBox
122 {
123 public:
124         HistogramOutputText(HistogramMain *plugin,
125                 HistogramWindow *gui,
126                 int x,
127                 int y,
128                 float *output);
129         int handle_event();
130         HistogramMain *plugin;
131         float *output;
132 };
133
134 class HistogramInputText : public BC_TumbleTextBox
135 {
136 public:
137         HistogramInputText(HistogramMain *plugin,
138                 HistogramWindow *gui,
139                 int x,
140                 int y,
141                 int do_x);
142
143         int handle_event();
144         void update();
145
146         HistogramMain *plugin;
147         HistogramWindow *gui;
148         int do_x;
149 };
150
151 class HistogramCanvas : public BC_SubWindow
152 {
153 public:
154         HistogramCanvas(HistogramMain *plugin,
155                 HistogramWindow *gui,
156                 int x,
157                 int y,
158                 int w,
159                 int h);
160         int button_press_event();
161         int cursor_motion_event();
162         int button_release_event();
163         HistogramMain *plugin;
164         HistogramWindow *gui;
165 };
166
167 class HistogramWindow : public PluginClientWindow
168 {
169 public:
170         HistogramWindow(HistogramMain *plugin);
171         ~HistogramWindow();
172
173         void create_objects();
174         void update(int do_input);
175         void update_mode();
176         void update_canvas();
177         void draw_canvas_overlay();
178         void update_input();
179         void update_output();
180         int keypress_event();
181
182         HistogramSlider *output;
183         HistogramAuto *automatic;
184         HistogramSplit *split;
185         HistogramSmoothMode *smoothModeChoser;
186         HistogramMode *mode_v, *mode_r, *mode_g, *mode_b /*,  *mode_a */;
187         HistogramOutputText *output_min;
188         HistogramOutputText *output_max;
189         HistogramOutputText *threshold;
190         HistogramInputText *input_x;
191         HistogramInputText *input_y;
192         HistogramCanvas *canvas;
193         HistogramMain *plugin;
194         int canvas_w;
195         int canvas_h;
196         int title1_x;
197         int title2_x;
198         int title3_x;
199         int title4_x;
200         BC_Pixmap *max_picon, *mid_picon, *min_picon;
201 };
202
203
204 #endif