00001 #ifndef HISTOGRAMWINDOW_H
00002 #define HISTOGRAMWINDOW_H
00003
00004
00005
00006 #include "histogram.inc"
00007 #include "histogramwindow.inc"
00008 #include "pluginvclient.h"
00009
00010
00011
00012 class HistogramSlider : public BC_SubWindow
00013 {
00014 public:
00015 HistogramSlider(HistogramMain *plugin,
00016 HistogramWindow *gui,
00017 int x,
00018 int y,
00019 int w,
00020 int h,
00021 int is_input);
00022
00023 void update();
00024 int button_press_event();
00025 int button_release_event();
00026 int cursor_motion_event();
00027 int input_to_pixel(float input);
00028
00029 int operation;
00030 enum
00031 {
00032 NONE,
00033 DRAG_INPUT,
00034 DRAG_MIN_OUTPUT,
00035 DRAG_MAX_OUTPUT,
00036 };
00037 int is_input;
00038 HistogramMain *plugin;
00039 HistogramWindow *gui;
00040 };
00041
00042 class HistogramAuto : public BC_CheckBox
00043 {
00044 public:
00045 HistogramAuto(HistogramMain *plugin,
00046 int x,
00047 int y);
00048 int handle_event();
00049 HistogramMain *plugin;
00050 };
00051
00052 class HistogramPlot : public BC_CheckBox
00053 {
00054 public:
00055 HistogramPlot(HistogramMain *plugin,
00056 int x,
00057 int y);
00058 int handle_event();
00059 HistogramMain *plugin;
00060 };
00061
00062 class HistogramSplit : public BC_CheckBox
00063 {
00064 public:
00065 HistogramSplit(HistogramMain *plugin,
00066 int x,
00067 int y);
00068 int handle_event();
00069 HistogramMain *plugin;
00070 };
00071
00072 class HistogramMode : public BC_Radial
00073 {
00074 public:
00075 HistogramMode(HistogramMain *plugin,
00076 int x,
00077 int y,
00078 int value,
00079 char *text);
00080 int handle_event();
00081 HistogramMain *plugin;
00082 int value;
00083 };
00084
00085 class HistogramReset : public BC_GenericButton
00086 {
00087 public:
00088 HistogramReset(HistogramMain *plugin,
00089 int x,
00090 int y);
00091 int handle_event();
00092 HistogramMain *plugin;
00093 };
00094
00095 class HistogramOutputText : public BC_TumbleTextBox
00096 {
00097 public:
00098 HistogramOutputText(HistogramMain *plugin,
00099 HistogramWindow *gui,
00100 int x,
00101 int y,
00102 float *output);
00103 int handle_event();
00104 HistogramMain *plugin;
00105 float *output;
00106 };
00107
00108 class HistogramInputText : public BC_TumbleTextBox
00109 {
00110 public:
00111 HistogramInputText(HistogramMain *plugin,
00112 HistogramWindow *gui,
00113 int x,
00114 int y,
00115 int do_x);
00116
00117 int handle_event();
00118 void update();
00119
00120 HistogramMain *plugin;
00121 HistogramWindow *gui;
00122 int do_x;
00123 };
00124
00125 class HistogramCanvas : public BC_SubWindow
00126 {
00127 public:
00128 HistogramCanvas(HistogramMain *plugin,
00129 HistogramWindow *gui,
00130 int x,
00131 int y,
00132 int w,
00133 int h);
00134 int button_press_event();
00135 int cursor_motion_event();
00136 int button_release_event();
00137 HistogramMain *plugin;
00138 HistogramWindow *gui;
00139 };
00140
00141 class HistogramWindow : public BC_Window
00142 {
00143 public:
00144 HistogramWindow(HistogramMain *plugin, int x, int y);
00145 ~HistogramWindow();
00146
00147 int create_objects();
00148 int close_event();
00149 void update(int do_input);
00150 void update_mode();
00151 void update_canvas();
00152 void draw_canvas_overlay();
00153 void update_input();
00154 void update_output();
00155 int keypress_event();
00156 void get_point_extents(HistogramPoint *current,
00157 int *x1,
00158 int *y1,
00159 int *x2,
00160 int *y2,
00161 int *x,
00162 int *y);
00163
00164 HistogramSlider *output;
00165 HistogramAuto *automatic;
00166 HistogramMode *mode_v, *mode_r, *mode_g, *mode_b ;
00167 HistogramOutputText *output_min;
00168 HistogramOutputText *output_max;
00169 HistogramOutputText *threshold;
00170 HistogramInputText *input_x;
00171 HistogramInputText *input_y;
00172 HistogramCanvas *canvas;
00173 HistogramMain *plugin;
00174 int canvas_w;
00175 int canvas_h;
00176 int title1_x;
00177 int title2_x;
00178 int title3_x;
00179 int title4_x;
00180 BC_Pixmap *max_picon, *mid_picon, *min_picon;
00181 HistogramPlot *plot;
00182 HistogramSplit *split;
00183 };
00184
00185
00186
00187 PLUGIN_THREAD_HEADER(HistogramMain, HistogramThread, HistogramWindow)
00188
00189
00190
00191
00192 #endif