本文整理汇总了C++中dt_bauhaus_slider_new_with_range函数的典型用法代码示例。如果您正苦于以下问题:C++ dt_bauhaus_slider_new_with_range函数的具体用法?C++ dt_bauhaus_slider_new_with_range怎么用?C++ dt_bauhaus_slider_new_with_range使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dt_bauhaus_slider_new_with_range函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: malloc
void gui_init (dt_iop_module_t *self)
{
// init the slider (more sophisticated layouts are possible with gtk tables and boxes):
self->gui_data = malloc(sizeof(dt_iop_colorcontrast_gui_data_t));
dt_iop_colorcontrast_gui_data_t *g = (dt_iop_colorcontrast_gui_data_t *)self->gui_data;
dt_iop_colorcontrast_params_t *p = (dt_iop_colorcontrast_params_t *)self->params;
self->widget = gtk_vbox_new(FALSE, DT_BAUHAUS_SPACE);
/* a scale */
g->a_scale = dt_bauhaus_slider_new_with_range(self, 0.0, 5.0, 0.01, p->a_steepness, 2);
dt_bauhaus_widget_set_label(g->a_scale, _("green vs magenta"));
gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET(g->a_scale), TRUE, TRUE, 0);
g_object_set(G_OBJECT(g->a_scale), "tooltip-text",
_("steepness of the a* curve in Lab"), (char *)NULL);
g_signal_connect(G_OBJECT(g->a_scale), "value-changed",
G_CALLBACK(a_slider_callback), self);
/* b scale */
g->b_scale = dt_bauhaus_slider_new_with_range(self, 0.0, 5.0, 0.01, p->b_steepness, 2);
dt_bauhaus_widget_set_label(g->b_scale, _("blue vs yellow"));
gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET(g->b_scale), TRUE, TRUE, 0);
g_object_set(G_OBJECT(g->b_scale), "tooltip-text",
_("steepness of the b* curve in Lab"), (char *)NULL);
g_signal_connect(G_OBJECT(g->b_scale), "value-changed",
G_CALLBACK(b_slider_callback), self);
}
示例2: gui_init
void gui_init(struct dt_iop_module_t *self)
{
self->gui_data = malloc(sizeof(dt_iop_colisa_gui_data_t));
dt_iop_colisa_gui_data_t *g = (dt_iop_colisa_gui_data_t *)self->gui_data;
dt_iop_colisa_params_t *p = (dt_iop_colisa_params_t *)self->params;
self->widget = gtk_box_new(GTK_ORIENTATION_VERTICAL, DT_BAUHAUS_SPACE);
g->contrast = dt_bauhaus_slider_new_with_range(self, -1.0, 1.0, 0.01, p->contrast, 2);
g->brightness = dt_bauhaus_slider_new_with_range(self, -1.0, 1.0, 0.01, p->brightness, 2);
g->saturation = dt_bauhaus_slider_new_with_range(self, -1.0, 1.0, 0.01, p->saturation, 2);
dt_bauhaus_widget_set_label(g->contrast, NULL, _("contrast"));
dt_bauhaus_widget_set_label(g->brightness, NULL, _("brightness"));
dt_bauhaus_widget_set_label(g->saturation, NULL, _("saturation"));
gtk_box_pack_start(GTK_BOX(self->widget), g->contrast, TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(self->widget), g->brightness, TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(self->widget), g->saturation, TRUE, TRUE, 0);
g_object_set(g->contrast, "tooltip-text", _("contrast adjustment"), (char *)NULL);
g_object_set(g->brightness, "tooltip-text", _("brightness adjustment"), (char *)NULL);
g_object_set(g->saturation, "tooltip-text", _("color saturation adjustment"), (char *)NULL);
g_signal_connect(G_OBJECT(g->contrast), "value-changed", G_CALLBACK(contrast_callback), self);
g_signal_connect(G_OBJECT(g->brightness), "value-changed", G_CALLBACK(brightness_callback), self);
g_signal_connect(G_OBJECT(g->saturation), "value-changed", G_CALLBACK(saturation_callback), self);
}
示例3: gui_init
void gui_init(struct dt_iop_module_t *self)
{
self->gui_data = malloc(sizeof(dt_iop_grain_gui_data_t));
dt_iop_grain_gui_data_t *g = (dt_iop_grain_gui_data_t *)self->gui_data;
dt_iop_grain_params_t *p = (dt_iop_grain_params_t *)self->params;
self->widget = gtk_vbox_new(FALSE, DT_BAUHAUS_SPACE);
/* courseness */
g->scale1 = dt_bauhaus_slider_new_with_range(self, 100.0, 3200.0, 20.0, p->scale*53.3, 0);
dt_bauhaus_widget_set_label(g->scale1, _("coarseness"));
dt_bauhaus_slider_set_format(g->scale1,"%.0fISO");
gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET(g->scale1), TRUE, TRUE, 0);
g_object_set(G_OBJECT(g->scale1), "tooltip-text", _("the grain size (~iso of the film)"), (char *)NULL);
g_signal_connect (G_OBJECT (g->scale1), "value-changed",
G_CALLBACK (scale_callback), self);
/* strength */
g->scale2 = dt_bauhaus_slider_new_with_range(self, 0.0, 100.0, 1.0, p->strength, 2);
dt_bauhaus_widget_set_label(g->scale2, _("strength"));
dt_bauhaus_slider_set_format(g->scale2,"%.0f%%");
gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET(g->scale2), TRUE, TRUE, 0);
g_object_set(G_OBJECT(g->scale2), "tooltip-text", _("the strength of applied grain"), (char *)NULL);
g_signal_connect (G_OBJECT (g->scale2), "value-changed",
G_CALLBACK (strength_callback), self);
}
示例4: gui_init
void gui_init(struct dt_iop_module_t *self)
{
self->gui_data = malloc(sizeof(dt_iop_grain_gui_data_t));
dt_iop_grain_gui_data_t *g = (dt_iop_grain_gui_data_t *)self->gui_data;
dt_iop_grain_params_t *p = (dt_iop_grain_params_t *)self->params;
self->widget = gtk_box_new(GTK_ORIENTATION_VERTICAL, DT_BAUHAUS_SPACE);
dt_gui_add_help_link(self->widget, dt_get_help_url(self->op));
/* courseness */
g->scale1 = dt_bauhaus_slider_new_with_range(self, 20.0, 6400.0, 20.0, p->scale * GRAIN_SCALE_FACTOR, 0);
dt_bauhaus_widget_set_label(g->scale1, NULL, _("coarseness"));
dt_bauhaus_slider_set_format(g->scale1, "%.0fISO");
gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET(g->scale1), TRUE, TRUE, 0);
gtk_widget_set_tooltip_text(g->scale1, _("the grain size (~ISO of the film)"));
g_signal_connect(G_OBJECT(g->scale1), "value-changed", G_CALLBACK(scale_callback), self);
/* strength */
g->scale2 = dt_bauhaus_slider_new_with_range(self, 0.0, 100.0, 1.0, p->strength, 2);
dt_bauhaus_widget_set_label(g->scale2, NULL, _("strength"));
dt_bauhaus_slider_set_format(g->scale2, "%.0f%%");
gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET(g->scale2), TRUE, TRUE, 0);
gtk_widget_set_tooltip_text(g->scale2, _("the strength of applied grain"));
g_signal_connect(G_OBJECT(g->scale2), "value-changed", G_CALLBACK(strength_callback), self);
/* midtones bias */
g->scale3 = dt_bauhaus_slider_new_with_range(self, 0.0, 100.0, 1.0, p->midtones_bias, 2);
dt_bauhaus_widget_set_label(g->scale3, NULL, _("midtones bias"));
dt_bauhaus_slider_set_format(g->scale3, "%.0f%%");
gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET(g->scale3), TRUE, TRUE, 0);
gtk_widget_set_tooltip_text(g->scale3, _("amount of midtones bias from the photographic paper response modeling. the greater the bias, the more pronounced the fall off of the grain in shadows and highlights"));
g_signal_connect(G_OBJECT(g->scale3), "value-changed", G_CALLBACK(midtones_bias_callback), self);
}
示例5: gui_init
void gui_init(struct dt_iop_module_t *self)
{
self->gui_data = malloc(sizeof(dt_iop_rlce_gui_data_t));
dt_iop_rlce_gui_data_t *g = (dt_iop_rlce_gui_data_t *)self->gui_data;
dt_iop_rlce_params_t *p = (dt_iop_rlce_params_t *)self->params;
self->widget = GTK_WIDGET(gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0));
g->vbox1 = GTK_BOX(gtk_box_new(GTK_ORIENTATION_VERTICAL, DT_GUI_IOP_MODULE_CONTROL_SPACING));
g->vbox2 = GTK_BOX(gtk_box_new(GTK_ORIENTATION_VERTICAL, DT_GUI_IOP_MODULE_CONTROL_SPACING));
gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET(g->vbox1), FALSE, FALSE, 5);
gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET(g->vbox2), TRUE, TRUE, 5);
g->label1 = dtgtk_reset_label_new(_("radius"), self, &p->radius, sizeof(float));
gtk_box_pack_start(GTK_BOX(g->vbox1), g->label1, TRUE, TRUE, 0);
g->label2 = dtgtk_reset_label_new(_("amount"), self, &p->slope, sizeof(float));
gtk_box_pack_start(GTK_BOX(g->vbox1), g->label2, TRUE, TRUE, 0);
g->scale1 = dt_bauhaus_slider_new_with_range(NULL, 0.0, 256.0, 1.0,
p->radius, 0);
g->scale2 = dt_bauhaus_slider_new_with_range(NULL, 1.0, 3.0, 0.05,
p->slope, 2);
// dtgtk_slider_set_format_type(g->scale2,DARKTABLE_SLIDER_FORMAT_PERCENT);
gtk_box_pack_start(GTK_BOX(g->vbox2), GTK_WIDGET(g->scale1), TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(g->vbox2), GTK_WIDGET(g->scale2), TRUE, TRUE, 0);
gtk_widget_set_tooltip_text(GTK_WIDGET(g->scale1), _("size of features to preserve"));
gtk_widget_set_tooltip_text(GTK_WIDGET(g->scale2), _("strength of the effect"));
g_signal_connect(G_OBJECT(g->scale1), "value-changed", G_CALLBACK(radius_callback), self);
g_signal_connect(G_OBJECT(g->scale2), "value-changed", G_CALLBACK(slope_callback), self);
}
示例6: gui_init
void
gui_init(dt_iop_module_t *self)
{
self->gui_data = malloc(sizeof(dt_iop_profilegamma_gui_data_t));
dt_iop_profilegamma_gui_data_t *g = (dt_iop_profilegamma_gui_data_t *)self->gui_data;
dt_iop_profilegamma_params_t *p = (dt_iop_profilegamma_params_t *)self->params;
self->widget = gtk_vbox_new(TRUE, DT_BAUHAUS_SPACE);
g->linear = dt_bauhaus_slider_new_with_range(self, 0.0, 1.0, 0.0001, p->linear, 4);
g->gamma = dt_bauhaus_slider_new_with_range(self, 0.0, 1.0, 0.0001, p->gamma, 4);
dt_bauhaus_widget_set_label(g->linear, NULL, _("linear"));
dt_bauhaus_widget_set_label(g->gamma, NULL, _("gamma"));
gtk_box_pack_start(GTK_BOX(self->widget), g->linear, TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(self->widget), g->gamma, TRUE, TRUE, 0);
g_object_set(g->linear, "tooltip-text", _("linear part"), (char *)NULL);
g_object_set(g->gamma, "tooltip-text", _("gamma exponential factor"), (char *)NULL);
g_signal_connect (G_OBJECT (g->linear), "value-changed",
G_CALLBACK (linear_callback), self);
g_signal_connect (G_OBJECT (g->gamma), "value-changed",
G_CALLBACK (gamma_callback), self);
}
示例7: gui_init
void gui_init(struct dt_iop_module_t *self)
{
self->gui_data = malloc(sizeof(dt_iop_relight_gui_data_t));
dt_iop_relight_gui_data_t *g = (dt_iop_relight_gui_data_t *)self->gui_data;
dt_iop_relight_params_t *p = (dt_iop_relight_params_t *)self->params;
self->widget = gtk_vbox_new(FALSE, DT_BAUHAUS_SPACE);
g_signal_connect (G_OBJECT (self->widget), "expose-event", G_CALLBACK (expose), self);
/* exposure */
g->scale1 = dt_bauhaus_slider_new_with_range(self,-2.0, 2.0,0.05, p->ev, 2);
dt_bauhaus_slider_set_format(g->scale1,"%.2fEV");
dt_bauhaus_widget_set_label(g->scale1,_("exposure"));
g_object_set(G_OBJECT(g->scale1), "tooltip-text", _("the fill-light in EV"), (char *)NULL);
g_signal_connect (G_OBJECT (g->scale1), "value-changed",
G_CALLBACK (ev_callback), self);
/* width*/
g->scale2 = dt_bauhaus_slider_new_with_range(self,2, 10, 0.5, p->width, 1);
dt_bauhaus_slider_set_format(g->scale2,"%.1f");
dt_bauhaus_widget_set_label(g->scale2,_("width"));
/* xgettext:no-c-format */
g_object_set(G_OBJECT(g->scale2), "tooltip-text", _("width of fill-light area defined in zones"), (char *)NULL);
g_signal_connect (G_OBJECT (g->scale2), "value-changed",
G_CALLBACK (width_callback), self);
/* lightnessslider */
GtkBox *hbox=GTK_BOX (gtk_hbox_new (FALSE,2));
int lightness=32768;
g->gslider1=DTGTK_GRADIENT_SLIDER (dtgtk_gradient_slider_new_with_color ((GdkColor)
{
0,0,0,0
},(GdkColor)
{
0,lightness,lightness,lightness
}));
g_object_set(G_OBJECT (g->gslider1), "tooltip-text", _("select the center of fill-light"), (char *)NULL);
g_signal_connect (G_OBJECT (g->gslider1), "value-changed",
G_CALLBACK (center_callback), self);
g->tbutton1 = DTGTK_TOGGLEBUTTON (dtgtk_togglebutton_new (dtgtk_cairo_paint_colorpicker, CPF_STYLE_FLAT));
gtk_widget_set_size_request(GTK_WIDGET(g->tbutton1),22,22);
g_signal_connect (G_OBJECT (g->tbutton1), "toggled",
G_CALLBACK (picker_callback), self);
gtk_box_pack_start (hbox,GTK_WIDGET (g->gslider1),TRUE,TRUE,0);
gtk_box_pack_start (hbox,GTK_WIDGET (g->tbutton1),FALSE,FALSE,0);
/* add controls to widget ui */
gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET (g->scale1),TRUE,FALSE,0);
gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET (hbox), TRUE,FALSE,0);
gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET (g->scale2),TRUE,FALSE,0);
g_object_set(G_OBJECT(g->tbutton1), "tooltip-text", _("toggle tool for picking median lightness in image"), (char *)NULL);
}
示例8: gui_init
void gui_init(struct dt_iop_module_t *self)
{
self->gui_data = malloc(sizeof(dt_iop_splittoning_gui_data_t));
dt_iop_splittoning_gui_data_t *g = (dt_iop_splittoning_gui_data_t *)self->gui_data;
dt_iop_splittoning_params_t *p = (dt_iop_splittoning_params_t *)self->params;
self->widget = GTK_WIDGET(gtk_vbox_new(FALSE, DT_BAUHAUS_SPACE));
// Shadows
gui_init_tab(self, _("shadows"), &g->colorpick1, &g->gslider1, &g->gslider2);
// Highlights
gui_init_tab(self, _("highlights"), &g->colorpick2, &g->gslider3, &g->gslider4);
// Additional parameters
GtkWidget* hbox=GTK_WIDGET(gtk_hbox_new(FALSE, 0));
GtkWidget* vbox = GTK_WIDGET(gtk_vbox_new(FALSE, 0));
gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(vbox), TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET(hbox), TRUE, TRUE, 0);
g->scale1 = dt_bauhaus_slider_new_with_range(self, 0.0, 100.0, 0.1, p->balance*100.0, 2);
dt_bauhaus_slider_set_format(g->scale1, "%.2f");
dt_bauhaus_widget_set_label(g->scale1, _("balance"));
gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(g->scale1), TRUE, TRUE, 0);
g->scale2 = dt_bauhaus_slider_new_with_range(self, 0.0, 100.0, 1.0, p->compress, 2);
dt_bauhaus_slider_set_format(g->scale2, "%.2f%%");
dt_bauhaus_widget_set_label(g->scale2,_("compress"));
gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(g->scale2), TRUE, TRUE, 0);
g_object_set(G_OBJECT(g->scale1), "tooltip-text", _("the balance of center of splittoning"), (char *)NULL);
g_object_set(G_OBJECT(g->scale2), "tooltip-text", _("compress the effect on highlights/shadows and\npreserve midtones"), (char *)NULL);
g_signal_connect (G_OBJECT (g->gslider1), "value-changed",
G_CALLBACK (hue_callback), self);
g_signal_connect (G_OBJECT (g->gslider3), "value-changed",
G_CALLBACK (hue_callback), self);
g_signal_connect (G_OBJECT (g->gslider2), "value-changed",
G_CALLBACK (saturation_callback), self);
g_signal_connect (G_OBJECT (g->gslider4), "value-changed",
G_CALLBACK (saturation_callback), self);
g_signal_connect (G_OBJECT (g->scale1), "value-changed",
G_CALLBACK (balance_callback), self);
g_signal_connect (G_OBJECT (g->scale2), "value-changed",
G_CALLBACK (compress_callback), self);
g_signal_connect (G_OBJECT (g->colorpick1), "clicked",
G_CALLBACK (colorpick_callback), self);
g_signal_connect (G_OBJECT (g->colorpick2), "clicked",
G_CALLBACK (colorpick_callback), self);
}
示例9: gui_init
void gui_init(struct dt_iop_module_t *self)
{
self->gui_data = malloc(sizeof(dt_iop_lowpass_gui_data_t));
dt_iop_lowpass_gui_data_t *g = (dt_iop_lowpass_gui_data_t *)self->gui_data;
dt_iop_lowpass_params_t *p = (dt_iop_lowpass_params_t *)self->params;
self->widget = gtk_vbox_new(TRUE, DT_BAUHAUS_SPACE);
#if 0 // gaussian is order not user selectable here, as it does not make much sense for a lowpass filter
GtkBox *hbox = GTK_BOX(gtk_hbox_new(FALSE, 5));
gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET(hbox), FALSE, FALSE, 0);
GtkWidget *label = dtgtk_reset_label_new(_("filter order"), self, &p->order, sizeof(float));
gtk_box_pack_start(hbox, label, FALSE, FALSE, 0);
g->order = GTK_COMBO_BOX(gtk_combo_box_new_text());
gtk_combo_box_append_text(g->order, _("0th order"));
gtk_combo_box_append_text(g->order, _("1st order"));
gtk_combo_box_append_text(g->order, _("2nd order"));
gtk_object_set(GTK_OBJECT(g->order), "tooltip-text", _("filter order of gaussian blur"), (char *)NULL);
gtk_box_pack_start(hbox, GTK_WIDGET(g->order), TRUE, TRUE, 0);
#endif
g->scale1 = dt_bauhaus_slider_new_with_range(self,0.1, 200.0, 0.1, p->radius, 2);
g->scale2 = dt_bauhaus_slider_new_with_range(self,-3.0, 3.0, 0.01, p->contrast, 2);
g->scale3 = dt_bauhaus_slider_new_with_range(self,-3.0, 3.0, 0.01, p->saturation, 2);
dt_bauhaus_widget_set_label(g->scale1,_("radius"));
dt_bauhaus_widget_set_label(g->scale2,_("contrast"));
dt_bauhaus_widget_set_label(g->scale3,_("saturation"));
g->bilat = dt_bauhaus_combobox_new(self);
dt_bauhaus_widget_set_label(g->bilat, _("soften with"));
dt_bauhaus_combobox_add(g->bilat, _("gaussian"));
dt_bauhaus_combobox_add(g->bilat, _("bilateral filter"));
gtk_box_pack_start(GTK_BOX(self->widget), g->scale1, TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(self->widget), g->bilat, TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(self->widget), g->scale2, TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(self->widget), g->scale3, TRUE, TRUE, 0);
gtk_object_set(GTK_OBJECT(g->scale1), "tooltip-text", _("radius of gaussian/bilateral blur"), (char *)NULL);
gtk_object_set(GTK_OBJECT(g->scale2), "tooltip-text", _("contrast of lowpass filter"), (char *)NULL);
gtk_object_set(GTK_OBJECT(g->scale3), "tooltip-text", _("color saturation of lowpass filter"), (char *)NULL);
gtk_object_set(GTK_OBJECT(g->bilat), "tooltip-text", _("which filter to use for blurring"), (char *)NULL);
g_signal_connect (G_OBJECT (g->scale1), "value-changed",
G_CALLBACK (radius_callback), self);
g_signal_connect (G_OBJECT (g->bilat), "value-changed",
G_CALLBACK (bilat_callback), self);
g_signal_connect (G_OBJECT (g->scale2), "value-changed",
G_CALLBACK (contrast_callback), self);
g_signal_connect (G_OBJECT (g->scale3), "value-changed",
G_CALLBACK (saturation_callback), self);
#if 0 // gaussian order not user selectable
g_signal_connect (G_OBJECT (g->order), "changed",
G_CALLBACK (order_changed), self);
#endif
}
示例10: gui_init
void gui_init(dt_iop_module_t *self)
{
self->gui_data = malloc(sizeof(dt_iop_rawprepare_gui_data_t));
dt_iop_rawprepare_gui_data_t *g = (dt_iop_rawprepare_gui_data_t *)self->gui_data;
dt_iop_rawprepare_params_t *p = (dt_iop_rawprepare_params_t *)self->params;
self->widget = gtk_box_new(GTK_ORIENTATION_VERTICAL, DT_BAUHAUS_SPACE);
g->box_raw = gtk_box_new(GTK_ORIENTATION_VERTICAL, DT_BAUHAUS_SPACE);
for(int i = 0; i < 4; i++)
{
gchar *label = g_strdup_printf(_("black level %i"), i);
g->black_level_separate[i]
= dt_bauhaus_slider_new_with_range(self, 0, 16384, 1, p->raw_black_level_separate[i], 0);
dt_bauhaus_widget_set_label(g->black_level_separate[i], NULL, label);
gtk_widget_set_tooltip_text(g->black_level_separate[i], label);
gtk_box_pack_start(GTK_BOX(g->box_raw), g->black_level_separate[i], FALSE, FALSE, 0);
dt_bauhaus_slider_enable_soft_boundaries(g->black_level_separate[i], 0, UINT16_MAX);
g_signal_connect(G_OBJECT(g->black_level_separate[i]), "value-changed", G_CALLBACK(callback), self);
g_free(label);
}
g->white_point = dt_bauhaus_slider_new_with_range(self, 0, 16384, 1, p->raw_white_point, 0);
dt_bauhaus_widget_set_label(g->white_point, NULL, _("white point"));
gtk_widget_set_tooltip_text(g->white_point, _("white point"));
gtk_box_pack_start(GTK_BOX(g->box_raw), g->white_point, FALSE, FALSE, 0);
dt_bauhaus_slider_enable_soft_boundaries(g->white_point, 0, UINT16_MAX);
g_signal_connect(G_OBJECT(g->white_point), "value-changed", G_CALLBACK(callback), self);
if(dt_conf_get_bool("plugins/darkroom/rawprepare/allow_editing_crop"))
{
for(int i = 0; i < 4; i++)
{
g->crop[i] = dt_bauhaus_slider_new_with_range(self, 0, 256, 1, p->crop.array[i], 0);
dt_bauhaus_widget_set_label(g->crop[i], NULL, gettext(crop_labels[i].label));
gtk_widget_set_tooltip_text(g->crop[i], gettext(crop_labels[i].tooltip));
gtk_box_pack_start(GTK_BOX(g->box_raw), g->crop[i], FALSE, FALSE, 0);
dt_bauhaus_slider_enable_soft_boundaries(g->crop[i], 0, UINT16_MAX);
g_signal_connect(G_OBJECT(g->crop[i]), "value-changed", G_CALLBACK(callback), self);
}
}
gtk_box_pack_start(GTK_BOX(self->widget), g->box_raw, FALSE, FALSE, 0);
g->label_non_raw
= gtk_label_new(_("raw black/white point correction\nonly works for the sensors that need it."));
gtk_widget_set_halign(g->label_non_raw, GTK_ALIGN_START);
gtk_box_pack_start(GTK_BOX(self->widget), g->label_non_raw, FALSE, FALSE, 0);
}
示例11: gui_init
void gui_init(struct dt_iop_module_t *self)
{
self->gui_data = malloc(sizeof(dt_iop_relight_gui_data_t));
dt_iop_relight_gui_data_t *g = (dt_iop_relight_gui_data_t *)self->gui_data;
dt_iop_relight_params_t *p = (dt_iop_relight_params_t *)self->params;
self->widget = gtk_box_new(GTK_ORIENTATION_VERTICAL, DT_BAUHAUS_SPACE);
g_signal_connect(G_OBJECT(self->widget), "draw", G_CALLBACK(draw), self);
/* exposure */
g->scale1 = dt_bauhaus_slider_new_with_range(self, -2.0, 2.0, 0.05, p->ev, 2);
dt_bauhaus_slider_set_format(g->scale1, "%.2fEV");
dt_bauhaus_widget_set_label(g->scale1, NULL, _("exposure"));
g_object_set(G_OBJECT(g->scale1), "tooltip-text", _("the fill-light in EV"), (char *)NULL);
g_signal_connect(G_OBJECT(g->scale1), "value-changed", G_CALLBACK(ev_callback), self);
/* width*/
g->scale2 = dt_bauhaus_slider_new_with_range(self, 2, 10, 0.5, p->width, 1);
dt_bauhaus_slider_set_format(g->scale2, "%.1f");
dt_bauhaus_widget_set_label(g->scale2, NULL, _("width"));
/* xgettext:no-c-format */
g_object_set(G_OBJECT(g->scale2), "tooltip-text", _("width of fill-light area defined in zones"),
(char *)NULL);
g_signal_connect(G_OBJECT(g->scale2), "value-changed", G_CALLBACK(width_callback), self);
/* lightnessslider */
GtkBox *hbox = GTK_BOX(gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 2));
#define NEUTRAL_GRAY 0.5
static const GdkRGBA _gradient_L[]
= { { 0, 0, 0, 1.0 }, { NEUTRAL_GRAY, NEUTRAL_GRAY, NEUTRAL_GRAY, 1.0 } };
g->gslider1 = DTGTK_GRADIENT_SLIDER(dtgtk_gradient_slider_new_with_color(_gradient_L[0], _gradient_L[1]));
g_object_set(G_OBJECT(g->gslider1), "tooltip-text", _("select the center of fill-light"), (char *)NULL);
g_signal_connect(G_OBJECT(g->gslider1), "value-changed", G_CALLBACK(center_callback), self);
g->tbutton1 = DTGTK_TOGGLEBUTTON(dtgtk_togglebutton_new(dtgtk_cairo_paint_colorpicker, CPF_STYLE_FLAT));
gtk_widget_set_size_request(GTK_WIDGET(g->tbutton1), DT_PIXEL_APPLY_DPI(22), DT_PIXEL_APPLY_DPI(22));
g_signal_connect(G_OBJECT(g->tbutton1), "toggled", G_CALLBACK(picker_callback), self);
gtk_box_pack_start(hbox, GTK_WIDGET(g->gslider1), TRUE, TRUE, 0);
gtk_box_pack_start(hbox, GTK_WIDGET(g->tbutton1), FALSE, FALSE, 0);
/* add controls to widget ui */
gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET(g->scale1), TRUE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET(hbox), TRUE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET(g->scale2), TRUE, FALSE, 0);
g_object_set(G_OBJECT(g->tbutton1), "tooltip-text", _("toggle tool for picking median lightness in image"),
(char *)NULL);
}
示例12: gui_init
void gui_init(dt_iop_module_t *self)
{
self->gui_data = malloc(sizeof(dt_iop_hotpixels_gui_data_t));
dt_iop_hotpixels_gui_data_t *g = (dt_iop_hotpixels_gui_data_t *)self->gui_data;
dt_iop_hotpixels_params_t *p = (dt_iop_hotpixels_params_t *)self->params;
g->pixels_fixed = -1;
self->widget = gtk_box_new(GTK_ORIENTATION_VERTICAL, DT_BAUHAUS_SPACE);
g->box_raw = gtk_box_new(GTK_ORIENTATION_VERTICAL, DT_BAUHAUS_SPACE);
g_signal_connect(G_OBJECT(g->box_raw), "draw", G_CALLBACK(draw), self);
/* threshold */
g->threshold = dt_bauhaus_slider_new_with_range(self, 0.0, 1.0, 0.005, p->threshold, 4);
dt_bauhaus_slider_set_format(g->threshold, "%.4f");
dt_bauhaus_widget_set_label(g->threshold, NULL, _("threshold"));
g_object_set(G_OBJECT(g->threshold), "tooltip-text", _("lower threshold for hot pixel"), NULL);
gtk_box_pack_start(GTK_BOX(g->box_raw), GTK_WIDGET(g->threshold), TRUE, TRUE, 0);
g_signal_connect(G_OBJECT(g->threshold), "value-changed", G_CALLBACK(threshold_callback), self);
/* strength */
g->strength = dt_bauhaus_slider_new_with_range(self, 0.0, 1.0, 0.01, p->strength, 4);
dt_bauhaus_slider_set_format(g->threshold, "%.4f");
dt_bauhaus_widget_set_label(g->strength, NULL, _("strength"));
g_object_set(G_OBJECT(g->strength), "tooltip-text", _("strength of hot pixel correction"), NULL);
gtk_box_pack_start(GTK_BOX(g->box_raw), GTK_WIDGET(g->strength), TRUE, TRUE, 0);
g_signal_connect(G_OBJECT(g->strength), "value-changed", G_CALLBACK(strength_callback), self);
/* 3 neighbours */
g->permissive = GTK_TOGGLE_BUTTON(gtk_check_button_new_with_label(_("detect by 3 neighbors")));
gtk_toggle_button_set_active(g->permissive, p->permissive);
gtk_box_pack_start(GTK_BOX(g->box_raw), GTK_WIDGET(g->permissive), TRUE, TRUE, 0);
g_signal_connect(G_OBJECT(g->permissive), "toggled", G_CALLBACK(permissive_callback), self);
GtkBox *hbox1 = GTK_BOX(gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0));
g->markfixed = GTK_TOGGLE_BUTTON(gtk_check_button_new_with_label(_("mark fixed pixels")));
gtk_toggle_button_set_active(g->markfixed, p->markfixed);
gtk_box_pack_start(GTK_BOX(hbox1), GTK_WIDGET(g->markfixed), TRUE, TRUE, 0);
g_signal_connect(G_OBJECT(g->markfixed), "toggled", G_CALLBACK(markfixed_callback), self);
g->message = GTK_LABEL(gtk_label_new("")); // This gets filled in by process
gtk_box_pack_start(GTK_BOX(hbox1), GTK_WIDGET(g->message), TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(g->box_raw), GTK_WIDGET(hbox1), TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(self->widget), g->box_raw, FALSE, FALSE, 0);
g->label_non_raw = gtk_label_new(_("hot pixel correction\nonly works for raw images."));
gtk_widget_set_halign(g->label_non_raw, GTK_ALIGN_START);
gtk_box_pack_start(GTK_BOX(self->widget), g->label_non_raw, FALSE, FALSE, 0);
}
示例13: gui_init
void gui_init(struct dt_iop_module_t *self)
{
self->gui_data = malloc(sizeof(dt_iop_channelmixer_gui_data_t));
dt_iop_channelmixer_gui_data_t *g = (dt_iop_channelmixer_gui_data_t *)self->gui_data;
dt_iop_channelmixer_params_t *p = (dt_iop_channelmixer_params_t *)self->params;
self->widget = gtk_vbox_new(FALSE, DT_BAUHAUS_SPACE);
/* output */
g->combo1 = dt_bauhaus_combobox_new(self);
dt_bauhaus_widget_set_label(g->combo1, NULL, _("destination"));
dt_bauhaus_combobox_add(g->combo1,_("hue"));
dt_bauhaus_combobox_add(g->combo1,_("saturation"));
dt_bauhaus_combobox_add(g->combo1,_("lightness"));
dt_bauhaus_combobox_add(g->combo1,_("red"));
dt_bauhaus_combobox_add(g->combo1,_("green"));
dt_bauhaus_combobox_add(g->combo1,_("blue"));
dt_bauhaus_combobox_add(g->combo1,C_("channelmixer", "gray"));
dt_bauhaus_combobox_set(g->combo1, CHANNEL_RED );
g_signal_connect (G_OBJECT (g->combo1), "value-changed",
G_CALLBACK (output_callback), self);
/* red */
g->scale1 = dt_bauhaus_slider_new_with_range(self, -2.0, 2.0, 0.005, p->red[CHANNEL_RED] , 3);
g_object_set (GTK_OBJECT(g->scale1), "tooltip-text", _("amount of red channel in the output channel"), (char *)NULL);
dt_bauhaus_widget_set_label(g->scale1, NULL, _("red"));
g_signal_connect (G_OBJECT (g->scale1), "value-changed",
G_CALLBACK (red_callback), self);
/* green */
g->scale2 = dt_bauhaus_slider_new_with_range(self, -2.0, 2.0, 0.005, p->green[CHANNEL_RED] , 3);
g_object_set (GTK_OBJECT(g->scale2), "tooltip-text", _("amount of green channel in the output channel"), (char *)NULL);
dt_bauhaus_widget_set_label(g->scale2, NULL, _("green"));
g_signal_connect (G_OBJECT (g->scale2), "value-changed",
G_CALLBACK (green_callback), self);
/* blue */
g->scale3 = dt_bauhaus_slider_new_with_range(self, -2.0, 2.0, 0.005, p->blue[CHANNEL_RED] , 3);
g_object_set(g->scale3, "tooltip-text", _("amount of blue channel in the output channel"), (char *)NULL);
dt_bauhaus_widget_set_label(g->scale3, NULL, _("blue"));
g_signal_connect (G_OBJECT (g->scale3), "value-changed",
G_CALLBACK (blue_callback), self);
gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET(g->combo1), TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET(g->scale1), TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET(g->scale2), TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET(g->scale3), TRUE, TRUE, 0);
}
示例14: gui_init
void gui_init(struct dt_iop_module_t *self)
{
self->gui_data = malloc(sizeof(dt_iop_global_tonemap_gui_data_t));
dt_iop_global_tonemap_gui_data_t *g = (dt_iop_global_tonemap_gui_data_t *)self->gui_data;
dt_iop_global_tonemap_params_t *p = (dt_iop_global_tonemap_params_t *)self->params;
dt_pthread_mutex_init(&g->lock, NULL);
g->lwmax = NAN;
g->hash = 0;
self->widget = gtk_box_new(GTK_ORIENTATION_VERTICAL, DT_BAUHAUS_SPACE);
dt_gui_add_help_link(self->widget, dt_get_help_url(self->op));
/* operator */
g->operator= dt_bauhaus_combobox_new(self);
dt_bauhaus_widget_set_label(g->operator, NULL, _("operator"));
dt_bauhaus_combobox_add(g->operator, "reinhard");
dt_bauhaus_combobox_add(g->operator, "filmic");
dt_bauhaus_combobox_add(g->operator, "drago");
gtk_widget_set_tooltip_text(g->operator, _("the global tonemap operator"));
g_signal_connect(G_OBJECT(g->operator), "value-changed", G_CALLBACK(operator_callback), self);
gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET(g->operator), TRUE, TRUE, 0);
/* drago bias */
g->drago.bias = dt_bauhaus_slider_new_with_range(self, 0.5, 1.0, 0.05, p->drago.bias, 2);
dt_bauhaus_widget_set_label(g->drago.bias, NULL, _("bias"));
gtk_widget_set_tooltip_text(g->drago.bias, _("the bias for tonemapper controls the linearity, "
"the higher the more details in blacks"));
g_signal_connect(G_OBJECT(g->drago.bias), "value-changed", G_CALLBACK(_drago_bias_callback), self);
gtk_box_pack_start(GTK_BOX(self->widget), g->drago.bias, TRUE, TRUE, 0);
/* drago bias */
g->drago.max_light = dt_bauhaus_slider_new_with_range(self, 1, 500, 10, p->drago.max_light, 2);
dt_bauhaus_widget_set_label(g->drago.max_light, NULL, _("target"));
gtk_widget_set_tooltip_text(g->drago.max_light, _("the target light for tonemapper specified as cd/m2"));
g_signal_connect(G_OBJECT(g->drago.max_light), "value-changed", G_CALLBACK(_drago_max_light_callback), self);
gtk_box_pack_start(GTK_BOX(self->widget), g->drago.max_light, TRUE, TRUE, 0);
/* detail */
g->detail = dt_bauhaus_slider_new_with_range(self, -1.0, 1.0, 0.01, 0.0, 3);
gtk_box_pack_start(GTK_BOX(self->widget), g->detail, TRUE, TRUE, 0);
dt_bauhaus_widget_set_label(g->detail, NULL, _("detail"));
g_signal_connect(G_OBJECT(g->detail), "value-changed", G_CALLBACK(detail_callback), self);
}
示例15: gui_init
void gui_init(struct dt_iop_module_t *self)
{
self->gui_data = malloc(sizeof(dt_iop_highlights_gui_data_t));
dt_iop_highlights_gui_data_t *g = (dt_iop_highlights_gui_data_t *)self->gui_data;
dt_iop_highlights_params_t *p = (dt_iop_highlights_params_t *)self->params;
self->widget = gtk_vbox_new(FALSE, DT_BAUHAUS_SPACE);
g->clip = dt_bauhaus_slider_new_with_range(self, 0.0, 2.0, 0.01, p->clip, 3);
g_object_set(G_OBJECT(g->clip), "tooltip-text", _("manually adjust the clipping threshold against magenta highlights"), (char *)NULL);
dt_bauhaus_widget_set_label(g->clip, _("clipping threshold"));
gtk_box_pack_start(GTK_BOX(self->widget), g->clip, TRUE, TRUE, 0);
g->mode = dt_bauhaus_combobox_new(self);
gtk_box_pack_start(GTK_BOX(self->widget), g->mode, TRUE, TRUE, 0);
dt_bauhaus_widget_set_label(g->mode, _("method"));
dt_bauhaus_combobox_add(g->mode, _("clip highlights"));
dt_bauhaus_combobox_add(g->mode, _("reconstruct in LCh"));
g_object_set(G_OBJECT(g->mode), "tooltip-text", _("highlight reconstruction method"), (char *)NULL);
g->slider_box = GTK_BOX(gtk_vbox_new(TRUE, DT_BAUHAUS_SPACE));
gtk_widget_set_no_show_all(GTK_WIDGET(g->slider_box), TRUE);
gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET(g->slider_box), FALSE, FALSE, 0);
g->blendL = dt_bauhaus_slider_new_with_range(self,0.0, 1.0, 0.01, p->blendL, 3);
g->blendC = dt_bauhaus_slider_new_with_range(self,0.0, 1.0, 0.01, p->blendC, 3);
g->blendh = dt_bauhaus_slider_new_with_range(self,0.0, 1.0, 0.01, p->blendh, 3);
g_object_set(G_OBJECT(g->blendL), "tooltip-text", _("blend lightness (0 is same as clipping)"), (char *)NULL);
g_object_set(G_OBJECT(g->blendC), "tooltip-text", _("blend colorness (0 is same as clipping)"), (char *)NULL);
g_object_set(G_OBJECT(g->blendh), "tooltip-text", _("blend hue (0 is same as clipping)"), (char *)NULL);
dt_bauhaus_widget_set_label(g->blendL,_("blend L"));
dt_bauhaus_widget_set_label(g->blendC,_("blend C"));
dt_bauhaus_widget_set_label(g->blendh,_("blend h"));
gtk_box_pack_start(g->slider_box, g->blendL, TRUE, TRUE, 0);
gtk_box_pack_start(g->slider_box, g->blendC, TRUE, TRUE, 0);
gtk_box_pack_start(g->slider_box, g->blendh, TRUE, TRUE, 0);
g_signal_connect (G_OBJECT (g->clip), "value-changed",
G_CALLBACK (clip_callback), self);
g_signal_connect (G_OBJECT (g->blendL), "value-changed",
G_CALLBACK (blend_callback), self);
g_signal_connect (G_OBJECT (g->blendC), "value-changed",
G_CALLBACK (blend_callback), self);
g_signal_connect (G_OBJECT (g->blendh), "value-changed",
G_CALLBACK (blend_callback), self);
g_signal_connect (G_OBJECT (g->mode), "value-changed",
G_CALLBACK (mode_changed), self);
}