4 #include "bcwidgetgrid.h"
5 #include "condition.inc"
13 class PaletteWheelValue
;
16 class PaletteSaturation
;
23 class ColorThread
: public Thread
26 ColorThread(int do_alpha
= 0, char *title
= 0);
31 void start_window(int output
, int alpha
);
32 virtual int handle_new_color(int output
, int alpha
);
33 void update_gui(int output
, int alpha
);
36 friend class ColorWindow
;
39 Condition
*completion
;
40 // protects window, output, alpha
49 class ColorWindow
: public BC_Window
52 ColorWindow(ColorThread
*thread
, int x
, int y
, char *title
);
54 void create_objects();
57 void update_display();
64 PaletteWheelValue
*wheel_value
;
65 PaletteOutput
*output
;
67 PaletteSaturation
*saturation
;
74 float h
, s
, v
, r
, g
, b
, a
;
75 BC_WidgetGrid
*wg
, *wg1
, *wg2
;
79 class PaletteWheel
: public BC_SubWindow
82 PaletteWheel(ColorWindow
*window
, int x
, int y
);
84 int button_press_event();
85 int cursor_motion_event();
86 int button_release_event();
89 int draw(float hue
, float saturation
);
90 int get_angle(float x1
, float y1
, float x2
, float y2
);
91 float torads(float angle
);
98 class PaletteWheelValue
: public BC_SubWindow
101 PaletteWheelValue(ColorWindow
*window
, int x
, int y
);
102 ~PaletteWheelValue();
103 int create_objects();
104 int button_press_event();
105 int cursor_motion_event();
106 int button_release_event();
107 int draw(float hue
, float saturation
, float value
);
114 class PaletteOutput
: public BC_SubWindow
117 PaletteOutput(ColorWindow
*window
, int x
, int y
);
119 int create_objects();
125 class PaletteHue
: public BC_ISlider
128 PaletteHue(ColorWindow
*window
, int x
, int y
);
134 class PaletteSaturation
: public BC_FSlider
137 PaletteSaturation(ColorWindow
*window
, int x
, int y
);
138 ~PaletteSaturation();
143 class PaletteValue
: public BC_FSlider
146 PaletteValue(ColorWindow
*window
, int x
, int y
);
152 class PaletteRed
: public BC_FSlider
155 PaletteRed(ColorWindow
*window
, int x
, int y
);
161 class PaletteGreen
: public BC_FSlider
164 PaletteGreen(ColorWindow
*window
, int x
, int y
);
170 class PaletteBlue
: public BC_FSlider
173 PaletteBlue(ColorWindow
*window
, int x
, int y
);
179 class PaletteAlpha
: public BC_FSlider
182 PaletteAlpha(ColorWindow
*window
, int x
, int y
);