[gegl] insta-filter, insta-curve: Add a NONE preset



commit 17bf9eb9f6499d761ca69aeff56e65e5089cc036
Author: Debarshi Ray <debarshir gnome org>
Date:   Fri Feb 19 13:38:47 2016 +0100

    insta-filter, insta-curve: Add a NONE preset
    
    ... and make it the default, instead of 1977.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=743681

 operations/workshop/insta-curve.c  |    4 +++-
 operations/workshop/insta-filter.c |   10 +++++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/operations/workshop/insta-curve.c b/operations/workshop/insta-curve.c
index 2f96869..65ba3bf 100644
--- a/operations/workshop/insta-curve.c
+++ b/operations/workshop/insta-curve.c
@@ -22,6 +22,7 @@
 #ifdef GEGL_PROPERTIES
 
 enum_start (gegl_insta_curve_preset)
+  enum_value (GEGL_INSTA_CURVE_PRESET_NONE, "none", "None")
   enum_value (GEGL_INSTA_CURVE_PRESET_1977, "1977", "1977")
   enum_value (GEGL_INSTA_CURVE_PRESET_BRANNAN, "brannan", "Brannan")
   enum_value (GEGL_INSTA_CURVE_PRESET_GOTHAM, "gotham", "Gotham")
@@ -30,7 +31,7 @@ enum_end (GeglInstaCurvePreset)
 
 property_enum (preset, _("Preset"),
                GeglInstaCurvePreset, gegl_insta_curve_preset,
-               GEGL_INSTA_CURVE_PRESET_1977)
+               GEGL_INSTA_CURVE_PRESET_NONE)
   description (_("Which curve to apply"))
 
 #else
@@ -689,6 +690,7 @@ prepare (GeglOperation *operation)
         }
       break;
 
+    case GEGL_INSTA_CURVE_PRESET_NONE:
     default:
       g_assert_not_reached ();
     }
diff --git a/operations/workshop/insta-filter.c b/operations/workshop/insta-filter.c
index 77de041..99e7e4f 100644
--- a/operations/workshop/insta-filter.c
+++ b/operations/workshop/insta-filter.c
@@ -22,6 +22,7 @@
 #ifdef GEGL_PROPERTIES
 
 enum_start (gegl_insta_filter_preset)
+  enum_value (GEGL_INSTA_FILTER_PRESET_NONE, "none", "None")
   enum_value (GEGL_INSTA_FILTER_PRESET_1977, "1977", "1977")
   enum_value (GEGL_INSTA_FILTER_PRESET_BRANNAN, "brannan", "Brannan")
   enum_value (GEGL_INSTA_FILTER_PRESET_GOTHAM, "gotham", "Gotham")
@@ -30,7 +31,7 @@ enum_end (GeglInstaFilterPreset)
 
 property_enum (preset, _("Preset"),
                GeglInstaFilterPreset, gegl_insta_filter_preset,
-               GEGL_INSTA_FILTER_PRESET_1977)
+               GEGL_INSTA_FILTER_PRESET_NONE)
   description (_("Which filter to apply"))
 
 #else
@@ -70,6 +71,13 @@ do_setup (GeglOperation *operation)
 
   switch (o->preset)
     {
+    case GEGL_INSTA_FILTER_PRESET_NONE:
+      node = gegl_node_new_child (operation->node,
+                                  "operation", "gegl:nop",
+                                  NULL);
+      self->nodes = g_list_prepend (self->nodes, node);
+      break;
+
     case GEGL_INSTA_FILTER_PRESET_1977:
       node = gegl_node_new_child (operation->node,
                                   "operation", "gegl:insta-curve",


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]