int set_params(dt_lib_module_t *self, const void *params, int size)
{
    /* update conf settings from params */
    dt_lib_collect_params_t *p = (dt_lib_collect_params_t *)params;
    char confname[200];

    for (int i=0; i<p->rules; i++) {
        /* set item */
        snprintf(confname, 200, "plugins/lighttable/collect/item%1d", i);
        dt_conf_set_int(confname, p->rule[i].item);

        /* set mode */
        snprintf(confname, 200, "plugins/lighttable/collect/mode%1d", i);
        dt_conf_set_int(confname, p->rule[i].mode);

        /* set string */
        snprintf(confname, 200, "plugins/lighttable/collect/string%1d", i);
        dt_conf_set_string(confname, p->rule[i].string);
    }

    /* set number of rules */
    snprintf(confname, 200, "plugins/lighttable/collect/num_rules");
    dt_conf_set_int(confname, p->rules);

    /* update ui */
    _lib_collect_gui_update(self);

    /* update view */
    dt_collection_update_query(darktable.collection);

    return 0;
}
Beispiel #2
0
static void _lib_keywords_add_collection_rule(GtkTreeView *view, GtkTreePath *tp,
    GtkTreeViewColumn *tvc, gpointer user_data)
{
  char kw[1024]= {0};
  _lib_keywords_string_from_path(kw, 1024, gtk_tree_view_get_model(view), tp);

  /*
   * add a collection rule
   * TODO: move this into a dt_collection_xxx API to be used
   *       from other places
   */

  int rule = dt_conf_get_int("plugins/lighttable/collect/num_rules");
  char confname[200] = {0};

  /* set mode to AND */
  snprintf(confname, 200, "plugins/lighttable/collect/mode%1d", rule);
  dt_conf_set_int(confname, 0);

  /* set tag string */
  snprintf(confname, 200, "plugins/lighttable/collect/string%1d", rule);
  dt_conf_set_string(confname, kw);

  /* set tag rule type */
  snprintf(confname, 200, "plugins/lighttable/collect/item%1d", rule);
  dt_conf_set_int(confname, 3);

  dt_conf_set_int("plugins/lighttable/collect/num_rules", rule+1);

  dt_view_collection_update(darktable.view_manager);
  dt_collection_update_query(darktable.collection);
}
Beispiel #3
0
void
dt_collection_deserialize(char *buf)
{
  int num_rules = 0;
  char str[400], confname[200];
  sprintf(str, "%%");
  int mode = 0, item = 0;
  sscanf(buf, "%d", &num_rules);
  if(num_rules == 0) num_rules = 1;
  dt_conf_set_int("plugins/lighttable/collect/num_rules", num_rules);
  while(buf[0] != ':') buf++;
  buf++;
  for(int k=0; k<num_rules; k++)
  {
    sscanf(buf, "%d:%d:%[^$]", &mode, &item, str);
    snprintf(confname, 200, "plugins/lighttable/collect/mode%1d", k);
    dt_conf_set_int(confname, mode);
    snprintf(confname, 200, "plugins/lighttable/collect/item%1d", k);
    dt_conf_set_int(confname, item);
    snprintf(confname, 200, "plugins/lighttable/collect/string%1d", k);
    dt_conf_set_string(confname, str);
    while(buf[0] != '$' && buf[0] != '\0') buf++;
    buf++;
  }
  dt_collection_update_query(darktable.collection);
}
Beispiel #4
0
void dt_configure_defaults()
{
  const int atom_cores = dt_get_num_atom_cores();
  const int threads = dt_get_num_threads();
  const size_t mem = dt_get_total_memory();
  const int bits = (sizeof(void*) == 4) ? 32 : 64;
  fprintf(stderr, "[defaults] found a %d-bit system with %zu kb ram and %d cores (%d atom based)\n", bits, mem, threads, atom_cores);
  if(mem > (2u<<20) && threads > 4)
  {
    fprintf(stderr, "[defaults] setting high quality defaults\n");
    dt_conf_set_int("worker_threads", 8);
    dt_conf_set_int("cache_memory", 1u<<30);
    dt_conf_set_int("plugins/lighttable/thumbnail_width", 1300);
    dt_conf_set_int("plugins/lighttable/thumbnail_height", 1000);
    dt_conf_set_bool("plugins/lighttable/low_quality_thumbnails", FALSE);
  }
  if(mem < (1u<<20) || threads <= 2 || bits < 64 || atom_cores > 0)
  {
    fprintf(stderr, "[defaults] setting very conservative defaults\n");
    dt_conf_set_int("worker_threads", 1);
    dt_conf_set_int("cache_memory", 200u<<20);
    dt_conf_set_int("host_memory_limit", 500);
    dt_conf_set_int("singlebuffer_limit", 8);
    dt_conf_set_int("plugins/lighttable/thumbnail_width", 800);
    dt_conf_set_int("plugins/lighttable/thumbnail_height", 500);
    dt_conf_set_string("plugins/darkroom/demosaic/quality", "always bilinear (fast)");
    dt_conf_set_bool("plugins/lighttable/low_quality_thumbnails", TRUE);
  }
}
Beispiel #5
0
/* enter tethering mode for camera */
static void _lib_import_tethered_callback(GtkToggleButton *button,gpointer data)
{
  /* select camera to work with before switching mode */
  dt_camctl_select_camera(darktable.camctl, (dt_camera_t *)data);
  dt_conf_set_int( "plugins/capture/mode", DT_CAPTURE_MODE_TETHERED);
  dt_conf_set_int("plugins/capture/current_filmroll",-1);
  dt_ctl_switch_mode_to(DT_CAPTURE);
}
void
gui_reset (dt_lib_module_t *self)
{
    dt_conf_set_int("plugins/lighttable/collect/num_rules", 1);
    dt_conf_set_int("plugins/lighttable/collect/item0", 0);
    dt_conf_set_string("plugins/lighttable/collect/string0", "%");
    dt_collection_update_query(darktable.collection);
}
Beispiel #7
0
static void bpp_combobox_changed(GtkWidget *widget, gpointer user_data)
{
  const int bpp = dt_bauhaus_combobox_get(widget);

  if(bpp == 1)
    dt_conf_set_int("plugins/imageio/format/tiff/bpp", 16);
  else if(bpp == 2)
    dt_conf_set_int("plugins/imageio/format/tiff/bpp", 32);
  else // (bpp == 0)
    dt_conf_set_int("plugins/imageio/format/tiff/bpp", 8);
}
Beispiel #8
0
static void
bpp_combobox_changed(GtkComboBox *widget, gpointer user_data)
{
    int bpp = gtk_combo_box_get_active(widget);

    if (bpp == 1)
        dt_conf_set_int("plugins/imageio/format/tiff/bpp", 16);
    else if (bpp == 2)
        dt_conf_set_int("plugins/imageio/format/tiff/bpp", 32);
    else // (bpp == 0)
        dt_conf_set_int("plugins/imageio/format/tiff/bpp", 8);
}
Beispiel #9
0
void gui_reset(dt_lib_module_t *self)
{
  dt_conf_set_int("plugins/lighttable/recentcollect/num_items", 0);
  char confname[200];
  for(int k = 0; k < NUM_LINES; k++)
  {
    snprintf(confname, sizeof(confname), "plugins/lighttable/recentcollect/line%1d", k);
    dt_conf_set_string(confname, "");
    snprintf(confname, sizeof(confname), "plugins/lighttable/recentcollect/pos%1d", k);
    dt_conf_set_int(confname, 0);
  }
  _lib_recentcollection_updated(NULL, self);
}
Beispiel #10
0
void dt_film_set_query(const int32_t id)
{
  /* enable film id filter and set film id */
  dt_conf_set_int("plugins/lighttable/collect/num_rules", 1);
  dt_conf_set_int("plugins/lighttable/collect/item0", 0);
  sqlite3_stmt *stmt;
  DT_DEBUG_SQLITE3_PREPARE_V2(dt_database_get(darktable.db),
                              "SELECT id, folder FROM main.film_rolls WHERE id = ?1", -1, &stmt, NULL);
  DT_DEBUG_SQLITE3_BIND_INT(stmt, 1, id);
  if(sqlite3_step(stmt) == SQLITE_ROW)
  {
    dt_conf_set_string("plugins/lighttable/collect/string0", (gchar *)sqlite3_column_text(stmt, 1));
  }
  sqlite3_finalize(stmt);
  dt_collection_update_query(darktable.collection);
}
Beispiel #11
0
/** check if image size fit into limits given by OpenCL runtime */
int dt_opencl_image_fits_device(const int devid, const size_t width, const size_t height, const unsigned bpp, const float factor, const size_t overhead)
{
  static float headroom = -1.0f;

  if(!darktable.opencl->inited || devid < 0) return FALSE;

  /* first time run */
  if(headroom < 0.0f)
  {
    headroom = (float)dt_conf_get_int("opencl_memory_headroom")*1024*1024;

    /* don't let the user play games with us */
    headroom = fmin((float)darktable.opencl->dev[devid].max_global_mem, fmax(headroom, 0.0f));
    dt_conf_set_int("opencl_memory_headroom", headroom/1024/1024);
  }

  float singlebuffer = (float)width * height * bpp;
  float total = factor * singlebuffer + overhead;

  if(darktable.opencl->dev[devid].max_image_width < width || darktable.opencl->dev[devid].max_image_height < height) return FALSE;

  if(darktable.opencl->dev[devid].max_mem_alloc < singlebuffer) return FALSE;

  if(darktable.opencl->dev[devid].max_global_mem < total + headroom) return FALSE;

  return TRUE;
}
Beispiel #12
0
static gboolean _lib_filmstrip_size_handle_motion_notify_callback(GtkWidget *w, GdkEventButton *e,
                                                                  gpointer user_data)
{
  dt_lib_module_t *self = (dt_lib_module_t *)user_data;
  dt_lib_filmstrip_t *d = (dt_lib_filmstrip_t *)self->data;
  if(d->size_handle_is_dragging)
  {
    gint x, y, sx, sy;
#if GTK_CHECK_VERSION(3, 20, 0)
    gdk_window_get_device_position(e->window,
        gdk_seat_get_pointer(gdk_display_get_default_seat(
            gdk_window_get_display(gtk_widget_get_window(dt_ui_main_window(darktable.gui->ui))))),
        &x, &y, 0);
#else
    gdk_window_get_device_position(
        gtk_widget_get_window(dt_ui_main_window(darktable.gui->ui)),
        gdk_device_manager_get_client_pointer(gdk_display_get_device_manager(
            gdk_window_get_display(gtk_widget_get_window(dt_ui_main_window(darktable.gui->ui))))),
        &x, &y, NULL);
#endif

    gtk_widget_get_size_request(d->filmstrip, &sx, &sy);
    sy = CLAMP(d->size_handle_height + (d->size_handle_y - y), DT_PIXEL_APPLY_DPI(64),
               DT_PIXEL_APPLY_DPI(400));

    dt_conf_set_int("plugins/lighttable/filmstrip/height", sy);

    gtk_widget_set_size_request(d->filmstrip, -1, sy);

    return TRUE;
  }

  return FALSE;
}
static void
menuitem_and_not (GtkMenuItem *menuitem, dt_lib_collect_rule_t *d)
{
    // add next row with and not operator
    const int active = CLAMP(dt_conf_get_int("plugins/lighttable/collect/num_rules"), 1, MAX_RULES);
    if(active < 10)
    {
        char confname[200];
        snprintf(confname, 200, "plugins/lighttable/collect/mode%1d", active);
        dt_conf_set_int(confname, DT_LIB_COLLECT_MODE_AND_NOT);
        snprintf(confname, 200, "plugins/lighttable/collect/string%1d", active);
        dt_conf_set_string(confname, "");
        dt_conf_set_int("plugins/lighttable/collect/num_rules", active+1);
    }
    dt_collection_update_query(darktable.collection);
}
Beispiel #14
0
static void
radiobutton_changed (GtkRadioButton *radiobutton, gpointer user_data)
{
  long int bpp = (long int)user_data;
  if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(radiobutton)))
    dt_conf_set_int("plugins/imageio/format/tiff/bpp", bpp);
}
Beispiel #15
0
static void
set_format_by_name (dt_lib_export_t *d, const char *name)
{
  // Find index of selected format plugin among all existing plugins
  int k=-1;
  GList *it = g_list_first(darktable.imageio->plugins_format);
  if( it != NULL )
    do
    {
      k++;
      if( strcmp(  ((dt_imageio_module_format_t *)it->data)->name(),name) == 0 ||
          strcmp(  ((dt_imageio_module_format_t *)it->data)->plugin_name,name) == 0) break;
    }
    while( ( it = g_list_next(it) ) );

  // Store the new format
  dt_conf_set_int ("plugins/lighttable/export/format", k);
  it = g_list_nth(darktable.imageio->plugins_format, k);
  if(it)
  {
    dt_imageio_module_format_t *module = (dt_imageio_module_format_t *)it->data;
    GtkWidget *old = gtk_bin_get_child(GTK_BIN(d->format_box));
    if(old != module->widget)
    {
      if(old) gtk_container_remove(d->format_box, old);
      if(module->widget) gtk_container_add(d->format_box, module->widget);
    }
    gtk_widget_show_all(GTK_WIDGET(d->format_box));
    if(!darktable.gui->reset && _combo_box_set_active_text( d->format, module->name() ) == FALSE )
      gtk_combo_box_set_active( d->format, 0);
  }

  // Let's also update combination of storage/format dimension restrictions
  _update_dimensions( d );
}
Beispiel #16
0
static int write_pref(lua_State*L)
{
  const char *script = luaL_checkstring(L,1);
  const char *name = luaL_checkstring(L,2);
  const char* type_name = luaL_checkstring(L,3);
  int i;
  for (i=0; pref_type_name[i]; i++)
    if (strcmp(pref_type_name[i], type_name) == 0)
    {
      break;
    }
  if(!pref_type_name[i]) luaL_argerror(L,3,NULL);

  char pref_name[1024];
  get_pref_name(pref_name,1024,script,name);
  switch(i)
  {
    case pref_string:
      dt_conf_set_string(pref_name,luaL_checkstring(L,4));
      break;
    case pref_bool:
      luaL_checktype(L,4,LUA_TBOOLEAN);
      dt_conf_set_bool(pref_name,lua_toboolean(L,4));
      break;
    case pref_int:
      dt_conf_set_int(pref_name,luaL_checkinteger(L,4));
      break;
  }
  return 0;
}
Beispiel #17
0
int dt_control_load_config(dt_control_t *c)
{
  GtkWidget *widget = dt_ui_main_window(darktable.gui->ui);
  dt_conf_set_int("ui_last/view", DT_MODE_NONE);
  int width = dt_conf_get_int("ui_last/window_w");
  int height = dt_conf_get_int("ui_last/window_h");
#ifndef __WIN32__
  gint x = dt_conf_get_int("ui_last/window_x");
  gint y = dt_conf_get_int("ui_last/window_y");
  gtk_window_move(GTK_WINDOW(widget), x, y);
#endif
  gtk_window_resize(GTK_WINDOW(widget), width, height);
  int fullscreen = dt_conf_get_bool("ui_last/fullscreen");
  if(fullscreen)
    gtk_window_fullscreen(GTK_WINDOW(widget));
  else
  {
    gtk_window_unfullscreen(GTK_WINDOW(widget));
    int maximized = dt_conf_get_bool("ui_last/maximized");
    if(maximized)
      gtk_window_maximize(GTK_WINDOW(widget));
    else
      gtk_window_unmaximize(GTK_WINDOW(widget));
  }
  return 0;
}
Beispiel #18
0
static void _lib_lighttable_change_layout(dt_lib_module_t *self, dt_lighttable_layout_t layout)
{
  dt_lib_tool_lighttable_t *d = (dt_lib_tool_lighttable_t *)self->data;

  const int current_layout = dt_conf_get_int("plugins/lighttable/layout");
  d->layout = layout;

  if(layout == DT_LIGHTTABLE_LAYOUT_EXPOSE)
  {
    gtk_widget_hide(d->zoom);
    gtk_widget_hide(d->zoom_entry);
  }
  else
  {
    gtk_widget_show(d->zoom);
    gtk_widget_show(d->zoom_entry);
  }

  if(current_layout != layout)
  {
    dt_conf_set_int("plugins/lighttable/layout", layout);
    gtk_combo_box_set_active(GTK_COMBO_BOX(d->layout_combo), layout);
    dt_control_signal_raise(darktable.signals, DT_SIGNAL_COLLECTION_CHANGED);
  }
  else
  {
    dt_control_queue_redraw_center();
  }
}
Beispiel #19
0
void dt_ctl_switch_mode_to(dt_control_gui_mode_t mode)
{
  dt_control_gui_mode_t oldmode = dt_conf_get_int("ui_last/view");
  if(oldmode == mode) return;

  darktable.control->button_down = 0;
  darktable.control->button_down_which = 0;
  darktable.gui->center_tooltip = 0;
  GtkWidget *widget = dt_ui_center(darktable.gui->ui);
  g_object_set(G_OBJECT(widget), "tooltip-text", "", (char *)NULL);

  char buf[512];
  snprintf(buf, sizeof(buf) - 1, _("switch to %s mode"),
           dt_view_manager_name(darktable.view_manager));

  gboolean i_own_lock = dt_control_gdk_lock();

  int error = dt_view_manager_switch(darktable.view_manager, mode);

  if(i_own_lock) dt_control_gdk_unlock();

  if(error) return;

  dt_conf_set_int ("ui_last/view", mode);
}
Beispiel #20
0
void
dt_collection_deserialize(char *buf)
{
  int num_rules = 0;
  char str[400], confname[200];
  int mode = 0, item = 0;
  sscanf(buf, "%d", &num_rules);
  if(num_rules == 0)
  {
    dt_conf_set_int("plugins/lighttable/collect/num_rules", 1);
    dt_conf_set_int("plugins/lighttable/collect/mode0", 0);
    dt_conf_set_int("plugins/lighttable/collect/item0", 0);
    dt_conf_set_string("plugins/lighttable/collect/string0", "%");
  }
  else
  {
    dt_conf_set_int("plugins/lighttable/collect/num_rules", num_rules);
    while(buf[0] != '\0' && buf[0] != ':') buf++;
    if(buf[0] == ':') buf++;
    for(int k=0; k<num_rules; k++)
    {
      int n = sscanf(buf, "%d:%d:%399[^$]", &mode, &item, str);
      if(n == 3)
      {
        snprintf(confname, sizeof(confname), "plugins/lighttable/collect/mode%1d", k);
        dt_conf_set_int(confname, mode);
        snprintf(confname, sizeof(confname), "plugins/lighttable/collect/item%1d", k);
        dt_conf_set_int(confname, item);
        snprintf(confname, sizeof(confname), "plugins/lighttable/collect/string%1d", k);
        dt_conf_set_string(confname, str);
      }
      else if(num_rules == 1)
      {
        snprintf(confname, sizeof(confname), "plugins/lighttable/collect/mode%1d", k);
        dt_conf_set_int(confname, 0);
        snprintf(confname, sizeof(confname), "plugins/lighttable/collect/item%1d", k);
        dt_conf_set_int(confname, 0);
        snprintf(confname, sizeof(confname), "plugins/lighttable/collect/string%1d", k);
        dt_conf_set_string(confname, "%");
        break;
      }
      else
      {
        dt_conf_set_int("plugins/lighttable/collect/num_rules", k);
        break;
      }
      while(buf[0] != '$' && buf[0] != '\0') buf++;
      if(buf[0] == '$') buf++;
    }
  }
  dt_collection_update_query(darktable.collection);
}
Beispiel #21
0
static void _display_samples_changed(GtkToggleButton *button, gpointer data)
{
  dt_conf_set_int("ui_last/colorpicker_display_samples",
                  gtk_toggle_button_get_active(button));
  darktable.lib->proxy.colorpicker.display_samples =
    gtk_toggle_button_get_active(button);
  dt_dev_invalidate_from_gui(darktable.develop);
}
Beispiel #22
0
static void _restrict_histogram_changed(GtkToggleButton *button, gpointer data)
{
  dt_conf_set_int("ui_last/colorpicker_restrict_histogram",
                  gtk_toggle_button_get_active(button));
  darktable.lib->proxy.colorpicker.restrict_histogram =
    gtk_toggle_button_get_active(button);
  dt_dev_invalidate_from_gui(darktable.develop);
}
Beispiel #23
0
int dt_control_write_config(dt_control_t *c)
{
  // TODO: move to gtk.c
  GtkWidget *widget = dt_ui_main_window(darktable.gui->ui);
  GtkAllocation allocation;
  gtk_widget_get_allocation(widget, &allocation);
  gint x, y;
  gtk_window_get_position(GTK_WINDOW(widget), &x, &y);
  dt_conf_set_int ("ui_last/window_x",  x);
  dt_conf_set_int ("ui_last/window_y",  y);
  dt_conf_set_int ("ui_last/window_w",  allocation.width);
  dt_conf_set_int ("ui_last/window_h",  allocation.height);
  dt_conf_set_bool("ui_last/maximized",
                   (gdk_window_get_state(gtk_widget_get_window(widget)) & GDK_WINDOW_STATE_MAXIMIZED));

  return 0;
}
Beispiel #24
0
void gui_cleanup(dt_lib_module_t *self)
{
  uint32_t curr_pos = dt_view_lighttable_get_position(darktable.view_manager);
  dt_conf_set_int("plugins/lighttable/recentcollect/pos0", curr_pos);
  dt_control_signal_disconnect(darktable.signals, G_CALLBACK(_lib_recentcollection_updated), self);
  free(self->data);
  self->data = NULL;
}
Beispiel #25
0
static void response_callback_int(GtkDialog *dialog, gint response_id, pref_element* cur_elt)
{
  if(response_id == GTK_RESPONSE_ACCEPT)
  {
    char pref_name[1024];
    get_pref_name(pref_name,1024,cur_elt->script,cur_elt->name);
    dt_conf_set_int(pref_name, gtk_spin_button_get_value(GTK_SPIN_BUTTON(cur_elt->widget)));
  }
}
Beispiel #26
0
void dt_control_init(dt_control_t *s)
{
  memset(s->vimkey, 0, sizeof(s->vimkey));
  s->vimkey_cnt = 0;

  // same thread as init
  s->gui_thread = pthread_self();

  // initialize static mutex
  dt_pthread_mutex_init(&_control_gdk_lock_threads_mutex, NULL);

  // s->last_expose_time = dt_get_wtime();
  s->key_accelerators_on = 1;
  s->log_pos = s->log_ack = 0;
  s->log_busy = 0;
  s->log_message_timeout_id = 0;
  dt_pthread_mutex_init(&(s->log_mutex), NULL);
  s->progress = 200.0f;

  dt_conf_set_int("ui_last/view", DT_MODE_NONE);

  pthread_cond_init(&s->cond, NULL);
  dt_pthread_mutex_init(&s->cond_mutex, NULL);
  dt_pthread_mutex_init(&s->queue_mutex, NULL);
  dt_pthread_mutex_init(&s->run_mutex, NULL);
  pthread_rwlock_init(&s->xprofile_lock, NULL);
  dt_pthread_mutex_init(&(s->global_mutex), NULL);
  dt_pthread_mutex_init(&(s->image_mutex), NULL);

  // start threads
  s->num_threads = CLAMP(dt_conf_get_int ("worker_threads"), 1, 8);
  s->thread = (pthread_t *)malloc(sizeof(pthread_t)*s->num_threads);
  dt_pthread_mutex_lock(&s->run_mutex);
  s->running = 1;
  dt_pthread_mutex_unlock(&s->run_mutex);
  for(int k=0; k<s->num_threads; k++)
    pthread_create(&s->thread[k], NULL, dt_control_work, s);

  /* create queue kicker thread */
  pthread_create(&s->kick_on_workers_thread, NULL, _control_worker_kicker, s);

  for(int k=0; k<DT_CTL_WORKER_RESERVED; k++)
  {
    s->new_res[k] = 0;
    pthread_create(&s->thread_res[k], NULL, dt_control_work_res, s);
    dt_pthread_mutex_init(&s->job_res[k].state_mutex, NULL);
    dt_pthread_mutex_init(&s->job_res[k].wait_mutex, NULL);
  }
  s->button_down = 0;
  s->button_down_which = 0;
  s->mouse_over_id = -1;
  s->dev_closeup = 0;
  s->dev_zoom_x = 0;
  s->dev_zoom_y = 0;
  s->dev_zoom = DT_ZOOM_FIT;
}
Beispiel #27
0
static void _size_changed(GtkComboBox *widget, gpointer p)
{
  dt_lib_colorpicker_t *data = ((dt_lib_module_t *)p)->data;

  dt_conf_set_int("ui_last/colorpicker_size", gtk_combo_box_get_active(widget));
  darktable.lib->proxy.colorpicker.size = gtk_combo_box_get_active(widget);
  gtk_widget_set_sensitive(data->statistic_selector, dt_conf_get_int("ui_last/colorpicker_size"));
  dt_dev_invalidate_from_gui(darktable.develop);
  _update_picker_output(p);
}
Beispiel #28
0
static void _golden_mean_changed(GtkWidget *combo, _golden_mean_t *user_data)
{
  int which = dt_bauhaus_combobox_get(combo);

  // remember setting
  dt_conf_set_int("plugins/darkroom/clipping/golden_extras", which);

  _golden_mean_set_data(user_data, which);

  dt_control_queue_redraw_center();
}
Beispiel #29
0
void gui_cleanup(struct dt_iop_module_t *self)
{
  dt_iop_colorzones_gui_data_t *c = (dt_iop_colorzones_gui_data_t *)self->gui_data;
  dt_conf_set_int("plugins/darkroom/colorzones/gui_channel", c->channel);
  dt_colorspaces_cleanup_profile(c->hsRGB);
  dt_colorspaces_cleanup_profile(c->hLab);
  cmsDeleteTransform(c->xform);
  dt_draw_curve_destroy(c->minmax_curve);
  free(self->gui_data);
  self->gui_data = NULL;
}
Beispiel #30
0
int
set_params(dt_imageio_module_format_t *self, void *params, int size)
{
  if(size != sizeof(dt_imageio_tiff_t) - sizeof(TIFF*)) return 1;
  dt_imageio_tiff_t *d = (dt_imageio_tiff_t *)params;
  dt_imageio_tiff_gui_t *g = (dt_imageio_tiff_gui_t *)self->gui_data;
  if(d->bpp < 12) gtk_toggle_button_set_active(g->b8, TRUE);
  else            gtk_toggle_button_set_active(g->b16, TRUE);
  dt_conf_set_int("plugins/imageio/format/tiff/bpp", d->bpp);
  return 0;
}