From f4c5f91bd93fa8f298ff0f117c960a9ac24eff30 Mon Sep 17 00:00:00 2001 From: Yi-Soo An Date: Sat, 4 Aug 2018 10:17:12 +0900 Subject: [PATCH] Add Gray filter It turns the image grayscale. refer to gegl:gray https://gitlab.gnome.org/GNOME/gnome-photos/issues/95 --- src/photos-operation-insta-common.h | 1 + src/photos-operation-insta-curve.c | 1 + src/photos-operation-insta-filter.c | 3 +++ src/photos-tool-filters.c | 6 ++++++ 4 files changed, 11 insertions(+) diff --git a/src/photos-operation-insta-common.h b/src/photos-operation-insta-common.h index a6a51893..66dbdd8c 100644 --- a/src/photos-operation-insta-common.h +++ b/src/photos-operation-insta-common.h @@ -29,6 +29,7 @@ typedef enum PHOTOS_OPERATION_INSTA_PRESET_CAAP, PHOTOS_OPERATION_INSTA_PRESET_MOGADISHU, PHOTOS_OPERATION_INSTA_PRESET_HOMETOWN, + PHOTOS_OPERATION_INSTA_PRESET_GRAY, PHOTOS_OPERATION_INSTA_PRESET_1977 = PHOTOS_OPERATION_INSTA_PRESET_1947, PHOTOS_OPERATION_INSTA_PRESET_BRANNAN = PHOTOS_OPERATION_INSTA_PRESET_CALISTOGA, diff --git a/src/photos-operation-insta-curve.c b/src/photos-operation-insta-curve.c index 67e00880..53abb881 100644 --- a/src/photos-operation-insta-curve.c +++ b/src/photos-operation-insta-curve.c @@ -1012,6 +1012,7 @@ photos_operation_insta_curve_prepare (GeglOperation *operation) break; case PHOTOS_OPERATION_INSTA_PRESET_NONE: + case PHOTOS_OPERATION_INSTA_PRESET_GRAY: case PHOTOS_OPERATION_INSTA_PRESET_HEFE: default: g_assert_not_reached (); diff --git a/src/photos-operation-insta-filter.c b/src/photos-operation-insta-filter.c index 5348fd4f..0e226ab1 100644 --- a/src/photos-operation-insta-filter.c +++ b/src/photos-operation-insta-filter.c @@ -88,7 +88,10 @@ photos_operation_insta_filter_setup (PhotosOperationInstaFilter *self) "preset", self->preset, NULL); self->nodes = g_list_prepend (self->nodes, node); + /* Fall through! + * GOTHAM needs gegl:gray */ + case PHOTOS_OPERATION_INSTA_PRESET_GRAY: node = gegl_node_new_child (operation->node, "operation", "gegl:gray", NULL); diff --git a/src/photos-tool-filters.c b/src/photos-tool-filters.c index 3050946e..18f6b702 100644 --- a/src/photos-tool-filters.c +++ b/src/photos-tool-filters.c @@ -219,6 +219,12 @@ photos_tool_filters_init (PhotosToolFilters *self) self->buttons = g_list_prepend (self->buttons, button); row++; + button = photos_tool_filter_button_new (group, _("Gray")); + gtk_actionable_set_action_name (GTK_ACTIONABLE (button), "app.insta-current"); + gtk_actionable_set_action_target (GTK_ACTIONABLE (button), "n", (gint16) PHOTOS_OPERATION_INSTA_PRESET_GRAY); + gtk_grid_attach (GTK_GRID (self->grid), button, 0, row, 1, 1); + self->buttons = g_list_prepend (self->buttons, button); + self->buttons = g_list_reverse (self->buttons); } -- GitLab