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, HistogramWindow *gui,
37 int x, int y, int w, int h, int is_input);
40 int input_to_pixel(float input);
50 HistogramMain *plugin;
54 class HistogramParade : public BC_Toggle
57 HistogramParade(HistogramMain *plugin, HistogramWindow *gui,
58 int x, int y, int value);
60 HistogramMain *plugin;
65 class HistogramCarrot : public BC_Toggle
68 HistogramCarrot(HistogramMain *plugin, HistogramWindow *gui, int x, int y);
69 virtual ~HistogramCarrot();
73 int cursor_motion_event();
74 int button_release_event();
75 int button_press_event();
81 HistogramMain *plugin;
86 class HistogramAuto : public BC_CheckBox
89 HistogramAuto(HistogramMain *plugin, int x, int y);
91 HistogramMain *plugin;
94 class HistogramPlot : public BC_CheckBox
97 HistogramPlot(HistogramMain *plugin, int x, int y);
99 HistogramMain *plugin;
102 class HistogramSumFrames : public BC_CheckBox
105 HistogramSumFrames(HistogramMain *plugin, int x, int y);
107 HistogramMain *plugin;
110 class HistogramSplit : public BC_CheckBox
113 HistogramSplit(HistogramMain *plugin, int x, int y);
115 HistogramMain *plugin;
118 class HistogramMode : public BC_Radial
121 HistogramMode(HistogramMain *plugin, int x, int y, int value,
124 HistogramMain *plugin;
128 class HistogramReset : public BC_GenericButton
131 HistogramReset(HistogramMain *plugin, int x, int y);
133 HistogramMain *plugin;
136 class HistogramLogSlider : public BC_FSlider
139 HistogramLogSlider(HistogramMain *plugin, HistogramWindow *gui, int x, int y);
141 HistogramMain *plugin;
142 HistogramWindow *gui;
145 class HistogramText : public BC_TumbleTextBox
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);
157 HistogramMain *plugin;
158 HistogramWindow *gui;
161 class HistogramCanvas : public BC_SubWindow
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;
173 class HistogramWindow : public PluginClientWindow
176 HistogramWindow(HistogramMain *plugin);
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);
186 void get_point_extents(HistogramPoint *current,
187 int *x1, int *y1, int *x2, int *y2, int *x, int *y);
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;
210 HistogramLogSlider *log_slider;
211 BC_Title *log_title1;
212 BC_Title *log_title2;
214 // Value to change with keypresses
216 HistogramMain *plugin;
224 HistogramSumFrames *sum_frames;
225 HistogramSplit *split;