当前位置: 首页>>代码示例>>C++>>正文


C++ dt_bauhaus_slider_set函数代码示例

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


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

示例1: scrolled

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;
}
开发者ID:dtorop,项目名称:darktable,代码行数:32,代码来源:graduatednd.c

示例2: gui_update

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));
}
开发者ID:edgomez,项目名称:darktable,代码行数:34,代码来源:watermark.c

示例3: gui_update

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);

}
开发者ID:gthb,项目名称:darktable,代码行数:31,代码来源:splittoning.c

示例4: temp_changed

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);
}
开发者ID:AntonSh,项目名称:darktable,代码行数:31,代码来源:temperature.c

示例5: temp_changed

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);
}
开发者ID:rharrison10,项目名称:darktable,代码行数:26,代码来源:temperature.c

示例6: gui_update

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);
}
开发者ID:PkmX,项目名称:darktable,代码行数:32,代码来源:colorchecker.c

示例7: gui_update

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);

}
开发者ID:a3novy,项目名称:darktable,代码行数:26,代码来源:globaltonemap.c

示例8: mode_callback

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);
}
开发者ID:CChiappa,项目名称:darktable,代码行数:27,代码来源:bilat.c

示例9: gui_update

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);
}
开发者ID:AdamMajer,项目名称:darktable,代码行数:29,代码来源:levels.c

示例10: gui_update

/** 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);
}
开发者ID:joninvski,项目名称:darktable,代码行数:9,代码来源:nlmeans.c

示例11: gui_update

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);
}
开发者ID:Acidburn0zzz,项目名称:darktable,代码行数:8,代码来源:defringe.c

示例12: gui_update

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);
}
开发者ID:joninvski,项目名称:darktable,代码行数:8,代码来源:overexposed.c

示例13: gui_update

/** 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);
}
开发者ID:gthb,项目名称:darktable,代码行数:9,代码来源:colorcontrast.c

示例14: gui_update

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);
}
开发者ID:sk1p,项目名称:darktable,代码行数:8,代码来源:exposure.c

示例15: gui_update

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);
}
开发者ID:CarVac,项目名称:darktable,代码行数:8,代码来源:clahe.c


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