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