[gimp/pippin/linear-is-the-new-black: 1/12] app: do not let pixel encoding determine layer modes



commit c1ec7cc50b24b047b1b53ec3f158b1956171ddb3
Author: Øyvind Kolås <pippin gimp org>
Date:   Thu Dec 22 23:50:02 2016 +0100

    app: do not let pixel encoding determine layer modes
    
    See bug #757485 - woth noting that this also enables linear and thus correct
    compositing when using 8bpc perceptual gamma as the layer storage format.

 app/gegl/gimp-gegl-nodes.c |   44 ++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 44 insertions(+), 0 deletions(-)
---
diff --git a/app/gegl/gimp-gegl-nodes.c b/app/gegl/gimp-gegl-nodes.c
index 1a27c15..7f2a77b 100644
--- a/app/gegl/gimp-gegl-nodes.c
+++ b/app/gegl/gimp-gegl-nodes.c
@@ -197,6 +197,50 @@ gimp_gegl_mode_node_set_mode (GeglNode             *node,
                  "linear",    linear,
                  "opacity",   opacity,
                  NULL);
+
+  switch (mode)
+    {
+    case GIMP_NORMAL_MODE:
+    case GIMP_DISSOLVE_MODE:
+    case GIMP_BEHIND_MODE:
+    case GIMP_MULTIPLY_MODE:
+    case GIMP_SCREEN_MODE:
+    case GIMP_ADDITION_MODE:
+    case GIMP_SUBTRACT_MODE:
+    case GIMP_DARKEN_ONLY_MODE:
+    case GIMP_LIGHTEN_ONLY_MODE:
+        gegl_node_set (node,
+           "linear",    TRUE,
+           NULL);
+        break;
+    case GIMP_OVERLAY_MODE:
+    case GIMP_DIFFERENCE_MODE:
+    case GIMP_HUE_MODE:
+    case GIMP_SATURATION_MODE:
+    case GIMP_COLOR_MODE:
+    case GIMP_VALUE_MODE:
+    case GIMP_DIVIDE_MODE:
+    case GIMP_DODGE_MODE:
+    case GIMP_BURN_MODE:
+    case GIMP_HARDLIGHT_MODE:
+    case GIMP_SOFTLIGHT_MODE:
+    case GIMP_GRAIN_EXTRACT_MODE:
+    case GIMP_GRAIN_MERGE_MODE:
+    case GIMP_COLOR_ERASE_MODE:
+    case GIMP_NEW_OVERLAY_MODE:
+    case GIMP_ERASE_MODE:
+    case GIMP_REPLACE_MODE:
+    case GIMP_ANTI_ERASE_MODE:
+    case GIMP_LCH_HUE_MODE:
+    case GIMP_LCH_CHROMA_MODE:
+    case GIMP_LCH_COLOR_MODE:
+    case GIMP_LCH_LIGHTNESS_MODE:
+    default:
+        gegl_node_set (node,
+           "linear",   FALSE,
+           NULL);
+        break;
+    }
 }
 
 void


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