diff options
author | John Stebbins <[email protected]> | 2017-05-26 14:16:18 -0700 |
---|---|---|
committer | John Stebbins <[email protected]> | 2017-05-30 11:20:42 -0700 |
commit | 66a364099807593f50226c811dc3345ed4d5371a (patch) | |
tree | 576fbb8e7bfecf1432d7c5db408c504f65ae56d6 /gtk/src/hb-backend.c | |
parent | 2b0cbe69a83848fb0b8012ed858fa3ab402889e3 (diff) |
LinGui: Add UI support for BradleyS' sharpen filters
Diffstat (limited to 'gtk/src/hb-backend.c')
-rw-r--r-- | gtk/src/hb-backend.c | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c index 38e22eca7..ec819895c 100644 --- a/gtk/src/hb-backend.c +++ b/gtk/src/hb-backend.c @@ -220,6 +220,18 @@ combo_opts_t denoise_opts = d_denoise_opts }; +static options_map_t d_sharpen_opts[] = +{ + {N_("Off"), "off", HB_FILTER_INVALID}, + {N_("Unsharp"), "unsharp", HB_FILTER_UNSHARP}, + {N_("Lapsharp"), "lapsharp", HB_FILTER_LAPSHARP }, +}; +combo_opts_t sharpen_opts = +{ + sizeof(d_sharpen_opts)/sizeof(options_map_t), + d_sharpen_opts +}; + static options_map_t d_rotate_opts[] = { {N_("Off"), "disable=1", 0}, @@ -367,6 +379,18 @@ static filter_opts_t nlmeans_tune_opts = .preset = FALSE }; +static filter_opts_t sharpen_preset_opts = +{ + .filter_id = HB_FILTER_UNSHARP, + .preset = TRUE +}; + +static filter_opts_t sharpen_tune_opts = +{ + .filter_id = HB_FILTER_UNSHARP, + .preset = FALSE +}; + #if 0 static filter_opts_t hqdn3d_preset_opts = { @@ -439,6 +463,8 @@ static void deint_opts_set(signal_user_data_t *ud, const gchar *name, void *vopts, const void* data); static void denoise_opts_set(signal_user_data_t *ud, const gchar *name, void *vopts, const void* data); +static void sharpen_opts_set(signal_user_data_t *ud, const gchar *name, + void *vopts, const void* data); static GhbValue * generic_opt_get(const char *name, const void *opts, const GhbValue *gval, GhbType type); @@ -556,6 +582,24 @@ combo_name_map_t combo_name_map[] = filter_opt_get }, { + "PictureSharpenFilter", + &sharpen_opts, + small_opts_set, + generic_opt_get + }, + { + "PictureSharpenPreset", + &sharpen_preset_opts, + sharpen_opts_set, + filter_opt_get + }, + { + "PictureSharpenTune", + &sharpen_tune_opts, + sharpen_opts_set, + filter_opt_get + }, + { "PictureRotate", &rotate_opts, small_opts_set, @@ -2575,6 +2619,21 @@ denoise_opts_set(signal_user_data_t *ud, const gchar *name, "denoise", opts->filter_id); } +static void +sharpen_opts_set(signal_user_data_t *ud, const gchar *name, + void *vopts, const void* data) +{ + (void)data; // Silence "unused variable" warning + + filter_opts_t *opts = (filter_opts_t*)vopts; + opts->filter_id = ghb_settings_combo_int(ud->settings, + "PictureSharpenFilter"); + filter_opts_set2(ud, name, opts->filter_id, opts->preset); + + ghb_set_custom_filter_tooltip(ud, "PictureSharpenCustom", + "sharpen", opts->filter_id); +} + combo_name_map_t* find_combo_map(const gchar *name) { |