4 * Copyright (C) 1997-2011 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 HISTOGRAMWINDOW_H
23 #define HISTOGRAMWINDOW_H
27 #include "histogram.inc"
28 #include "histogramwindow.inc"
29 #include "pluginvclient.h"
33 class HistogramSlider : public BC_SubWindow
36 HistogramSlider(HistogramMain *plugin,
45 int input_to_pixel(float input);
56 HistogramMain *plugin;
60 class HistogramParade : public BC_Toggle
63 HistogramParade(HistogramMain *plugin,
69 HistogramMain *plugin;
74 class HistogramCarrot : public BC_Toggle
77 HistogramCarrot(HistogramMain *plugin, HistogramWindow *gui, int x, int y);
78 virtual ~HistogramCarrot();
82 int cursor_motion_event();
83 int button_release_event();
84 int button_press_event();
90 HistogramMain *plugin;
95 class HistogramAuto : public BC_CheckBox
98 HistogramAuto(HistogramMain *plugin, int x, int y);
100 HistogramMain *plugin;
103 class HistogramPlot : public BC_CheckBox
106 HistogramPlot(HistogramMain *plugin, int x, int y);
108 HistogramMain *plugin;
111 class HistogramSplit : public BC_CheckBox
114 HistogramSplit(HistogramMain *plugin, int x, int y);
116 HistogramMain *plugin;
119 class HistogramMode : public BC_Radial
122 HistogramMode(HistogramMain *plugin, int x, int y, int value,
125 HistogramMain *plugin;
129 class HistogramReset : public BC_GenericButton
132 HistogramReset(HistogramMain *plugin, int x, int y);
134 HistogramMain *plugin;
137 class HistogramSelect : public BC_GenericButton
140 HistogramSelect(HistogramMain *plugin, HistogramWindow *gui, int x, int y);
142 HistogramMain *plugin;
143 HistogramWindow *gui;
146 class HistogramClearFrames : public BC_Button
149 HistogramClearFrames(HistogramMain *plugin, HistogramWindow *gui, int x, int y);
151 HistogramMain *plugin;
152 HistogramWindow *gui;
155 class HistogramLogSlider : public BC_FSlider
158 HistogramLogSlider(HistogramMain *plugin, HistogramWindow *gui, int x, int y);
160 HistogramMain *plugin;
161 HistogramWindow *gui;
164 class HistogramFrames : public BC_TumbleTextBox
167 HistogramFrames(HistogramMain *plugin, HistogramWindow *gui, int x, int y);
169 void update(int frames);
171 HistogramMain *plugin;
172 HistogramWindow *gui;
175 class HistogramText : public BC_TumbleTextBox
178 HistogramText(HistogramMain *plugin,
179 HistogramWindow *gui, int x, int y,
180 float hist_min = HIST_MIN_INPUT,
181 float hist_max = HIST_MAX_INPUT);
187 HistogramMain *plugin;
188 HistogramWindow *gui;
191 class HistogramCanvas : public BC_SubWindow
194 HistogramCanvas(HistogramMain *plugin, HistogramWindow *gui,
195 int x, int y, int w, int h);
196 int button_press_event();
197 int cursor_motion_event();
198 int button_release_event();
199 HistogramMain *plugin;
200 HistogramWindow *gui;
203 class HistogramWindow : public PluginClientWindow
206 HistogramWindow(HistogramMain *plugin);
209 void create_objects();
210 void update(int do_canvases, int do_carrots, int do_text, int do_toggles);
211 void draw_canvas_mode(int mode, int color, int y, int h);
212 void update_canvas();
213 int keypress_event();
214 int resize_event(int w, int h);
216 void get_point_extents(HistogramPoint *current,
217 int *x1, int *y1, int *x2, int *y2, int *x, int *y);
219 HistogramSlider *output;
220 HistogramAuto *automatic;
221 HistogramMode *mode_v, *mode_r, *mode_g, *mode_b /*, *mode_a */;
222 HistogramParade *parade_on, *parade_off;
223 HistogramText *low_output;
224 HistogramText *high_output;
225 HistogramText *threshold;
226 HistogramText *low_input;
227 HistogramText *high_input;
228 HistogramText *gamma;
229 HistogramFrames *frames;
230 HistogramCanvas *canvas;
231 HistogramCarrot *low_input_carrot;
232 HistogramCarrot *gamma_carrot;
233 HistogramCarrot *high_input_carrot;
234 HistogramCarrot *low_output_carrot;
235 HistogramCarrot *high_output_carrot;
236 HistogramReset *reset;
237 BC_Title *canvas_title1;
238 BC_Title *canvas_title2;
239 BC_Title *threshold_title;
241 HistogramSelect *select;
242 HistogramClearFrames *clear_frames;
243 HistogramLogSlider *log_slider;
244 BC_Title *log_title1;
245 BC_Title *log_title2;
247 // Value to change with keypresses
249 HistogramMain *plugin;
257 HistogramSplit *split;