int scrolled(dt_iop_module_t *self, double x, double y, int up, uint32_t state) { dt_iop_graduatednd_gui_data_t *g = (dt_iop_graduatednd_gui_data_t *)self->gui_data; dt_iop_graduatednd_params_t *p = (dt_iop_graduatednd_params_t *)self->params; if((state & GDK_CONTROL_MASK) == GDK_CONTROL_MASK) { float dens; if(up) dens = fminf(8.0, p->density + 0.1); else dens = fmaxf(-8.0, p->density - 0.1); if(dens != p->density) { dt_bauhaus_slider_set(g->scale1, dens); } return 1; } if((state & GDK_SHIFT_MASK) == GDK_SHIFT_MASK) { float comp; if(up) comp = fminf(100.0, p->compression + 1.0); else comp = fmaxf(0.0, p->compression - 1.0); if(comp != p->compression) { dt_bauhaus_slider_set(g->scale2, comp); } return 1; } return 0; }
void gui_update(struct dt_iop_module_t *self) { dt_iop_module_t *module = (dt_iop_module_t *)self; 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 *)module->params; dt_bauhaus_slider_set(g->opacity, p->opacity); dt_bauhaus_slider_set_soft(g->scale, p->scale); dt_bauhaus_slider_set(g->rotate, p->rotate); dt_bauhaus_slider_set(g->x_offset, p->xoffset); dt_bauhaus_slider_set(g->y_offset, p->yoffset); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(g->align[p->alignment]), TRUE); _combo_box_set_active_text(g->watermarks, p->filename); dt_bauhaus_combobox_set(g->sizeto, p->sizeto); gtk_entry_set_text(GTK_ENTRY(g->text), p->text); GdkRGBA color = (GdkRGBA){.red = p->color[0], .green = p->color[1], .blue = p->color[2], .alpha = 1.0 }; gtk_color_chooser_set_rgba(GTK_COLOR_CHOOSER(g->colorpick), &color); gtk_font_button_set_font_name(GTK_FONT_BUTTON(g->fontsel), p->font); } void init(dt_iop_module_t *module) { module->params = calloc(1, sizeof(dt_iop_watermark_params_t)); module->params_size = sizeof(dt_iop_watermark_params_t); module->default_params = calloc(1, sizeof(dt_iop_watermark_params_t)); module->default_enabled = 0; module->priority = 969; // module order created by iop_dependencies.py, do not edit! module->params_size = sizeof(dt_iop_watermark_params_t); module->gui_data = NULL; dt_iop_watermark_params_t tmp = (dt_iop_watermark_params_t){ 100.0, 100.0, 0.0, 0.0, 4, 0.0, DT_SCALE_IMAGE, { "darktable.svg" }, { "" }, {0.0, 0.0, 0.0}, {"DejaVu Sans 10"} }; // opacity,scale,xoffs,yoffs,alignment memcpy(module->params, &tmp, sizeof(dt_iop_watermark_params_t)); memcpy(module->default_params, &tmp, sizeof(dt_iop_watermark_params_t)); }
void gui_update(struct dt_iop_module_t *self) { dt_iop_module_t *module = (dt_iop_module_t *)self; 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 *)module->params; dtgtk_gradient_slider_set_value(g->gslider1,p->shadow_hue); dtgtk_gradient_slider_set_value(g->gslider3,p->highlight_hue); dtgtk_gradient_slider_set_value(g->gslider4,p->highlight_saturation); dtgtk_gradient_slider_set_value(g->gslider2,p->shadow_saturation); dt_bauhaus_slider_set(g->scale1, p->balance*100.0); dt_bauhaus_slider_set(g->scale2, p->compress); float color[3]; hsl2rgb(color,p->shadow_hue,p->shadow_saturation,0.5); GdkColor c; c.red=color[0]*65535.0; c.green=color[1]*65535.0; c.blue=color[2]*65535.0; gtk_widget_modify_fg(GTK_WIDGET(g->colorpick1),GTK_STATE_NORMAL,&c); hsl2rgb(color,p->highlight_hue,p->highlight_saturation,0.5); c.red=color[0]*65535.0; c.green=color[1]*65535.0; c.blue=color[2]*65535.0; gtk_widget_modify_fg(GTK_WIDGET(g->colorpick2),GTK_STATE_NORMAL,&c); }
static void temp_changed(dt_iop_module_t *self) { 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->params; dt_iop_temperature_params_t *fp = (dt_iop_temperature_params_t *)self->default_params; const float temp_out = dt_bauhaus_slider_get(g->scale_k_out); const float temp_in = dt_bauhaus_slider_get(g->scale_k); const float tint = dt_bauhaus_slider_get(g->scale_tint); float original_temperature_rgb[3], intended_temperature_rgb[3]; convert_k_to_rgb (temp_in, original_temperature_rgb); convert_k_to_rgb (temp_out, intended_temperature_rgb); p->temp_out = temp_out; p->coeffs[0] = fp->coeffs[0] * intended_temperature_rgb[0] / original_temperature_rgb[0]; p->coeffs[1] = fp->coeffs[1] * tint * intended_temperature_rgb[1] / original_temperature_rgb[1]; p->coeffs[2] = fp->coeffs[2] * intended_temperature_rgb[2] / original_temperature_rgb[2]; // normalize: p->coeffs[0] /= p->coeffs[1]; p->coeffs[2] /= p->coeffs[1]; p->coeffs[1] = 1.0f; darktable.gui->reset = 1; dt_bauhaus_slider_set(g->scale_r, p->coeffs[0]); dt_bauhaus_slider_set(g->scale_g, p->coeffs[1]); dt_bauhaus_slider_set(g->scale_b, p->coeffs[2]); darktable.gui->reset = 0; dt_dev_add_history_item(darktable.develop, self, TRUE); }
static void temp_changed(dt_iop_module_t *self) { 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->params; const float temp = dt_bauhaus_slider_get(g->scale_k); const float tint = dt_bauhaus_slider_get(g->scale_tint); convert_k_to_rgb(temp, p->coeffs); // apply green tint p->coeffs[1] /= tint; // relative to daylight wb: for(int k=0; k<3; k++) p->coeffs[k] = g->daylight_wb[k]/p->coeffs[k]; // normalize: p->coeffs[0] /= p->coeffs[1]; p->coeffs[2] /= p->coeffs[1]; p->coeffs[1] = 1.0f; darktable.gui->reset = 1; dt_bauhaus_slider_set(g->scale_r, p->coeffs[0]); dt_bauhaus_slider_set(g->scale_g, p->coeffs[1]); dt_bauhaus_slider_set(g->scale_b, p->coeffs[2]); darktable.gui->reset = 0; dt_dev_add_history_item(darktable.develop, self, TRUE); }
void gui_update(struct dt_iop_module_t *self) { dt_iop_module_t *module = (dt_iop_module_t *)self; dt_iop_colorchecker_gui_data_t *g = (dt_iop_colorchecker_gui_data_t *)self->gui_data; dt_iop_colorchecker_params_t *p = (dt_iop_colorchecker_params_t *)module->params; if(g->patch >= p->num_patches || g->patch < 0) return; if(dt_bauhaus_combobox_length(g->combobox_patch) != p->num_patches) { dt_bauhaus_combobox_clear(g->combobox_patch); char cboxentry[1024]; for(int k=0;k<p->num_patches;k++) { snprintf(cboxentry, sizeof(cboxentry), _("patch #%d"), k); dt_bauhaus_combobox_add(g->combobox_patch, cboxentry); } if(p->num_patches <= 24) dtgtk_drawing_area_set_aspect_ratio(g->area, 2.0/3.0); else dtgtk_drawing_area_set_aspect_ratio(g->area, 1.0); } dt_bauhaus_slider_set(g->scale_L, p->target_L[g->patch] - p->source_L[g->patch]); dt_bauhaus_slider_set(g->scale_a, p->target_a[g->patch] - p->source_a[g->patch]); dt_bauhaus_slider_set(g->scale_b, p->target_b[g->patch] - p->source_b[g->patch]); const float Cin = sqrtf( p->source_a[g->patch]*p->source_a[g->patch] + p->source_b[g->patch]*p->source_b[g->patch]); const float Cout = sqrtf( p->target_a[g->patch]*p->target_a[g->patch]+ p->target_b[g->patch]*p->target_b[g->patch]); dt_bauhaus_slider_set(g->scale_C, Cout-Cin); if(g->patch != g->drawn_patch) gtk_widget_queue_draw(g->area); }
void gui_update(struct dt_iop_module_t *self) { dt_iop_module_t *module = (dt_iop_module_t *)self; 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 *)module->params; dt_bauhaus_combobox_set(g->operator, p->operator); gtk_widget_set_visible(g->drago.bias, FALSE); gtk_widget_set_visible(g->drago.max_light, FALSE); /* show ui for selected operator */ if(p->operator== OPERATOR_DRAGO) { gtk_widget_set_visible(g->drago.bias, TRUE); gtk_widget_set_visible(g->drago.max_light, TRUE); } /* drago */ dt_bauhaus_slider_set(g->drago.bias, p->drago.bias); dt_bauhaus_slider_set(g->drago.max_light, p->drago.max_light); dt_bauhaus_slider_set(g->detail, p->detail); dt_pthread_mutex_lock(&g->lock); g->lwmax = NAN; g->hash = 0; dt_pthread_mutex_unlock(&g->lock); }
static void mode_callback(GtkWidget *w, dt_iop_module_t *self) { dt_iop_bilat_params_t *p = (dt_iop_bilat_params_t *)self->params; p->mode = dt_bauhaus_combobox_get(w); dt_iop_bilat_gui_data_t *g = (dt_iop_bilat_gui_data_t *)self->gui_data; if(p->mode == s_mode_local_laplacian) { gtk_widget_set_visible(g->highlights, TRUE); gtk_widget_set_visible(g->shadows, TRUE); gtk_widget_set_visible(g->midtone, TRUE); gtk_widget_set_visible(g->range, FALSE); gtk_widget_set_visible(g->spatial, FALSE); dt_bauhaus_slider_set(g->highlights, 100.0f); dt_bauhaus_slider_set(g->shadows, 100.0f); } else { gtk_widget_set_visible(g->highlights, FALSE); gtk_widget_set_visible(g->shadows, FALSE); gtk_widget_set_visible(g->midtone, FALSE); gtk_widget_set_visible(g->range, TRUE); gtk_widget_set_visible(g->spatial, TRUE); dt_bauhaus_slider_set(g->range, 20.0f); dt_bauhaus_slider_set(g->spatial, 50.0f); } dt_dev_add_history_item(darktable.develop, self, TRUE); }
void gui_update(dt_iop_module_t *self) { dt_iop_levels_gui_data_t *g = (dt_iop_levels_gui_data_t *)self->gui_data; dt_iop_levels_params_t *p = (dt_iop_levels_params_t *)self->params; dt_bauhaus_combobox_set(g->mode, g_list_index(g->modes, GUINT_TO_POINTER(p->mode))); dt_bauhaus_slider_set(g->percentile_black, p->percentiles[0]); dt_bauhaus_slider_set(g->percentile_grey, p->percentiles[1]); dt_bauhaus_slider_set(g->percentile_white, p->percentiles[2]); switch(p->mode) { case LEVELS_MODE_AUTOMATIC: gtk_stack_set_visible_child_name(GTK_STACK(g->mode_stack), "automatic"); break; case LEVELS_MODE_MANUAL: default: gtk_stack_set_visible_child_name(GTK_STACK(g->mode_stack), "manual"); break; } dt_pthread_mutex_lock(&g->lock); g->auto_levels[0] = NAN; g->auto_levels[1] = NAN; g->auto_levels[2] = NAN; dt_pthread_mutex_unlock(&g->lock); gtk_widget_queue_draw(self->widget); }
/** gui callbacks, these are needed. */ void gui_update (dt_iop_module_t *self) { // let gui slider match current parameters: dt_iop_nlmeans_gui_data_t *g = (dt_iop_nlmeans_gui_data_t *)self->gui_data; dt_iop_nlmeans_params_t *p = (dt_iop_nlmeans_params_t *)self->params; dt_bauhaus_slider_set(g->luma, p->luma * 100.f); dt_bauhaus_slider_set(g->chroma, p->chroma * 100.f); }
void gui_update(dt_iop_module_t *module) { dt_iop_defringe_gui_data_t *g = (dt_iop_defringe_gui_data_t *)module->gui_data; dt_iop_defringe_params_t *p = (dt_iop_defringe_params_t *)module->params; dt_bauhaus_combobox_set(g->mode_select, p->op_mode); dt_bauhaus_slider_set(g->radius_scale, p->radius); dt_bauhaus_slider_set(g->thresh_scale, p->thresh); }
void gui_update(struct dt_iop_module_t *self) { dt_iop_module_t *module = (dt_iop_module_t *)self; 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 *)module->params; dt_bauhaus_slider_set(g->lower, p->lower); dt_bauhaus_slider_set(g->upper, p->upper); }
/** gui callbacks, these are needed. */ void gui_update (dt_iop_module_t *self) { // let gui slider match current parameters: 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; dt_bauhaus_slider_set(g->a_scale, p->a_steepness); dt_bauhaus_slider_set(g->b_scale, p->b_steepness); }
void gui_update(struct dt_iop_module_t *self) { dt_iop_module_t *module = (dt_iop_module_t *)self; dt_iop_exposure_gui_data_t *g = (dt_iop_exposure_gui_data_t *)self->gui_data; dt_iop_exposure_params_t *p = (dt_iop_exposure_params_t *)module->params; dt_bauhaus_slider_set(g->black, p->black); dt_bauhaus_slider_set(g->exposure, p->exposure); }
void gui_update(struct dt_iop_module_t *self) { dt_iop_module_t *module = (dt_iop_module_t *)self; 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 *)module->params; dt_bauhaus_slider_set(g->scale1, p->radius); dt_bauhaus_slider_set(g->scale2, p->slope); }
void gui_update(dt_iop_module_t *self) { dt_iop_module_t *module = (dt_iop_module_t *)self; 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 *)module->params; dt_bauhaus_slider_set(g->linear, p->linear); dt_bauhaus_slider_set(g->gamma, p->gamma); }
void gui_update(struct dt_iop_module_t *self) { dt_iop_module_t *module = (dt_iop_module_t *)self; 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 *)module->params; dt_bauhaus_slider_set(g->scale1, p->size); dt_bauhaus_slider_set(g->scale2, p->threshold); dt_bauhaus_slider_set(g->scale3, p->strength); }
void gui_update(struct dt_iop_module_t *self) { dt_iop_module_t *module = (dt_iop_module_t *)self; 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 *)module->params; dt_bauhaus_slider_set(g->contrast, p->contrast); dt_bauhaus_slider_set(g->brightness, p->brightness); dt_bauhaus_slider_set(g->saturation, p->saturation); }
void gui_update(struct dt_iop_module_t *self) { dt_iop_module_t *module = (dt_iop_module_t *)self; 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 *)module->params; dt_bauhaus_slider_set(g->scale1, p->scale*53.3); dt_bauhaus_slider_set(g->scale2, p->strength); }
/** gui callbacks, these are needed. */ void gui_update(dt_iop_module_t *self) { // let gui slider match current parameters: dt_iop_bilat_gui_data_t *g = (dt_iop_bilat_gui_data_t *)self->gui_data; dt_iop_bilat_params_t *p = (dt_iop_bilat_params_t *)self->params; dt_bauhaus_slider_set(g->spatial, p->sigma_s); dt_bauhaus_slider_set(g->range, p->sigma_r); dt_bauhaus_slider_set(g->detail, p->detail); }
void gui_update (dt_iop_module_t *self) { 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; dt_bauhaus_slider_set(g->strength, p->strength); dt_bauhaus_slider_set(g->threshold, p->threshold); gtk_toggle_button_set_active(g->markfixed, p->markfixed); gtk_toggle_button_set_active(g->permissive, p->permissive); }
void gui_update(struct dt_iop_module_t *self) { dt_iop_exposure_gui_data_t *g = (dt_iop_exposure_gui_data_t *)self->gui_data; dt_iop_exposure_params_t *p = (dt_iop_exposure_params_t *)self->params; if(!dt_image_is_raw(&self->dev->image_storage)) { gtk_widget_hide(GTK_WIDGET(g->mode)); p->mode = EXPOSURE_MODE_MANUAL; dt_dev_add_history_item(darktable.develop, self, TRUE); } else { gtk_widget_show(GTK_WIDGET(g->mode)); } dt_bauhaus_combobox_set(g->mode, g_list_index(g->modes, GUINT_TO_POINTER(p->mode))); dt_bauhaus_slider_set(g->black, p->black); dt_bauhaus_slider_set_soft(g->exposure, p->exposure); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(g->autoexp), FALSE); dt_bauhaus_slider_set(g->autoexpp, 0.01); gtk_widget_set_sensitive(GTK_WIDGET(g->autoexpp), FALSE); dt_bauhaus_slider_set(g->deflicker_percentile, p->deflicker_percentile); dt_bauhaus_slider_set(g->deflicker_target_level, p->deflicker_target_level); dt_bauhaus_combobox_set(g->deflicker_histogram_source, g_list_index(g->deflicker_histogram_sources, GUINT_TO_POINTER(p->deflicker_histogram_source))); self->request_color_pick = DT_REQUEST_COLORPICK_OFF; free(g->deflicker_histogram); g->deflicker_histogram = NULL; g->reprocess_on_next_expose = FALSE; gtk_label_set_text(g->deflicker_used_EC, ""); g->deflicker_computed_exposure = NAN; switch(p->mode) { case EXPOSURE_MODE_DEFLICKER: autoexp_disable(self); gtk_widget_hide(GTK_WIDGET(g->vbox_manual)); gtk_widget_show(GTK_WIDGET(g->vbox_deflicker)); if(p->deflicker_histogram_source == DEFLICKER_HISTOGRAM_SOURCE_SOURCEFILE) deflicker_prepare_histogram(self, &g->deflicker_histogram, &g->deflicker_histogram_stats); break; case EXPOSURE_MODE_MANUAL: default: gtk_widget_hide(GTK_WIDGET(g->vbox_deflicker)); gtk_widget_show(GTK_WIDGET(g->vbox_manual)); break; } }
void gui_update(struct dt_iop_module_t *self) { dt_iop_module_t *module = (dt_iop_module_t *)self; 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 *)module->params; dt_bauhaus_slider_set(g->scale1, p->ev); dt_bauhaus_slider_set(g->scale2, p->width); dtgtk_gradient_slider_set_value(g->gslider1,p->center); }
void gui_update(struct dt_iop_module_t *self) { dt_iop_module_t *module = (dt_iop_module_t *)self; 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 *)module->params; // gtk_combo_box_set_active(g->combo1, p->output_channel); dt_bauhaus_slider_set(g->scale1, p->red[ dt_bauhaus_combobox_get( g->combo1 ) ] ); dt_bauhaus_slider_set(g->scale2, p->green[ dt_bauhaus_combobox_get( g->combo1 ) ] ); dt_bauhaus_slider_set(g->scale3, p->blue[ dt_bauhaus_combobox_get( g->combo1 ) ] ); }
void gui_update(struct dt_iop_module_t *self) { dt_iop_module_t *module = (dt_iop_module_t *)self; 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 *)module->params; dt_bauhaus_slider_set(g->scale1, p->scale * GRAIN_SCALE_FACTOR); dt_bauhaus_slider_set(g->scale2, p->strength); dt_bauhaus_slider_set(g->scale3, p->midtones_bias); }
void gui_update(struct dt_iop_module_t *self) { dt_iop_module_t *module = (dt_iop_module_t *)self; 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 *)module->params; dt_bauhaus_slider_set(g->scale1, fabsf(p->radius)); dt_bauhaus_combobox_set(g->bilat, p->radius < 0 ? 1 : 0); dt_bauhaus_slider_set(g->scale2, p->contrast); dt_bauhaus_slider_set(g->scale3, p->saturation); //gtk_combo_box_set_active(g->order, p->order); }
void gui_update(struct dt_iop_module_t *self) { dt_iop_module_t *module = (dt_iop_module_t *)self; 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 *)module->params; dt_bauhaus_slider_set(g->scale1, p->opacity); dt_bauhaus_slider_set(g->scale2, p->scale); dt_bauhaus_slider_set(g->scale3, p->xoffset); dt_bauhaus_slider_set(g->scale4, p->yoffset); gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(g->dtba[ p->alignment ]), TRUE); _combo_box_set_active_text( g->combobox1, p->filename ); }
void gui_update(struct dt_iop_module_t *self) { dt_iop_module_t *module = (dt_iop_module_t *)self; dt_iop_exposure_gui_data_t *g = (dt_iop_exposure_gui_data_t *)self->gui_data; dt_iop_exposure_params_t *p = (dt_iop_exposure_params_t *)module->params; dt_bauhaus_slider_set(g->black, p->black); dt_bauhaus_slider_set(g->exposure, p->exposure); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(g->autoexp), FALSE); dt_bauhaus_slider_set(g->autoexpp, 0.01); gtk_widget_set_sensitive(GTK_WIDGET(g->autoexpp), FALSE); module->request_color_pick = 0; }
static void output_callback(GtkComboBox *combo, gpointer user_data) { dt_iop_module_t *self = (dt_iop_module_t *)user_data; if(self->dt->gui->reset) return; dt_iop_channelmixer_params_t *p = (dt_iop_channelmixer_params_t *)self->params; dt_iop_channelmixer_gui_data_t *g = (dt_iop_channelmixer_gui_data_t *)self->gui_data; // p->output_channel= gtk_combo_box_get_active(combo); dt_bauhaus_slider_set( g->scale1, p->red[ dt_bauhaus_combobox_get( g->combo1 ) ] ); dt_bauhaus_slider_set( g->scale2, p->green[ dt_bauhaus_combobox_get( g->combo1 ) ] ); dt_bauhaus_slider_set( g->scale3, p->blue[ dt_bauhaus_combobox_get( g->combo1 ) ] ); //dt_dev_add_history_item(darktable.develop, self, TRUE); }
static void colorpick_callback (GtkDarktableButton *button, gpointer user_data) { dt_iop_module_t *self = (dt_iop_module_t *)user_data; dt_iop_splittoning_gui_data_t *g = (dt_iop_splittoning_gui_data_t *)self->gui_data; if(self->dt->gui->reset) return; dt_iop_splittoning_params_t *p = (dt_iop_splittoning_params_t *)self->params; GtkColorSelectionDialog *csd = GTK_COLOR_SELECTION_DIALOG(gtk_color_selection_dialog_new(_("select tone color"))); gtk_window_set_transient_for(GTK_WINDOW(csd), GTK_WINDOW(dt_ui_main_window(darktable.gui->ui))); GtkWidget *okButton, *cancelButton = 0; g_object_get(G_OBJECT(csd), "ok-button", &okButton, NULL); g_object_get(G_OBJECT(csd), "cancel-button", &cancelButton, NULL); g_signal_connect (G_OBJECT (okButton), "clicked", G_CALLBACK (colorpick_button_callback), csd); g_signal_connect (G_OBJECT (cancelButton), "clicked", G_CALLBACK (colorpick_button_callback), csd); GtkColorSelection *cs = GTK_COLOR_SELECTION(gtk_color_selection_dialog_get_color_selection(csd)); GdkColor c; float color[3],h,s,l; h=(button==g->colorpick1)?p->shadow_hue:p->highlight_hue; s=(button==g->colorpick1)?p->shadow_saturation:p->highlight_saturation; l=0.5; hsl2rgb(color,h,s,l); c.red= 65535 * color[0]; c.green= 65535 * color[1]; c.blue= 65535 * color[2]; gtk_color_selection_set_current_color(cs,&c); if(gtk_dialog_run(GTK_DIALOG(csd))==GTK_RESPONSE_ACCEPT) { gtk_color_selection_get_current_color(cs,&c); color[0]=c.red/65535.0; color[1]=c.green/65535.0; color[2]=c.blue/65535.0; rgb2hsl(color,&h,&s,&l); l=0.5; hsl2rgb(color,h,s,l); dt_bauhaus_slider_set( (button==g->colorpick1)? g->gslider1: g->gslider3 ,h ); dt_bauhaus_slider_set( (button==g->colorpick1)? g->gslider2: g->gslider4 ,s ); } gtk_widget_destroy(GTK_WIDGET(csd)); dt_dev_add_history_item(darktable.develop, self, TRUE); }