Exemplo n.º 1
0
static void
saturation_callback(GtkDarktableGradientSlider *slider, gpointer user_data)
{
  dt_iop_module_t *self = (dt_iop_module_t *)user_data;
  dt_iop_colorize_params_t *p = (dt_iop_colorize_params_t *)self->params;
  dt_iop_colorize_gui_data_t *g = (dt_iop_colorize_gui_data_t *)self->gui_data;

  float color[3];
  GtkWidget *preview;
 
  //  hue = dtgtk_gradient_slider_get_value(g->gslider1);
  p->saturation = dtgtk_gradient_slider_get_value(slider);
  preview = GTK_WIDGET(g->colorpick1);
  
  /* convert to rgb */
  hsl2rgb(color,p->hue,p->saturation,0.5);

  GdkColor c;
  c.red=color[0]*65535.0;
  c.green=color[1]*65535.0;
  c.blue=color[2]*65535.0;

  /* update preview color */
  gtk_widget_modify_fg(preview,GTK_STATE_NORMAL,&c);

  if (self->dt->gui->reset) return;
  if (dtgtk_gradient_slider_is_dragging(slider)==FALSE) 
    dt_dev_add_history_item(darktable.develop, self, TRUE);
}
Exemplo n.º 2
0
static void
hue_callback(GtkDarktableGradientSlider *slider, gpointer user_data)
{
  dt_iop_module_t *self = (dt_iop_module_t *)user_data;
  dt_iop_splittoning_params_t *p = (dt_iop_splittoning_params_t *)self->params;
  dt_iop_splittoning_gui_data_t *g = (dt_iop_splittoning_gui_data_t *)self->gui_data;

  double hue=0;
  double saturation=0;
  float color[3];
  GtkWidget *preview;
  GtkDarktableGradientSlider *sslider=NULL;
  if( slider == g->gslider1 )
  {
    // Shadows
    p->shadow_hue=hue=dtgtk_gradient_slider_get_value(slider);
    saturation=p->shadow_saturation;
    preview=GTK_WIDGET(g->colorpick1);
    sslider=g->gslider2;
  }
  else
  {
    p->highlight_hue=hue=dtgtk_gradient_slider_get_value(slider);
    saturation=p->highlight_saturation;
    preview=GTK_WIDGET(g->colorpick2);
    sslider=g->gslider4;
  }

  hsl2rgb(color,hue,saturation,0.5);

  GdkColor c;
  c.red=color[0]*65535.0;
  c.green=color[1]*65535.0;
  c.blue=color[2]*65535.0;

  dtgtk_gradient_slider_set_stop(sslider,1.0,c);  // Update saturation end color
  gtk_widget_modify_fg(preview,GTK_STATE_NORMAL,&c); // update color preview

  if(self->dt->gui->reset) return;
  gtk_widget_draw(GTK_WIDGET(sslider),NULL);

  dt_dev_add_history_item(darktable.develop, self, TRUE);
}
Exemplo n.º 3
0
static void center_callback(GtkDarktableGradientSlider *slider, gpointer user_data)
{
  dt_iop_module_t *self = (dt_iop_module_t *)user_data;
  dt_iop_relight_params_t *p = (dt_iop_relight_params_t *)self->params;

  {
    p->center = dtgtk_gradient_slider_get_value(slider);
    dt_dev_add_history_item(darktable.develop, self, TRUE);
  }
}