• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ dt_dev_add_history_item函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中dt_dev_add_history_item函数的典型用法代码示例。如果您正苦于以下问题:C++ dt_dev_add_history_item函数的具体用法?C++ dt_dev_add_history_item怎么用?C++ dt_dev_add_history_item使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了dt_dev_add_history_item函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: button_released

int button_released(struct dt_iop_module_t *self, double x, double y, int which, 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(g->dragging > 0)
  {
    // dt_iop_graduatednd_params_t *p   = (dt_iop_graduatednd_params_t *)self->params;
    // float wd = self->dev->preview_pipe->backbuf_width;
    // float ht = self->dev->preview_pipe->backbuf_height;
    float pzx, pzy;
    dt_dev_get_pointer_zoom_pos(self->dev, x, y, &pzx, &pzy);
    pzx += 0.5f;
    pzy += 0.5f;

    float r = 0.0, o = 0.0;
    // float pts[4];
    // dt_dev_distort_backtransform(self->dev,pts,2);
    set_grad_from_points(self, g->xa, g->ya, g->xb, g->yb, &r, &o);

    // if this is a "line dragging, we reset extremities, to be sure they are not outside the image
    if(g->dragging == 3)
    {
      /*
       * whole line dragging should not change rotation, so we should reuse
       * old rotation to avoid rounding issues
       */
      r = p->rotation;
      set_points_from_grad(self, &g->xa, &g->ya, &g->xb, &g->yb, r, o);
    }
    self->dt->gui->reset = 1;
    dt_bauhaus_slider_set(g->scale3, r);
    // dt_bauhaus_slider_set(g->scale4,o);
    self->dt->gui->reset = 0;
    p->rotation = r;
    p->offset = o;
    g->dragging = 0;
    dt_dev_add_history_item(darktable.develop, self, TRUE);
  }

  g->dragging = 0;
  return 0;
}
开发者ID:dtorop,项目名称:darktable,代码行数:42,代码来源:graduatednd.c


示例2: mode_callback

static void
mode_callback(GtkWidget *combo, gpointer user_data)
{
  dt_iop_module_t *self = (dt_iop_module_t *)user_data;

  if(darktable.gui->reset) return;

  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;

  const dt_iop_exposure_mode_t new_mode = GPOINTER_TO_UINT(g_list_nth_data(g->modes, dt_bauhaus_combobox_get(combo)));

  free(g->deflicker_histogram);
  g->deflicker_histogram = NULL;

  switch(new_mode)
  {
    case EXPOSURE_MODE_DEFLICKER:
      autoexp_disable(self);
      if(!dt_image_is_raw(&self->dev->image_storage))
      {
        dt_bauhaus_combobox_set(g->mode, g_list_index(g->modes, GUINT_TO_POINTER(EXPOSURE_MODE_MANUAL)));
        gtk_widget_hide(GTK_WIDGET(g->mode));
        break;
      }
      p->mode = EXPOSURE_MODE_DEFLICKER;
      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:
      p->mode = EXPOSURE_MODE_MANUAL;
      gtk_widget_hide(GTK_WIDGET(g->vbox_deflicker));
      gtk_widget_show(GTK_WIDGET(g->vbox_manual));
      break;
  }

  dt_dev_add_history_item(darktable.develop, self, TRUE);
}
开发者ID:cyr123,项目名称:darktable,代码行数:42,代码来源:exposure.c


示例3: colorpick_callback

static void colorpick_callback(GtkColorButton *widget, dt_iop_module_t *self)
{
  if(self->dt->gui->reset) return;

  dt_iop_splittoning_gui_data_t *g = (dt_iop_splittoning_gui_data_t *)self->gui_data;

  float color[3], h, s, l;

  GdkRGBA c;
  gtk_color_chooser_get_rgba(GTK_COLOR_CHOOSER(widget), &c);
  color[0] = c.red;
  color[1] = c.green;
  color[2] = c.blue;
  rgb2hsl(color, &h, &s, &l);

  dt_bauhaus_slider_set((GTK_WIDGET(widget) == g->colorpick1) ? g->gslider1 : g->gslider3, h);
  dt_bauhaus_slider_set((GTK_WIDGET(widget) == g->colorpick1) ? g->gslider2 : g->gslider4, s);

  dt_dev_add_history_item(darktable.develop, self, TRUE);
}
开发者ID:boucman,项目名称:darktable,代码行数:20,代码来源:splittoning.c


示例4: dt_iop_zonesystem_bar_scrolled

static gboolean dt_iop_zonesystem_bar_scrolled(GtkWidget *widget, GdkEventScroll *event, dt_iop_module_t *self)
{
  dt_iop_zonesystem_params_t *p = (dt_iop_zonesystem_params_t *)self->params;
  int cs = CLAMP(p->size, 4, MAX_ZONE_SYSTEM_SIZE);

  if(event->direction == GDK_SCROLL_UP)
    p->size += 1;
  else if(event->direction == GDK_SCROLL_DOWN)
    p->size -= 1;

  /* sanity checks */
  p->size = CLAMP(p->size, 4, MAX_ZONE_SYSTEM_SIZE);

  p->zone[cs] = -1;
  dt_dev_add_history_item(darktable.develop, self, TRUE);

  gtk_widget_queue_draw(widget);

  return TRUE;
}
开发者ID:AdamMajer,项目名称:darktable,代码行数:20,代码来源:zonesystem.c


示例5: scrolled

static gboolean scrolled(GtkWidget *widget, GdkEventScroll *event, gpointer user_data)
{
  dt_iop_module_t *self = (dt_iop_module_t *)user_data;
  dt_iop_basecurve_params_t *p = (dt_iop_basecurve_params_t *)self->params;
  dt_iop_basecurve_gui_data_t *c = (dt_iop_basecurve_gui_data_t *)self->gui_data;

  int ch = 0;
  dt_iop_basecurve_node_t *basecurve = p->basecurve[ch];

  if(c->selected >= 0)
  {
    if(event->direction == GDK_SCROLL_UP)
      basecurve[c->selected].y = MAX(0.0f, basecurve[c->selected].y + 0.001f);
    if(event->direction == GDK_SCROLL_DOWN)
      basecurve[c->selected].y = MIN(1.0f, basecurve[c->selected].y - 0.001f);
    dt_dev_add_history_item(darktable.develop, self, TRUE);
    gtk_widget_queue_draw(widget);
  }
  return TRUE;
}
开发者ID:thatguystone,项目名称:darktable,代码行数:20,代码来源:basecurve.c


示例6: output_profile_changed

static void output_profile_changed(GtkWidget *widget, gpointer user_data)
{
  dt_iop_module_t *self = (dt_iop_module_t *)user_data;
  if(self->dt->gui->reset) return;
  dt_iop_colorout_params_t *p = (dt_iop_colorout_params_t *)self->params;
  int pos = dt_bauhaus_combobox_get(widget);

  for(GList *profiles = darktable.color_profiles->profiles; profiles; profiles = g_list_next(profiles))
  {
    dt_colorspaces_color_profile_t *pp = (dt_colorspaces_color_profile_t *)profiles->data;
    if(pp->out_pos == pos)
    {
      p->type = pp->type;
      g_strlcpy(p->filename, pp->filename, sizeof(p->filename));
      dt_dev_add_history_item(darktable.develop, self, TRUE);
      return;
    }
  }

  fprintf(stderr, "[colorout] color profile %s seems to have disappeared!\n", dt_colorspaces_get_name(p->type, p->filename));
}
开发者ID:dirkbr,项目名称:darktable,代码行数:21,代码来源:colorout.c


示例7: target_C_callback

static void target_C_callback(GtkWidget *slider, gpointer user_data)
{
  dt_iop_module_t *self = (dt_iop_module_t *)user_data;
  dt_iop_colorchecker_params_t *p = (dt_iop_colorchecker_params_t *)self->params;
  dt_iop_colorchecker_gui_data_t *g = (dt_iop_colorchecker_gui_data_t *)self->gui_data;
  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 = MAX(1e-4f, sqrtf(
      p->target_a[g->patch]*p->target_a[g->patch]+
      p->target_b[g->patch]*p->target_b[g->patch]));
  const float Cnew = CLAMP(Cin + dt_bauhaus_slider_get(slider), 0.01, 128.0);
  p->target_a[g->patch] = CLAMP(p->target_a[g->patch]*Cnew/Cout, -128.0, 128.0);
  p->target_b[g->patch] = CLAMP(p->target_b[g->patch]*Cnew/Cout, -128.0, 128.0);
  const int reset = darktable.gui->reset;
  darktable.gui->reset = 1; // avoid history item
  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]);
  darktable.gui->reset = reset;
  dt_dev_add_history_item(darktable.develop, self, TRUE);
}
开发者ID:PkmX,项目名称:darktable,代码行数:21,代码来源:colorchecker.c


示例8: frame_colorpick_callback

static void
frame_colorpick_callback (GtkDarktableButton *button, dt_iop_module_t *self)
{
  if(self->dt->gui->reset) return;
  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;

  // turn off the other color picker so that this tool actually works ...
  gtk_toggle_button_set_active(g->frame_picker, FALSE);
  gtk_toggle_button_set_active(g->border_picker, FALSE);

  GtkColorSelectionDialog  *csd = GTK_COLOR_SELECTION_DIALOG(gtk_color_selection_dialog_new(_("select frame line 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;
  c.red   = 65535 * p->frame_color[0];
  c.green = 65535 * p->frame_color[1];
  c.blue  = 65535 * p->frame_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);
    p->frame_color[0] = c.red  /65535.0;
    p->frame_color[1] = c.green/65535.0;
    p->frame_color[2] = c.blue /65535.0;
    gtk_widget_modify_fg(GTK_WIDGET(g->frame_colorpick), GTK_STATE_NORMAL, &c);
  }
  gtk_widget_destroy(GTK_WIDGET(csd));
  dt_dev_add_history_item(darktable.develop, self, TRUE);
}
开发者ID:bartokk,项目名称:darktable,代码行数:40,代码来源:borders.c


示例9: callback

static void callback(GtkWidget *widget, gpointer *user_data)
{
  dt_iop_module_t *self = (dt_iop_module_t *)user_data;
  if(self->dt->gui->reset) return;

  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;

  for(int i = 0; i < 4; i++)
    p->raw_black_level_separate[i] = dt_bauhaus_slider_get(g->black_level_separate[i]);
  p->raw_white_point = dt_bauhaus_slider_get(g->white_point);

  if(dt_conf_get_bool("plugins/darkroom/rawprepare/allow_editing_crop"))
  {
    for(int i = 0; i < 4; i++)
    {
      p->crop.array[i] = dt_bauhaus_slider_get(g->crop[i]);
    }
  }

  dt_dev_add_history_item(darktable.develop, self, TRUE);
}
开发者ID:dumbbell,项目名称:darktable,代码行数:22,代码来源:rawprepare.c


示例10: dt_iop_exposure_set_white

static void dt_iop_exposure_set_white(struct dt_iop_module_t *self, const float white)
{
  dt_iop_exposure_params_t *p = (dt_iop_exposure_params_t *)self->params;

  if(p->mode == EXPOSURE_MODE_DEFLICKER)
  {
    dt_iop_exposure_gui_data_t *g = (dt_iop_exposure_gui_data_t *)self->gui_data;

    p->deflicker_target_level = white;

    darktable.gui->reset = 1;
    dt_bauhaus_slider_set(g->deflicker_target_level, p->deflicker_target_level);
    darktable.gui->reset = 0;

    dt_dev_add_history_item(darktable.develop, self, TRUE);
  }
  else
  {
    exposure_set_white(self, white);
    autoexp_disable(self);
  }
}
开发者ID:Acidburn0zzz,项目名称:darktable,代码行数:22,代码来源:exposure.c


示例11: expose

static gboolean
expose (GtkWidget *widget, GdkEventExpose *event, dt_iop_module_t *self)
{
    // capture gui color picked event.
    if(darktable.gui->reset) return FALSE;
    if(self->picked_color_max[0] < self->picked_color_min[0]) return FALSE;
    if(!self->request_color_pick) return FALSE;
    static float old[3] = {0, 0, 0};
    const float *grayrgb = self->picked_color;
    if(grayrgb[0] == old[0] && grayrgb[1] == old[1] && grayrgb[2] == old[2]) return FALSE;
    for(int k=0; k<3; k++) old[k] = grayrgb[k];
    dt_iop_temperature_params_t *p = (dt_iop_temperature_params_t *)self->params;
    for(int k=0; k<3; k++) p->coeffs[k] = (grayrgb[k] > 0.001f) ? 1.0f/grayrgb[k] : 1.0f;
    // normalize green:
    p->coeffs[0] /= p->coeffs[1];
    p->coeffs[2] /= p->coeffs[1];
    p->coeffs[1] = 1.0;
    for(int k=0; k<3; k++) p->coeffs[k] = fmaxf(0.0f, fminf(8.0f, p->coeffs[k]));
    gui_update_from_coeffs(self);
    dt_dev_add_history_item(darktable.develop, self, TRUE);
    return FALSE;
}
开发者ID:rharrison10,项目名称:darktable,代码行数:22,代码来源:temperature.c


示例12: scrolled

static gboolean scrolled(GtkWidget *widget, GdkEventScroll *event, gpointer user_data)
{
  dt_iop_module_t *self = (dt_iop_module_t *)user_data;
  dt_iop_tonecurve_params_t *p = (dt_iop_tonecurve_params_t *)self->params;
  dt_iop_tonecurve_gui_data_t *c = (dt_iop_tonecurve_gui_data_t *)self->gui_data;

  int ch = c->channel;
  dt_iop_tonecurve_node_t *tonecurve = p->tonecurve[ch];
  int autoscale_ab = p->tonecurve_autoscale_ab;

  // if autoscale_ab is on: do not modify a and b curves
  if (autoscale_ab && ch != ch_L) return TRUE;

  if(c->selected >= 0)
  {
    if(event->direction == GDK_SCROLL_UP  ) tonecurve[c->selected].y = MAX(0.0f, tonecurve[c->selected].y + 0.001f);
    if(event->direction == GDK_SCROLL_DOWN) tonecurve[c->selected].y = MIN(1.0f, tonecurve[c->selected].y - 0.001f);
    dt_dev_add_history_item(darktable.develop, self, TRUE);
    gtk_widget_queue_draw(widget);
  }
  return TRUE;
}
开发者ID:rikles,项目名称:darktable,代码行数:22,代码来源:tonecurve.c


示例13: _blendop_mode_callback

static void
_blendop_mode_callback (GtkWidget *combo, dt_iop_gui_blend_data_t *data)
{
  data->module->blend_params->mode = data->modes[dt_bauhaus_combobox_get(data->blend_modes_combo)].mode;
  if(data->module->blend_params->mode != DEVELOP_BLEND_DISABLED)
  {
    gtk_widget_show(data->opacity_slider);
    if(data->blendif_support)
    {
      gtk_widget_show(data->blendif_enable);
      if(dt_bauhaus_combobox_get(data->blendif_enable))
        gtk_widget_show(GTK_WIDGET(data->blendif_box));
    }
  }
  else
  {
    gtk_widget_hide(data->opacity_slider);
    if(data->blendif_support)
    {
      /* switch off color picker if it was requested by blendif */
      if(data->module->request_color_pick < 0)
      {
        data->module->request_color_pick = 0;
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(data->colorpicker), 0);
      }

      data->module->request_mask_display = 0;
      gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(data->showmask), 0);
      data->module->suppress_mask = 0;
      gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(data->suppress), 0);


      gtk_widget_hide(GTK_WIDGET(data->blendif_enable));
      gtk_widget_hide(GTK_WIDGET(data->blendif_box));
    }
  }
  dt_dev_add_history_item(darktable.develop, data->module, TRUE);
}
开发者ID:minusdreidb,项目名称:darktable,代码行数:38,代码来源:blend_gui.c


示例14: hue_callback

static void
hue_callback(GtkWidget *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;
  GtkWidget* colorpicker;
  GtkWidget* sat_slider=NULL;
  if( slider == g->gslider1 )
  {
    // Shadows
    hue = p->shadow_hue = dt_bauhaus_slider_get(slider);
    saturation = p->shadow_saturation;
    colorpicker = GTK_WIDGET(g->colorpick1);
    sat_slider = g->gslider2;
    update_balance_slider_colors(g->scale1, -1, hue);
  }
  else
  {
    hue = p->highlight_hue = dt_bauhaus_slider_get(slider);
    saturation=p->highlight_saturation;
    colorpicker=GTK_WIDGET(g->colorpick2);
    sat_slider=g->gslider4;
    update_balance_slider_colors(g->scale1, hue, -1);
  }

  update_colorpicker_fg(colorpicker, hue, saturation);
  update_saturation_slider_end_color(sat_slider, hue);

  if(self->dt->gui->reset) return;

  gtk_widget_queue_draw(GTK_WIDGET(sat_slider));

  dt_dev_add_history_item(darktable.develop, self, TRUE);
}
开发者ID:digitalmole,项目名称:darktable,代码行数:38,代码来源:splittoning.c


示例15: autoexp_callback

static void autoexp_callback(GtkToggleButton *button, gpointer user_data)
{
  dt_iop_module_t *self = (dt_iop_module_t *)user_data;
  dt_iop_exposure_gui_data_t *g = (dt_iop_exposure_gui_data_t *)self->gui_data;
  if(self->dt->gui->reset) return;

  self->request_color_pick = gtk_toggle_button_get_active(button) ? DT_REQUEST_COLORPICK_MODULE
                                                                  : DT_REQUEST_COLORPICK_OFF;

  dt_iop_request_focus(self);

  if(self->request_color_pick == DT_REQUEST_COLORPICK_MODULE)
  {
    dt_lib_colorpicker_set_area(darktable.lib, 0.99);
    dt_dev_reprocess_all(self->dev);
  }
  else
    dt_control_queue_redraw();

  gtk_widget_set_sensitive(GTK_WIDGET(g->autoexpp), gtk_toggle_button_get_active(button));

  dt_dev_add_history_item(darktable.develop, self, TRUE);
}
开发者ID:Acidburn0zzz,项目名称:darktable,代码行数:23,代码来源:exposure.c


示例16: deflicker_disable

static void
deflicker_disable(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;

  gulong signal_id = g_signal_lookup("toggled", GTK_TYPE_CHECK_BUTTON);
  gulong handler_id = g_signal_handler_find(G_OBJECT(g->deflicker),
                                      G_SIGNAL_MATCH_ID,
                                      signal_id,
                                      0, NULL, NULL, NULL);

  g_signal_handler_block(G_OBJECT (g->deflicker), handler_id);
  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(g->deflicker), FALSE);
  g_signal_handler_unblock(G_OBJECT (g->deflicker), handler_id);

  gtk_widget_set_sensitive(GTK_WIDGET(g->deflicker_percentile), FALSE);
  gtk_widget_set_sensitive(GTK_WIDGET(g->deflicker_level), FALSE);

  p->deflicker = FALSE;

  dt_dev_add_history_item(darktable.develop, self, TRUE);
}
开发者ID:hean01,项目名称:darktable,代码行数:23,代码来源:exposure.c


示例17: key_softproof_callback

static gboolean key_softproof_callback(GtkAccelGroup *accel_group,
                                   GObject *acceleratable,
                                   guint keyval, GdkModifierType modifier,
                                   gpointer data)
{
  dt_iop_module_t* self = (dt_iop_module_t*)data;
  dt_iop_colorout_gui_data_t *g = (dt_iop_colorout_gui_data_t *)self->gui_data;
  dt_iop_colorout_params_t *p = (dt_iop_colorout_params_t *)self->params;

  /* toggle softproofing on/off */
  g->softproof_enabled = p->softproof_enabled = !p->softproof_enabled;
  if(p->softproof_enabled)
  {
    int pos = dt_bauhaus_combobox_get(g->cbox5);
    gchar *filename = _get_profile_from_pos(g->profiles, pos);
    if (filename)
      g_strlcpy(p->softproofprofile, filename, sizeof(p->softproofprofile));
  }

  dt_dev_add_history_item(darktable.develop, self, TRUE);
  dt_control_queue_redraw_center();
  return TRUE;
}
开发者ID:bgK,项目名称:darktable,代码行数:23,代码来源:colorout.c


示例18: saturation_callback

static void
saturation_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;
  if( slider == g->gslider2 )
  {
    // Shadows
    hue=dtgtk_gradient_slider_get_value(g->gslider1);
    p->shadow_saturation=saturation=dtgtk_gradient_slider_get_value(slider);
    preview=GTK_WIDGET(g->colorpick1);
  }
  else
  {
    hue=dtgtk_gradient_slider_get_value(g->gslider3);
    p->highlight_saturation=saturation=dtgtk_gradient_slider_get_value(slider);
    preview=GTK_WIDGET(g->colorpick2);
  }

  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;

  gtk_widget_modify_fg(preview,GTK_STATE_NORMAL,&c); // Update color preview

  if(self->dt->gui->reset) return;
  dt_dev_add_history_item(darktable.develop, self, TRUE);
}
开发者ID:gthb,项目名称:darktable,代码行数:37,代码来源:splittoning.c


示例19: dt_iop_levels_scroll

static gboolean dt_iop_levels_scroll(GtkWidget *widget, GdkEventScroll *event, gpointer user_data)
{
  dt_iop_module_t *self = (dt_iop_module_t *)user_data;
  dt_iop_levels_gui_data_t *c = (dt_iop_levels_gui_data_t *)self->gui_data;
  dt_iop_levels_params_t *p = (dt_iop_levels_params_t *)self->params;

  const float interval = 0.002; // Distance moved for each scroll event
  gboolean updated = FALSE;
  float new_position = 0;

  if (c->dragging)
  {
    return FALSE;
  }

  if(event->direction == GDK_SCROLL_UP)
  {
    new_position = p->levels[c->handle_move] + interval;
    updated = TRUE;
  }
  else if(event->direction == GDK_SCROLL_DOWN)
  {
    new_position = p->levels[c->handle_move] - interval;
    updated = TRUE;
  }

  if (updated)
  {
    dt_iop_levels_move_handle(self, c->handle_move, new_position,
                              p->levels, c->drag_start_percentage);
    dt_dev_add_history_item(darktable.develop, self, TRUE);
    return TRUE;
  }

  return FALSE;
}
开发者ID:gapato,项目名称:darktable,代码行数:36,代码来源:levels.c


示例20: hue_callback

static void
hue_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;
  GtkDarktableGradientSlider *sslider=NULL;


  p->hue = dtgtk_gradient_slider_get_value(slider);
  preview = GTK_WIDGET(g->colorpick1);
  sslider = g->gslider2;

  /* convert to rgb */
  hsl2rgb(color,p->hue,p->saturation,0.5);

  /* update preview color */
  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); 

  gtk_widget_modify_fg(preview,GTK_STATE_NORMAL,&c);

  if (self->dt->gui->reset) return;

  gtk_widget_draw(GTK_WIDGET(sslider),NULL);

  if (dtgtk_gradient_slider_is_dragging(slider)==FALSE) 
    dt_dev_add_history_item(darktable.develop, self, TRUE);
}
开发者ID:bgK,项目名称:darktable,代码行数:36,代码来源:colorize.c



注:本文中的dt_dev_add_history_item函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ dt_dprintf函数代码示例发布时间:2022-05-30
下一篇:
C++ dt_database_get函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap