histogram fix, use_thumbnails fix, zoom popup width tweak, cut/paste for mixer apply...
[goodguy/cinelerra.git] / cinelerra-5.1 / plugins / histogram / histogramwindow.h
1
2 /*
3  * CINELERRA
4  * Copyright (C) 1997-2011 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 "histogram.inc"
28 #include "histogramwindow.inc"
29 #include "pluginvclient.h"
30
31
32
33 class HistogramSlider : public BC_SubWindow
34 {
35 public:
36         HistogramSlider(HistogramMain *plugin,
37                 HistogramWindow *gui,
38                 int x,
39                 int y,
40                 int w,
41                 int h,
42                 int is_input);
43
44         void update();
45         int input_to_pixel(float input);
46
47         int operation;
48         enum
49         {
50                 NONE,
51                 DRAG_INPUT,
52                 DRAG_MIN_OUTPUT,
53                 DRAG_MAX_OUTPUT,
54         };
55         int is_input;
56         HistogramMain *plugin;
57         HistogramWindow *gui;
58 };
59
60 class HistogramParade : public BC_Toggle
61 {
62 public:
63         HistogramParade(HistogramMain *plugin,
64                 HistogramWindow *gui,
65                 int x,
66                 int y,
67                 int value);
68         int handle_event();
69         HistogramMain *plugin;
70         HistogramWindow *gui;
71         int value;
72 };
73
74 class HistogramCarrot : public BC_Toggle
75 {
76 public:
77         HistogramCarrot(HistogramMain *plugin,
78                 HistogramWindow *gui,
79                 int x,
80                 int y);
81         virtual ~HistogramCarrot();
82
83         void update();
84         float* get_value();
85         int cursor_motion_event();
86         int button_release_event();
87         int button_press_event();
88
89         int starting_x;
90         int offset_x;
91         int offset_y;
92         int drag_operation;
93         HistogramMain *plugin;
94         HistogramWindow *gui;
95 };
96
97
98 class HistogramAuto : public BC_CheckBox
99 {
100 public:
101         HistogramAuto(HistogramMain *plugin,
102                 int x,
103                 int y);
104         int handle_event();
105         HistogramMain *plugin;
106 };
107
108 class HistogramPlot : public BC_CheckBox
109 {
110 public:
111         HistogramPlot(HistogramMain *plugin,
112                 int x,
113                 int y);
114         int handle_event();
115         HistogramMain *plugin;
116 };
117
118 class HistogramSplit : public BC_CheckBox
119 {
120 public:
121         HistogramSplit(HistogramMain *plugin,
122                 int x,
123                 int y);
124         int handle_event();
125         HistogramMain *plugin;
126 };
127
128 class HistogramMode : public BC_Radial
129 {
130 public:
131         HistogramMode(HistogramMain *plugin,
132                 int x,
133                 int y,
134                 int value,
135                 char *text);
136         int handle_event();
137         HistogramMain *plugin;
138         int value;
139 };
140
141 class HistogramReset : public BC_GenericButton
142 {
143 public:
144         HistogramReset(HistogramMain *plugin,
145                 int x,
146                 int y);
147         int handle_event();
148         HistogramMain *plugin;
149 };
150
151 class HistogramText : public BC_TumbleTextBox
152 {
153 public:
154         HistogramText(HistogramMain *plugin,
155                 HistogramWindow *gui, int x, int y,
156                 float hist_min = HIST_MIN_INPUT,
157                 float hist_max = HIST_MAX_INPUT);
158
159         int handle_event();
160         void update();
161         float* get_value();
162
163         HistogramMain *plugin;
164         HistogramWindow *gui;
165 };
166
167 class HistogramCanvas : public BC_SubWindow
168 {
169 public:
170         HistogramCanvas(HistogramMain *plugin,
171                 HistogramWindow *gui,
172                 int x,
173                 int y,
174                 int w,
175                 int h);
176         int button_press_event();
177         int cursor_motion_event();
178         int button_release_event();
179         HistogramMain *plugin;
180         HistogramWindow *gui;
181 };
182
183 class HistogramWindow : public PluginClientWindow
184 {
185 public:
186         HistogramWindow(HistogramMain *plugin);
187         ~HistogramWindow();
188
189         void create_objects();
190         void update(int do_canvases,
191                 int do_carrots,
192                 int do_text,
193                 int do_toggles);
194         void draw_canvas_mode(int mode, int color, int y, int h);
195         void update_canvas();
196         int keypress_event();
197         int resize_event(int w, int h);
198
199         void get_point_extents(HistogramPoint *current,
200                 int *x1,
201                 int *y1,
202                 int *x2,
203                 int *y2,
204                 int *x,
205                 int *y);
206
207         HistogramSlider *output;
208         HistogramAuto *automatic;
209         HistogramMode *mode_v, *mode_r, *mode_g, *mode_b /*,  *mode_a */;
210         HistogramParade *parade_on, *parade_off;
211         HistogramText *low_output;
212         HistogramText *high_output;
213         HistogramText *threshold;
214         HistogramText *low_input;
215         HistogramText *high_input;
216         HistogramText *gamma;
217         HistogramCanvas *canvas;
218         HistogramCarrot *low_input_carrot;
219         HistogramCarrot *gamma_carrot;
220         HistogramCarrot *high_input_carrot;
221         HistogramCarrot *low_output_carrot;
222         HistogramCarrot *high_output_carrot;
223         HistogramReset *reset;
224         BC_Title *canvas_title1;
225         BC_Title *canvas_title2;
226         BC_Title *threshold_title;
227         BC_Bar *bar;
228
229 // Value to change with keypresses
230         float *active_value;
231         HistogramMain *plugin;
232         int canvas_w;
233         int canvas_h;
234         int title1_x;
235         int title2_x;
236         int title3_x;
237         int title4_x;
238         HistogramPlot *plot;
239         HistogramSplit *split;
240 };
241
242
243
244
245
246
247
248 #endif