Пример #1
0
void init_presets(dt_iop_module_so_t *self)
{
  // transform presets above to db entries.
  // sql begin
  DT_DEBUG_SQLITE3_EXEC(dt_database_get(darktable.db), "begin", NULL, NULL, NULL);
  for(int k = 0; k < basecurve_presets_cnt; k++)
  {
    // add the preset.
    dt_gui_presets_add_generic(_(basecurve_presets[k].name), self->op, self->version(),
                               &basecurve_presets[k].params, sizeof(dt_iop_basecurve_params_t), 1);
    // and restrict it to model, maker, iso, and raw images
    dt_gui_presets_update_mml(_(basecurve_presets[k].name), self->op, self->version(),
                              basecurve_presets[k].maker, basecurve_presets[k].model, "");
    dt_gui_presets_update_iso(_(basecurve_presets[k].name), self->op, self->version(),
                              basecurve_presets[k].iso_min, basecurve_presets[k].iso_max);
    dt_gui_presets_update_ldr(_(basecurve_presets[k].name), self->op, self->version(), FOR_RAW);
    // make it auto-apply for matching images:
    dt_gui_presets_update_autoapply(_(basecurve_presets[k].name), self->op, self->version(),
                                    basecurve_presets[k].autoapply);
    // hide all non-matching presets in case the model string is set.
    dt_gui_presets_update_filter(_(basecurve_presets[k].name), self->op, self->version(),
                                 basecurve_presets[k].filter);
  }
  // sql commit
  DT_DEBUG_SQLITE3_EXEC(dt_database_get(darktable.db), "commit", NULL, NULL, NULL);
}
Пример #2
0
void init_presets (dt_iop_module_so_t *self)
{
  dt_iop_sharpen_params_t tmp = (dt_iop_sharpen_params_t)
    { 2.0, 0.5, 0.5 };
  // add the preset.
  dt_gui_presets_add_generic(_("sharpen"), self->op, self->version(), &tmp, sizeof(dt_iop_sharpen_params_t), 1);
  // restrict to raw images
  dt_gui_presets_update_ldr(_("sharpen"), self->op, self->version(), 2);
  // make it auto-apply for matching images:
  dt_gui_presets_update_autoapply(_("sharpen"), self->op, self->version(), 1);
}
Пример #3
0
void init_presets (dt_iop_module_t *self)
{
  // transform presets above to db entries.
  // sql begin
  sqlite3_exec(darktable.db, "begin", NULL, NULL, NULL);
  for(int k=0;k<basecurve_presets_cnt;k++)
  {
    // add the preset.
    dt_gui_presets_add_generic(_(basecurve_presets[k].name), self->op, &basecurve_presets[k].params, sizeof(dt_iop_basecurve_params_t), 1);
    // and restrict it to model, maker, iso, and raw images
    dt_gui_presets_update_mml(_(basecurve_presets[k].name), self->op, basecurve_presets[k].maker, basecurve_presets[k].model, "");
    dt_gui_presets_update_iso(_(basecurve_presets[k].name), self->op, basecurve_presets[k].iso_min, basecurve_presets[k].iso_max);
    dt_gui_presets_update_ldr(_(basecurve_presets[k].name), self->op, 2);
    // make it auto-apply for matching images:
    dt_gui_presets_update_autoapply(_(basecurve_presets[k].name), self->op, basecurve_presets[k].autoapply);
  }
  // sql commit
  sqlite3_exec(darktable.db, "commit", NULL, NULL, NULL);
}
Пример #4
0
static void set_presets(dt_iop_module_so_t *self, const basecurve_preset_t *presets, int count, int *force_autoapply)
{
  // transform presets above to db entries.
  for(int k = 0; k < count; k++)
  {
    // add the preset.
    dt_gui_presets_add_generic(_(presets[k].name), self->op, self->version(),
                               &presets[k].params, sizeof(dt_iop_basecurve_params_t), 1);
    // and restrict it to model, maker, iso, and raw images
    dt_gui_presets_update_mml(_(presets[k].name), self->op, self->version(),
                              presets[k].maker, presets[k].model, "");
    dt_gui_presets_update_iso(_(presets[k].name), self->op, self->version(),
                              presets[k].iso_min, presets[k].iso_max);
    dt_gui_presets_update_ldr(_(presets[k].name), self->op, self->version(), FOR_RAW);
    // make it auto-apply for matching images:
    dt_gui_presets_update_autoapply(_(presets[k].name), self->op, self->version(),
                                    force_autoapply ? *force_autoapply : presets[k].autoapply);
    // hide all non-matching presets in case the model string is set.
    // When force_autoapply was given always filter (as these are per-camera presets)
    dt_gui_presets_update_filter(_(presets[k].name), self->op, self->version(),
                                 force_autoapply || presets[k].filter);
  }
}