本文整理汇总了C++中dt_bauhaus_slider_set_format函数的典型用法代码示例。如果您正苦于以下问题:C++ dt_bauhaus_slider_set_format函数的具体用法?C++ dt_bauhaus_slider_set_format怎么用?C++ dt_bauhaus_slider_set_format使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dt_bauhaus_slider_set_format函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: 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);
}
开发者ID:sk1p,项目名称:darktable,代码行数:27,代码来源:grain.c
示例2: 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);
}
开发者ID:AlicVB,项目名称:darktable,代码行数:33,代码来源:grain.c
示例3: gui_init
void gui_init (struct dt_iop_module_t *self)
{
self->gui_data = malloc(sizeof(dt_iop_temperature_gui_data_t));
dt_iop_temperature_gui_data_t *g = (dt_iop_temperature_gui_data_t *)self->gui_data;
dt_iop_temperature_params_t *p = (dt_iop_temperature_params_t*)self->default_params;
self->request_color_pick = 0;
self->widget = gtk_vbox_new(TRUE, DT_BAUHAUS_SPACE);
g_signal_connect(G_OBJECT(self->widget), "expose-event", G_CALLBACK(expose), self);
for(int k=0; k<3; k++) g->daylight_wb[k] = 1.0f;
g->scale_tint = dt_bauhaus_slider_new_with_range(self,0.1, 8.0, .01,1.0,3);
g->scale_k = dt_bauhaus_slider_new_with_range(self,DT_IOP_LOWEST_TEMPERATURE, DT_IOP_HIGHEST_TEMPERATURE, 10.,5000.0,0);
g->scale_r = dt_bauhaus_slider_new_with_range(self,0.0, 8.0, .001,p->coeffs[0],3);
g->scale_g = dt_bauhaus_slider_new_with_range(self,0.0, 8.0, .001,p->coeffs[1],3);
g->scale_b = dt_bauhaus_slider_new_with_range(self,0.0, 8.0, .001,p->coeffs[2],3);
dt_bauhaus_slider_set_format(g->scale_k,"%.0fK");
dt_bauhaus_widget_set_label(g->scale_tint, NULL, _("tint"));
dt_bauhaus_widget_set_label(g->scale_k, NULL, _("temperature"));
dt_bauhaus_widget_set_label(g->scale_r, NULL, _("red"));
dt_bauhaus_widget_set_label(g->scale_g, NULL, _("green"));
dt_bauhaus_widget_set_label(g->scale_b, NULL, _("blue"));
gtk_box_pack_start(GTK_BOX(self->widget), g->scale_tint, TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(self->widget), g->scale_k, TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(self->widget), g->scale_r, TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(self->widget), g->scale_g, TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(self->widget), g->scale_b, TRUE, TRUE, 0);
g->presets = dt_bauhaus_combobox_new(self);
dt_bauhaus_widget_set_label(g->presets, NULL, _("preset"));
gtk_box_pack_start(GTK_BOX(self->widget), g->presets, TRUE, TRUE, 0);
g_object_set(G_OBJECT(g->presets), "tooltip-text", _("choose white balance preset from camera"), (char *)NULL);
g->finetune = dt_bauhaus_slider_new_with_range(self,-9.0, 9.0, 1.0, 0.0, 0);
dt_bauhaus_widget_set_label(g->finetune, NULL, _("finetune"));
dt_bauhaus_slider_set_format(g->finetune, _("%.0f mired"));
// initially doesn't have fine tuning stuff (camera wb)
gtk_widget_set_sensitive(g->finetune, FALSE);
gtk_box_pack_start(GTK_BOX(self->widget), g->finetune, TRUE, TRUE, 0);
g_object_set(G_OBJECT(g->finetune), "tooltip-text", _("fine tune white balance preset"), (char *)NULL);
self->gui_update(self);
g_signal_connect (G_OBJECT (g->scale_tint), "value-changed",
G_CALLBACK (tint_callback), self);
g_signal_connect (G_OBJECT (g->scale_k), "value-changed",
G_CALLBACK (temp_callback), self);
g_signal_connect (G_OBJECT (g->scale_r), "value-changed",
G_CALLBACK (rgb_callback), self);
g_signal_connect (G_OBJECT (g->scale_g), "value-changed",
G_CALLBACK (rgb_callback), self);
g_signal_connect (G_OBJECT (g->scale_b), "value-changed",
G_CALLBACK (rgb_callback), self);
g_signal_connect (G_OBJECT (g->presets), "value-changed",
G_CALLBACK (presets_changed), self);
g_signal_connect (G_OBJECT (g->finetune), "value-changed",
G_CALLBACK (finetune_changed), self);
}
开发者ID:rharrison10,项目名称:darktable,代码行数:60,代码来源:temperature.c
示例4: 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_and_feedback(self, 0.0, 100.0, 0.1, p->balance*100.0, 2, 0);
dt_bauhaus_slider_set_format(g->scale1, "%.2f");
dt_bauhaus_slider_set_stop(g->scale1, 0.0f, 0.5f, 0.5f, 0.5f);
dt_bauhaus_slider_set_stop(g->scale1, 1.0f, 0.5f, 0.5f, 0.5f);
dt_bauhaus_widget_set_label(g->scale1, NULL, _("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, NULL, _("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);
}
开发者ID:digitalmole,项目名称:darktable,代码行数:58,代码来源:splittoning.c
示例5: 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);
}
开发者ID:bleader,项目名称:darktable,代码行数:57,代码来源:relight.c
示例6: 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);
}
开发者ID:olyoberdorf,项目名称:darktable,代码行数:52,代码来源:hotpixels.c
示例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_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);
}
开发者ID:dirkbr,项目名称:darktable,代码行数:52,代码来源:relight.c
示例8: 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_nlmeans_gui_data_t));
dt_iop_nlmeans_gui_data_t *g = (dt_iop_nlmeans_gui_data_t *)self->gui_data;
self->widget = gtk_vbox_new(TRUE, DT_BAUHAUS_SPACE);
g->luma = dt_bauhaus_slider_new_with_range(self, 0.0f, 100.0f, 1., 10.f, 0);
g->chroma = dt_bauhaus_slider_new_with_range(self, 0.0f, 100.0f, 1., 30.f, 0);
gtk_box_pack_start(GTK_BOX(self->widget), g->luma, TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(self->widget), g->chroma, TRUE, TRUE, 0);
dt_bauhaus_widget_set_label(g->luma, _("luma"));
dt_bauhaus_slider_set_format(g->luma, "%.0f%%");
dt_bauhaus_widget_set_label(g->chroma, _("chroma"));
dt_bauhaus_slider_set_format(g->chroma, "%.0f%%");
g_object_set (GTK_OBJECT(g->luma), "tooltip-text", _("how much to smooth brightness"), (char *)NULL);
g_object_set (GTK_OBJECT(g->chroma), "tooltip-text", _("how much to smooth colors"), (char *)NULL);
g_signal_connect (G_OBJECT (g->luma), "value-changed", G_CALLBACK (luma_callback), self);
g_signal_connect (G_OBJECT (g->chroma), "value-changed", G_CALLBACK (chroma_callback), self);
}
开发者ID:joninvski,项目名称:darktable,代码行数:19,代码来源:nlmeans.c
示例9: gui_init
void gui_init(struct dt_iop_module_t *self)
{
self->gui_data = malloc(sizeof(dt_iop_overexposed_gui_data_t));
dt_iop_overexposed_gui_data_t *g = (dt_iop_overexposed_gui_data_t *)self->gui_data;
dt_iop_overexposed_params_t *p = (dt_iop_overexposed_params_t *)self->params;
// g->mask = NULL;
self->widget =gtk_vbox_new(FALSE, DT_BAUHAUS_SPACE);
/* lower */
g->lower = dt_bauhaus_slider_new_with_range(self,0.0, 100.0, 0.1, p->lower, 2);
dt_bauhaus_slider_set_format(g->lower,"%.0f%%");
dt_bauhaus_widget_set_label(g->lower,_("lower threshold"));
g_object_set(G_OBJECT(g->lower), "tooltip-text", _("threshold of what shall be considered underexposed"), (char *)NULL);
g_signal_connect (G_OBJECT (g->lower), "value-changed",
G_CALLBACK (lower_callback), self);
gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET(g->lower), TRUE, TRUE, 0);
/* upper */
g->upper = dt_bauhaus_slider_new_with_range(self, 0.0, 100.0, 0.1, p->upper, 2);
dt_bauhaus_slider_set_format(g->upper,"%.0f%%");
dt_bauhaus_widget_set_label(g->upper,_("upper threshold"));
g_object_set(G_OBJECT(g->upper), "tooltip-text", _("threshold of what shall be considered overexposed"), (char *)NULL);
g_signal_connect (G_OBJECT (g->upper), "value-changed",
G_CALLBACK (upper_callback), self);
gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET(g->upper), TRUE, TRUE, 0);
/* add quicktool button for enable/disable the plugin */
GtkWidget *button = dtgtk_button_new(dtgtk_cairo_paint_overexposed, CPF_STYLE_FLAT|CPF_DO_NOT_USE_BORDER);
g_object_set(G_OBJECT(button), "tooltip-text", _("toggle over/under exposed indication"),
(char *)NULL);
g_signal_connect (G_OBJECT (button), "clicked",
G_CALLBACK (_iop_overexposed_quickbutton),
self);
dt_view_manager_module_toolbox_add(darktable.view_manager, button);
}
开发者ID:joninvski,项目名称:darktable,代码行数:41,代码来源:overexposed.c
示例10: gui_init
void gui_init(struct dt_iop_module_t *self)
{
self->gui_data = malloc(sizeof(dt_iop_bloom_gui_data_t));
dt_iop_bloom_gui_data_t *g = (dt_iop_bloom_gui_data_t *)self->gui_data;
dt_iop_bloom_params_t *p = (dt_iop_bloom_params_t *)self->params;
self->widget = gtk_vbox_new(FALSE, DT_BAUHAUS_SPACE);
/* size */
g->scale1 = dt_bauhaus_slider_new_with_range(self, 0.0, 100.0, 1.0, p->size, 0);
dt_bauhaus_slider_set_format(g->scale1,"%.0f%%");
dt_bauhaus_widget_set_label(g->scale1,_("size"));
g_object_set(G_OBJECT(g->scale1), "tooltip-text", _("the size of bloom"), (char *)NULL);
/* threshold */
g->scale2 = dt_bauhaus_slider_new_with_range(self, 0.0, 100.0, 1.0, p->threshold, 0);
dt_bauhaus_slider_set_format(g->scale2,"%.0f%%");
dt_bauhaus_widget_set_label(g->scale2,_("threshold"));
g_object_set(G_OBJECT(g->scale2), "tooltip-text", _("the threshold of light"), (char *)NULL);
/* strength */
g->scale3 = dt_bauhaus_slider_new_with_range(self, 0.0, 100.0, 1.0, p->strength, 0);
dt_bauhaus_slider_set_format(g->scale3,"%.0f%%");
dt_bauhaus_widget_set_label(g->scale3,_("strength"));
g_object_set(G_OBJECT(g->scale3), "tooltip-text", _("the strength of bloom"), (char *)NULL);
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);
g_signal_connect (G_OBJECT (g->scale1), "value-changed",
G_CALLBACK (size_callback), self);
g_signal_connect (G_OBJECT (g->scale2), "value-changed",
G_CALLBACK (threshold_callback), self);
g_signal_connect (G_OBJECT (g->scale3), "value-changed",
G_CALLBACK (strength_callback), self);
}
开发者ID:jimmy1977,项目名称:darktable,代码行数:37,代码来源:bloom.c
示例11: 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);
/* 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);
}
开发者ID:pryds,项目名称:darktable,代码行数:24,代码来源:grain.c
示例12: gui_init
void gui_init(struct dt_iop_module_t *self)
{
self->gui_data = malloc(sizeof(dt_iop_vibrance_gui_data_t));
dt_iop_vibrance_gui_data_t *g = (dt_iop_vibrance_gui_data_t *)self->gui_data;
dt_iop_vibrance_params_t *p = (dt_iop_vibrance_params_t *)self->params;
self->widget = gtk_vbox_new(FALSE, DT_BAUHAUS_SPACE);;
/* vibrance */
g->amount_scale = dt_bauhaus_slider_new_with_range(self,0.0, 100.0, 1, p->amount, 0);
dt_bauhaus_slider_set_format(g->amount_scale,"%.0f%%");
dt_bauhaus_widget_set_label(g->amount_scale,_("vibrance"));
gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET(g->amount_scale), TRUE, TRUE, 0);
g_object_set(G_OBJECT(g->amount_scale), "tooltip-text", _("the amount of vibrance"), (char *)NULL);
g_signal_connect (G_OBJECT (g->amount_scale), "value-changed",
G_CALLBACK (amount_callback), self);
}
开发者ID:joninvski,项目名称:darktable,代码行数:17,代码来源:vibrance.c
示例13: gui_init
void gui_init(struct dt_iop_module_t *self)
{
self->gui_data = malloc(sizeof(dt_iop_lowlight_gui_data_t));
dt_iop_lowlight_gui_data_t *c = (dt_iop_lowlight_gui_data_t *)self->gui_data;
dt_iop_lowlight_params_t *p = (dt_iop_lowlight_params_t *)self->params;
c->transition_curve = dt_draw_curve_new(0.0, 1.0, CATMULL_ROM);
(void)dt_draw_curve_add_point(c->transition_curve, p->transition_x[DT_IOP_LOWLIGHT_BANDS - 2] - 1.0,
p->transition_y[DT_IOP_LOWLIGHT_BANDS - 2]);
for(int k = 0; k < DT_IOP_LOWLIGHT_BANDS; k++)
(void)dt_draw_curve_add_point(c->transition_curve, p->transition_x[k], p->transition_y[k]);
(void)dt_draw_curve_add_point(c->transition_curve, p->transition_x[1] + 1.0, p->transition_y[1]);
c->mouse_x = c->mouse_y = c->mouse_pick = -1.0;
c->dragging = 0;
c->x_move = -1;
c->mouse_radius = 1.0 / DT_IOP_LOWLIGHT_BANDS;
self->widget = gtk_box_new(GTK_ORIENTATION_VERTICAL, DT_BAUHAUS_SPACE);
c->area = GTK_DRAWING_AREA(dtgtk_drawing_area_new_with_aspect_ratio(0.75));
gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET(c->area), FALSE, FALSE, 0);
gtk_widget_add_events(GTK_WIDGET(c->area), GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK
| GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
| GDK_LEAVE_NOTIFY_MASK | GDK_SCROLL_MASK
| GDK_SMOOTH_SCROLL_MASK);
g_signal_connect(G_OBJECT(c->area), "draw", G_CALLBACK(lowlight_draw), self);
g_signal_connect(G_OBJECT(c->area), "button-press-event", G_CALLBACK(lowlight_button_press), self);
g_signal_connect(G_OBJECT(c->area), "button-release-event", G_CALLBACK(lowlight_button_release), self);
g_signal_connect(G_OBJECT(c->area), "motion-notify-event", G_CALLBACK(lowlight_motion_notify), self);
g_signal_connect(G_OBJECT(c->area), "leave-notify-event", G_CALLBACK(lowlight_leave_notify), self);
g_signal_connect(G_OBJECT(c->area), "scroll-event", G_CALLBACK(lowlight_scrolled), self);
c->scale_blueness = dt_bauhaus_slider_new_with_range(self, 0.0, 100.0, 1.0, p->blueness, 2);
dt_bauhaus_widget_set_label(c->scale_blueness, NULL, _("blue shift"));
dt_bauhaus_slider_set_format(c->scale_blueness, "%0.2f%%");
gtk_widget_set_tooltip_text(c->scale_blueness, _("blueness in shadows"));
gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET(c->scale_blueness), TRUE, TRUE, 5);
g_signal_connect(G_OBJECT(c->scale_blueness), "value-changed", G_CALLBACK(blueness_callback), self);
}
开发者ID:CoreyChen922,项目名称:darktable,代码行数:44,代码来源:lowlight.c
示例14: gui_init
void gui_init(struct dt_iop_module_t *self)
{
self->gui_data = malloc(sizeof(dt_iop_borders_gui_data_t));
dt_iop_borders_gui_data_t *g = (dt_iop_borders_gui_data_t *)self->gui_data;
dt_iop_borders_params_t *p = (dt_iop_borders_params_t *)self->params;
self->widget = gtk_box_new(GTK_ORIENTATION_VERTICAL, DT_BAUHAUS_SPACE);
g->size = dt_bauhaus_slider_new_with_range(self, 0.0, 50.0, 0.5, p->size * 100.0, 2);
dt_bauhaus_widget_set_label(g->size, NULL, _("border size"));
dt_bauhaus_slider_set_format(g->size, "%.2f%%");
g_signal_connect(G_OBJECT(g->size), "value-changed", G_CALLBACK(size_callback), self);
gtk_widget_set_tooltip_text(g->size, _("size of the border in percent of the full image"));
gtk_box_pack_start(GTK_BOX(self->widget), g->size, TRUE, TRUE, 0);
g->aspect = dt_bauhaus_combobox_new(self);
dt_bauhaus_combobox_set_editable(g->aspect, 1);
dt_bauhaus_widget_set_label(g->aspect, NULL, _("aspect"));
gtk_box_pack_start(GTK_BOX(self->widget), g->aspect, TRUE, TRUE, 0);
gui_init_aspect(self);
g_signal_connect(G_OBJECT(g->aspect), "value-changed", G_CALLBACK(aspect_changed), self);
gtk_widget_set_tooltip_text(g->aspect, _("select the aspect ratio or right click and type your own (w:h)"));
g->aspect_orient = dt_bauhaus_combobox_new(self);
dt_bauhaus_widget_set_label(g->aspect_orient, NULL, _("orientation"));
dt_bauhaus_combobox_add(g->aspect_orient, _("auto"));
dt_bauhaus_combobox_add(g->aspect_orient, _("portrait"));
dt_bauhaus_combobox_add(g->aspect_orient, _("landscape"));
gtk_widget_set_tooltip_text(g->aspect_orient, _("aspect ratio orientation of the image with border"));
g_signal_connect(G_OBJECT(g->aspect_orient), "value-changed", G_CALLBACK(aspect_orient_changed), self);
gtk_box_pack_start(GTK_BOX(self->widget), g->aspect_orient, TRUE, TRUE, 0);
g->pos_h = dt_bauhaus_combobox_new(self);
dt_bauhaus_combobox_set_editable(g->pos_h, 1);
dt_bauhaus_widget_set_label(g->pos_h, NULL, _("horizontal position"));
gtk_box_pack_start(GTK_BOX(self->widget), g->pos_h, TRUE, TRUE, 0);
g_signal_connect(G_OBJECT(g->pos_h), "value-changed", G_CALLBACK(position_h_changed), self);
gtk_widget_set_tooltip_text(g->pos_h, _("select the horizontal position ratio relative to top "
"or right click and type your own (y:h)"));
g->pos_v = dt_bauhaus_combobox_new(self);
dt_bauhaus_combobox_set_editable(g->pos_v, 1);
dt_bauhaus_widget_set_label(g->pos_v, NULL, _("vertical position"));
gtk_box_pack_start(GTK_BOX(self->widget), g->pos_v, TRUE, TRUE, 0);
g_signal_connect(G_OBJECT(g->pos_v), "value-changed", G_CALLBACK(position_v_changed), self);
gtk_widget_set_tooltip_text(g->pos_v, _("select the vertical position ratio relative to left "
"or right click and type your own (x:w)"));
gui_init_positions(self);
g->frame_size = dt_bauhaus_slider_new_with_range(self, 0.0, 100.0, 0.5, p->frame_size * 100.0, 2);
dt_bauhaus_widget_set_label(g->frame_size, NULL, _("frame line size"));
dt_bauhaus_slider_set_format(g->frame_size, "%.2f%%");
g_signal_connect(G_OBJECT(g->frame_size), "value-changed", G_CALLBACK(frame_size_callback), self);
gtk_widget_set_tooltip_text(g->frame_size, _("size of the frame line in percent of min border width"));
gtk_box_pack_start(GTK_BOX(self->widget), g->frame_size, TRUE, TRUE, 0);
g->frame_offset = dt_bauhaus_slider_new_with_range(self, 0.0, 100.0, 0.5, p->frame_offset * 100.0, 2);
dt_bauhaus_widget_set_label(g->frame_offset, NULL, _("frame line offset"));
dt_bauhaus_slider_set_format(g->frame_offset, "%.2f%%");
g_signal_connect(G_OBJECT(g->frame_offset), "value-changed", G_CALLBACK(frame_offset_callback), self);
gtk_widget_set_tooltip_text(g->frame_offset, _("offset of the frame line beginning on picture side"));
gtk_box_pack_start(GTK_BOX(self->widget), g->frame_offset, TRUE, TRUE, 0);
GdkRGBA color = (GdkRGBA){.red = p->color[0], .green = p->color[1], .blue = p->color[2], .alpha = 1.0 };
GtkWidget *box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
g->colorpick = gtk_color_button_new_with_rgba(&color);
gtk_color_chooser_set_use_alpha(GTK_COLOR_CHOOSER(g->colorpick), FALSE);
gtk_widget_set_size_request(GTK_WIDGET(g->colorpick), DT_PIXEL_APPLY_DPI(24), DT_PIXEL_APPLY_DPI(24));
gtk_color_button_set_title(GTK_COLOR_BUTTON(g->colorpick), _("select border color"));
GtkWidget *label = dtgtk_reset_label_new(_("border color"), self, &p->color, 3 * sizeof(float));
g_signal_connect(G_OBJECT(g->colorpick), "color-set", G_CALLBACK(colorpick_color_set), self);
g->border_picker = GTK_TOGGLE_BUTTON(dtgtk_togglebutton_new(dtgtk_cairo_paint_colorpicker, CPF_STYLE_FLAT));
gtk_widget_set_tooltip_text(GTK_WIDGET(g->border_picker), _("pick border color from image"));
gtk_widget_set_size_request(GTK_WIDGET(g->border_picker), DT_PIXEL_APPLY_DPI(24), DT_PIXEL_APPLY_DPI(24));
g_signal_connect(G_OBJECT(g->border_picker), "toggled", G_CALLBACK(request_pick_toggled_border), self);
gtk_box_pack_start(GTK_BOX(box), label, TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(box), GTK_WIDGET(g->colorpick), FALSE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(box), GTK_WIDGET(g->border_picker), FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(self->widget), box, TRUE, TRUE, 0);
box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
g->frame_colorpick = gtk_color_button_new_with_rgba(&color);
gtk_color_chooser_set_use_alpha(GTK_COLOR_CHOOSER(g->frame_colorpick), FALSE);
gtk_color_button_set_title(GTK_COLOR_BUTTON(g->frame_colorpick), _("select frame line color"));
gtk_widget_set_size_request(GTK_WIDGET(g->frame_colorpick), DT_PIXEL_APPLY_DPI(24), DT_PIXEL_APPLY_DPI(24));
label = dtgtk_reset_label_new(_("frame line color"), self, &p->color, 3 * sizeof(float));
g_signal_connect(G_OBJECT(g->frame_colorpick), "color-set", G_CALLBACK(frame_colorpick_color_set), self);
g->frame_picker = GTK_TOGGLE_BUTTON(dtgtk_togglebutton_new(dtgtk_cairo_paint_colorpicker, CPF_STYLE_FLAT));
gtk_widget_set_tooltip_text(GTK_WIDGET(g->frame_picker), _("pick frame line color from image"));
gtk_widget_set_size_request(GTK_WIDGET(g->frame_picker), DT_PIXEL_APPLY_DPI(24), DT_PIXEL_APPLY_DPI(24));
g_signal_connect(G_OBJECT(g->frame_picker), "toggled", G_CALLBACK(request_pick_toggled_frame), self);
gtk_box_pack_start(GTK_BOX(box), label, TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(box), GTK_WIDGET(g->frame_colorpick), FALSE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(box), GTK_WIDGET(g->frame_picker), FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(self->widget), box, TRUE, TRUE, 0);
//.........这里部分代码省略.........
开发者ID:CarVac,项目名称:darktable,代码行数:101,代码来源:borders.c
示例15: gui_init
void gui_init(struct dt_iop_module_t *self)
{
self->gui_data = malloc(sizeof(dt_iop_watermark_gui_data_t));
dt_iop_watermark_gui_data_t *g = (dt_iop_watermark_gui_data_t *)self->gui_data;
dt_iop_watermark_params_t *p = (dt_iop_watermark_params_t *)self->params;
self->widget = gtk_hbox_new(FALSE,0);
GtkWidget *vbox = gtk_vbox_new(FALSE,DT_GUI_IOP_MODULE_CONTROL_SPACING);
gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET(vbox), TRUE, TRUE, 5);
GtkWidget *label1 = dtgtk_reset_label_new(_("marker"), self, &p->filename, sizeof(char)*64);
GtkWidget *label4 = dtgtk_reset_label_new(_("alignment"), self, &p->alignment, sizeof(int));
// Add the marker combobox
GtkWidget *hbox= gtk_hbox_new(FALSE,0);
g->combobox1 = GTK_COMBO_BOX(gtk_combo_box_new_text());
g->dtbutton1 = DTGTK_BUTTON(dtgtk_button_new(dtgtk_cairo_paint_refresh, CPF_STYLE_FLAT|CPF_DO_NOT_USE_BORDER));
gtk_box_pack_start(GTK_BOX(hbox),GTK_WIDGET(label1),TRUE,TRUE,0);
gtk_box_pack_start(GTK_BOX(hbox),GTK_WIDGET(g->combobox1),TRUE,TRUE,0);
gtk_box_pack_start(GTK_BOX(hbox),GTK_WIDGET(g->dtbutton1),FALSE,FALSE,0);
gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(hbox), TRUE, TRUE, 0);
// Add opacity/scale sliders to table
g->scale1 = dt_bauhaus_slider_new_with_range(self, 0.0, 100.0, 1.0, p->opacity, 0.5);
dt_bauhaus_slider_set_format(g->scale1, "%.f%%");
dt_bauhaus_widget_set_label(g->scale1,_("opacity"));
g->scale2 = dt_bauhaus_slider_new_with_range(self, 1.0, 100.0, 1.0, p->scale, 0.5);
dt_bauhaus_slider_set_format(g->scale2, "%.f%%");
dt_bauhaus_widget_set_label(g->scale2,_("scale"));
gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(g->scale1), TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(g->scale2), TRUE, TRUE, 0);
// Create the 3x3 gtk table toggle button table...
GtkTable *bat = GTK_TABLE( gtk_table_new(3,3,TRUE));
for(int i=0; i<9; i++)
{
g->dtba[i] = DTGTK_TOGGLEBUTTON (dtgtk_togglebutton_new (dtgtk_cairo_paint_alignment,CPF_STYLE_FLAT|(CPF_SPECIAL_FLAG<<(i+1))));
gtk_widget_set_size_request (GTK_WIDGET (g->dtba[i]),16,16);
gtk_table_attach (GTK_TABLE (bat), GTK_WIDGET (g->dtba[i]), (i%3),(i%3)+1,(i/3),(i/3)+1,0,0,0,0);
g_signal_connect (G_OBJECT (g->dtba[i]), "toggled",G_CALLBACK (alignment_callback), self);
}
GtkWidget *hbox2 = gtk_hbox_new(FALSE,0);
gtk_box_pack_start(GTK_BOX(hbox2),GTK_WIDGET(label4),TRUE,TRUE,0);
gtk_box_pack_start(GTK_BOX(hbox2), GTK_WIDGET(bat), TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(hbox2), TRUE, TRUE, 0);
// x/y offset
g->scale3 = dt_bauhaus_slider_new_with_range(self, -0.1, 0.1,0.001, p->xoffset, 3);
dt_bauhaus_slider_set_format(g->scale3, "%.3f");
dt_bauhaus_widget_set_label(g->scale3,_("x offset"));
g->scale4 = dt_bauhaus_slider_new_with_range(self, -0.1, 0.1,0.001, p->yoffset, 3);
dt_bauhaus_slider_set_format(g->scale4, "%.3f");
dt_bauhaus_widget_set_label(g->scale4,_("y offset"));
gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(g->scale3), TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(g->scale4), TRUE, TRUE, 0);
// Let's add some tooltips and hook up some signals...
g_object_set(G_OBJECT(g->scale1), "tooltip-text", _("the opacity of the watermark"), (char *)NULL);
g_object_set(G_OBJECT(g->scale2), "tooltip-text", _("the scale of the watermark"), (char *)NULL);
g_signal_connect (G_OBJECT (g->scale1), "value-changed",
G_CALLBACK (opacity_callback), self);
g_signal_connect (G_OBJECT (g->scale2), "value-changed",
G_CALLBACK (scale_callback), self);
g_signal_connect (G_OBJECT (g->scale3), "value-changed",
G_CALLBACK (xoffset_callback), self);
g_signal_connect (G_OBJECT (g->scale4), "value-changed",
G_CALLBACK (yoffset_callback), self);
g_signal_connect (G_OBJECT (g->dtbutton1), "clicked",G_CALLBACK (refresh_callback), self);
refresh_watermarks( self );
g_signal_connect (G_OBJECT (g->combobox1), "changed",
G_CALLBACK (watermark_callback), self);
}
开发者ID:chubinou,项目名称:darktable,代码行数:81,代码来源:watermark.c
示例16: gui_init
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_bilat_gui_data_
|
请发表评论