- int xs5 = xS(5), xs10 = xS(10), xs30 = xS(30), xs100 = xS(100), xs240 = xS(240);
- int ys5 = yS(5), ys10 = yS(10), ys25 = yS(25), ys50 = yS(50);
- int y = ys10, y1, x1 = 0, x2 = xs10;
- int x = xs30;
-
- BC_Title *title;
- BC_Bar *bar;
- int ymargin = get_text_height(MEDIUMFONT) + xs5;
- int ymargin2 = get_text_height(MEDIUMFONT) + ys10;
-
- add_subwindow (title = new BC_Title (x2, y, _("Color:")));
-
- add_subwindow (color = new ChromaKeyColor (plugin, this, x, y + ys25));
-
- add_subwindow (sample =
- new BC_SubWindow (x + color->get_w () + xs10, y, xs100, ys50));
- y += sample->get_h () + ys10;
-
- add_subwindow (use_colorpicker =
- new ChromaKeyUseColorPicker (plugin, this, x, y));
- y += use_colorpicker->get_h() + ys10;
-
- add_subwindow (new ChromaKeyReset (plugin, this, x2+xs240, y));
- add_subwindow (show_mask = new ChromaKeyShowMask (plugin, x2, y));
- y += show_mask->get_h() + ys5;
-
- add_subwindow(bar = new BC_Bar(x2, y, get_w() - x2 * 2));
- y += bar->get_h() + ys5;
- y1 = y;
- add_subwindow (new BC_Title (x2, y, _("Key parameters:")));
- y += ymargin;
- add_subwindow (title = new BC_Title (x, y, _("Hue Tolerance:")));
- if(title->get_w() > x1) x1 = title->get_w();
- y += ymargin;
- add_subwindow (title = new BC_Title (x, y, _("Min. Brightness:")));
- if(title->get_w() > x1) x1 = title->get_w();
- y += ymargin;
- add_subwindow (title = new BC_Title (x, y, _("Max. Brightness:")));
- if(title->get_w() > x1) x1 = title->get_w();
- y += ymargin;
- add_subwindow (title = new BC_Title (x, y, _("Saturation Offset:")));
- if(title->get_w() > x1) x1 = title->get_w();
- y += ymargin;
- add_subwindow (title = new BC_Title (x, y, _("Min Saturation:")));
- if(title->get_w() > x1) x1 = title->get_w();
- y += ymargin2;
-
- add_subwindow(bar = new BC_Bar(x2, y, get_w() - x2 * 2));
- y += bar->get_h() + ys5;
- add_subwindow (title = new BC_Title (x2, y, _("Mask tweaking:")));
- y += ymargin;
- add_subwindow (title = new BC_Title (x, y, _("In Slope:")));
- if(title->get_w() > x1) x1 = title->get_w();
- y += ymargin;
- add_subwindow (title = new BC_Title (x, y, _("Out Slope:")));
- if(title->get_w() > x1) x1 = title->get_w();
- y += ymargin;
- add_subwindow (title = new BC_Title (x, y, _("Alpha Offset:")));
- if(title->get_w() > x1) x1 = title->get_w();
- y += ymargin2;
-
-
-
- add_subwindow(bar = new BC_Bar(x2, y, get_w() - x2 * 2));
- y += bar->get_h() + ys5;
- add_subwindow (title = new BC_Title (x2, y, _("Spill light control:")));
- y += ymargin;
- add_subwindow (title = new BC_Title (x, y, _("Spill Threshold:")));
- if(title->get_w() > x1) x1 = title->get_w();
- y += ymargin;
- add_subwindow (title = new BC_Title (x, y, _("Spill Compensation:")));
- if(title->get_w() > x1) x1 = title->get_w();
- y += ymargin;
-
-
- y = y1;
- y += ymargin;
- x1 += x;
-
-
-
- add_subwindow (tolerance = new ChromaKeyTolerance (plugin, x1, y));
- y += ymargin;
- add_subwindow (min_brightness = new ChromaKeyMinBrightness (plugin, x1, y));
- y += ymargin;
- add_subwindow (max_brightness = new ChromaKeyMaxBrightness (plugin, x1, y));
- y += ymargin;
- add_subwindow (saturation = new ChromaKeySaturation (plugin, x1, y));
- y += ymargin;
- add_subwindow (min_saturation = new ChromaKeyMinSaturation (plugin, x1, y));
- y += ymargin;
-
- y += bar->get_h() + ys5;
- y += ymargin2;
- add_subwindow (in_slope = new ChromaKeyInSlope (plugin, x1, y));
- y += ymargin;
- add_subwindow (out_slope = new ChromaKeyOutSlope (plugin, x1, y));
- y += ymargin;
- add_subwindow (alpha_offset = new ChromaKeyAlphaOffset (plugin, x1, y));
- y += ymargin;
-
- y += bar->get_h() + ys5;
- y += ymargin2;
- add_subwindow (spill_threshold = new ChromaKeySpillThreshold (plugin, x1, y));
- y += ymargin;
- add_subwindow (spill_amount = new ChromaKeySpillAmount (plugin, x1, y));
-
- color_thread = new ChromaKeyColorThread (plugin, this);
-
- update_sample ();
- show_window ();
+ int xs10 = xS(10), xs20 = xS(20), xs100 = xS(100), xs200 = xS(200);
+ int ys10 = yS(10), ys20 = yS(20), ys30 = yS(30), ys40 = yS(40), ys50 = yS(50);
+ int y = ys10, x2 = xS(160), x3 = xS(260);
+ int x = xs10;
+ int clr_x = get_w()-x - xS(22); // note: clrBtn_w = 22
+
+ BC_Title *title;
+ BC_TitleBar *title_bar;
+ BC_Bar *bar;
+
+// Color section
+ add_subwindow(title_bar = new BC_TitleBar(x, y, get_w()-2*x, xs20, xs10, _("Color")));
+ y += ys20;
+
+ add_subwindow (color = new ChromaKeyColor (plugin, this, x, y));
+ // Info for Sample rectangle: x_slider w_slider w_sample
+ // \ | / y, w, h
+ add_subwindow (sample = new BC_SubWindow (x3 + xs200 - xs100, y, xs100, ys50));
+ y += ys30;
+ add_subwindow (use_colorpicker = new ChromaKeyUseColorPicker (plugin, this, x, y));
+ y += ys30;
+ add_subwindow (show_mask = new ChromaKeyShowMask (plugin, x, y));
+
+// Key parameters section
+ y += ys30;
+ add_subwindow(title_bar = new BC_TitleBar(x, y, get_w()-2*x, xs20, xs10, _("Key parameters")));
+ y += ys20;
+ add_subwindow (title = new BC_Title (x, y, _("Hue Tolerance:")));
+ tolerance_text = new ChromaKeyFText(plugin, this,
+ 0, &(plugin->config.tolerance), (x + x2), y, MIN_VALUE, MAX_VALUE);
+ tolerance_text->create_objects();
+ tolerance_slider = new ChromaKeyFSlider(plugin,
+ tolerance_text, &(plugin->config.tolerance), x3, y, MIN_VALUE, MAX_VALUE, xs200);
+ add_subwindow(tolerance_slider);
+ tolerance_text->slider = tolerance_slider;
+ clr_x = x3 + tolerance_slider->get_w() + x;
+ add_subwindow(tolerance_Clr = new ChromaKeyClr(plugin, this, clr_x, y, RESET_TOLERANCE));
+ y += ys30;
+
+ add_subwindow (title = new BC_Title (x, y, _("Min. Brightness:")));
+ min_brightness_text = new ChromaKeyFText(plugin, this,
+ 0, &(plugin->config.min_brightness), (x + x2), y,
+ MIN_VALUE, MAX_VALUE);
+ min_brightness_text->create_objects();
+ min_brightness_slider = new ChromaKeyFSlider(plugin,
+ min_brightness_text, &(plugin->config.min_brightness), x3, y, MIN_VALUE, MAX_VALUE, xs200);
+ add_subwindow(min_brightness_slider);
+ min_brightness_text->slider = min_brightness_slider;
+ add_subwindow(min_brightness_Clr = new ChromaKeyClr(plugin, this, clr_x, y, RESET_MIN_BRIGHTNESS));
+ y += ys30;
+
+ add_subwindow (title = new BC_Title (x, y, _("Max. Brightness:")));
+ max_brightness_text = new ChromaKeyFText(plugin, this,
+ 0, &(plugin->config.max_brightness), (x + x2), y, MIN_VALUE, MAX_VALUE);
+ max_brightness_text->create_objects();
+ max_brightness_slider = new ChromaKeyFSlider(plugin,
+ max_brightness_text, &(plugin->config.max_brightness), x3, y, MIN_VALUE, MAX_VALUE, xs200);
+ add_subwindow(max_brightness_slider);
+ max_brightness_text->slider = max_brightness_slider;
+ add_subwindow(max_brightness_Clr = new ChromaKeyClr(plugin, this, clr_x, y, RESET_MAX_BRIGHTNESS));
+ y += ys30;
+
+ add_subwindow (title = new BC_Title (x, y, _("Saturation Offset:")));
+ saturation_text = new ChromaKeyFText(plugin, this,
+ 0, &(plugin->config.saturation), (x + x2), y, MIN_VALUE, MAX_VALUE);
+ saturation_text->create_objects();
+ saturation_slider = new ChromaKeyFSlider(plugin,
+ saturation_text, &(plugin->config.saturation), x3, y, MIN_VALUE, MAX_VALUE, xs200);
+ add_subwindow(saturation_slider);
+ saturation_text->slider = saturation_slider;
+ add_subwindow(saturation_Clr = new ChromaKeyClr(plugin, this, clr_x, y, RESET_SATURATION));
+ y += ys30;
+
+ add_subwindow (title = new BC_Title (x, y, _("Min Saturation:")));
+ min_saturation_text = new ChromaKeyFText(plugin, this,
+ 0, &(plugin->config.min_saturation), (x + x2), y, MIN_VALUE, MAX_VALUE);
+ min_saturation_text->create_objects();
+ min_saturation_slider = new ChromaKeyFSlider(plugin,
+ min_saturation_text, &(plugin->config.min_saturation), x3, y, MIN_VALUE, MAX_VALUE, xs200);
+ add_subwindow(min_saturation_slider);
+ min_saturation_text->slider = min_saturation_slider;
+ add_subwindow(min_saturation_Clr = new ChromaKeyClr(plugin, this, clr_x, y, RESET_MIN_SATURATION));
+ y += ys40;
+
+// Mask tweaking section
+ add_subwindow(title_bar = new BC_TitleBar(x, y, get_w()-2*x, xs20, xs10, _("Mask tweaking")));
+ y += ys20;
+ add_subwindow (title = new BC_Title (x, y, _("In Slope:")));
+ in_slope_text = new ChromaKeyFText(plugin, this,
+ 0, &(plugin->config.in_slope), (x + x2), y, MIN_SLOPE, MAX_SLOPE);
+ in_slope_text->create_objects();
+ in_slope_slider = new ChromaKeyFSlider(plugin,
+ in_slope_text, &(plugin->config.in_slope), x3, y, MIN_SLOPE, MAX_SLOPE, xs200);
+ add_subwindow(in_slope_slider);
+ in_slope_text->slider = in_slope_slider;
+ add_subwindow(in_slope_Clr = new ChromaKeyClr(plugin, this, clr_x, y, RESET_IN_SLOPE));
+ y += ys30;
+
+ add_subwindow (title = new BC_Title (x, y, _("Out Slope:")));
+ out_slope_text = new ChromaKeyFText(plugin, this,
+ 0, &(plugin->config.out_slope), (x + x2), y, MIN_SLOPE, MAX_SLOPE);
+ out_slope_text->create_objects();
+ out_slope_slider = new ChromaKeyFSlider(plugin,
+ out_slope_text, &(plugin->config.out_slope), x3, y, MIN_SLOPE, MAX_SLOPE, xs200);
+ add_subwindow(out_slope_slider);
+ out_slope_text->slider = out_slope_slider;
+ add_subwindow(out_slope_Clr = new ChromaKeyClr(plugin, this, clr_x, y, RESET_OUT_SLOPE));
+ y += ys30;
+
+ add_subwindow (title = new BC_Title (x, y, _("Alpha Offset:")));
+ alpha_offset_text = new ChromaKeyFText(plugin, this,
+ 0, &(plugin->config.alpha_offset), (x + x2), y, -MAX_ALPHA, MAX_ALPHA);
+ alpha_offset_text->create_objects();
+ alpha_offset_slider = new ChromaKeyFSlider(plugin,
+ alpha_offset_text, &(plugin->config.alpha_offset), x3, y, -MAX_ALPHA, MAX_ALPHA, xs200);
+ add_subwindow(alpha_offset_slider);
+ alpha_offset_text->slider = alpha_offset_slider;
+ add_subwindow(alpha_offset_Clr = new ChromaKeyClr(plugin, this, clr_x, y, RESET_ALPHA_OFFSET));
+ y += ys40;
+
+// Spill light control section
+ add_subwindow(title_bar = new BC_TitleBar(x, y, get_w()-2*x, xs20, xs10, _("Spill light control")));
+ y += ys20;
+ add_subwindow (title = new BC_Title (x, y, _("Spill Threshold:")));
+ spill_threshold_text = new ChromaKeyFText(plugin, this,
+ 0, &(plugin->config.spill_threshold), (x + x2), y, MIN_VALUE, MAX_VALUE);
+ spill_threshold_text->create_objects();
+ spill_threshold_slider = new ChromaKeyFSlider(plugin,
+ spill_threshold_text, &(plugin->config.spill_threshold), x3, y, MIN_VALUE, MAX_VALUE, xs200);
+ add_subwindow(spill_threshold_slider);
+ spill_threshold_text->slider = spill_threshold_slider;
+ add_subwindow(spill_threshold_Clr = new ChromaKeyClr(plugin, this, clr_x, y, RESET_SPILL_THRESHOLD));
+ y += ys30;
+
+ add_subwindow (title = new BC_Title (x, y, _("Spill Compensation:")));
+ spill_amount_text = new ChromaKeyFText(plugin, this,
+ 0, &(plugin->config.spill_amount), (x + x2), y, MIN_VALUE, MAX_VALUE);
+ spill_amount_text->create_objects();
+ spill_amount_slider = new ChromaKeyFSlider(plugin,
+ spill_amount_text, &(plugin->config.spill_amount), x3, y, MIN_VALUE, MAX_VALUE, xs200);
+ add_subwindow(spill_amount_slider);
+ spill_amount_text->slider = spill_amount_slider;
+ add_subwindow(spill_amount_Clr = new ChromaKeyClr(plugin, this, clr_x, y, RESET_SPILL_AMOUNT));
+ y += ys40;
+
+// Reset section
+ add_subwindow(bar = new BC_Bar(x, y, get_w()-2*x));
+ y += ys10;
+ add_subwindow(reset = new ChromaKeyReset(plugin, this, x, y));
+
+ color_thread = new ChromaKeyColorThread (plugin, this);
+
+ update_sample();
+ show_window();