[gimp] app: split legacy out of burn and divide



commit 784a8ee224c005f2118537bfdba8f7ab3bddb0f6
Author: Øyvind Kolås <pippin gimp org>
Date:   Wed Jan 11 03:02:54 2017 +0100

    app: split legacy out of burn and divide

 app/core/core-enums.c                              |    8 +-
 app/core/core-enums.h                              |    6 +-
 app/gegl/gimp-gegl-nodes.c                         |   15 ++-
 app/operations/Makefile.am                         |    4 -
 app/operations/gimp-operations.c                   |   12 +-
 app/operations/gimplayermodefunctions.c            |   18 ++-
 app/operations/gimpoperationburnmode.c             |  141 --------------------
 app/operations/gimpoperationburnmode.h             |   61 ---------
 app/operations/layer-modes-legacy/Makefile.am      |    6 +-
 .../gimpoperationburnlegacy.c}                     |   35 +++---
 .../gimpoperationburnlegacy.h}                     |   34 +++---
 .../gimpoperationdividelegacy.c}                   |   64 +++++-----
 .../layer-modes-legacy/gimpoperationdividelegacy.h |   61 +++++++++
 app/operations/layer-modes/Makefile.am             |    7 +-
 app/operations/layer-modes/gimpoperationburn.c     |  139 +++++++++++++++++++
 app/operations/layer-modes/gimpoperationburn.h     |   62 +++++++++
 app/operations/layer-modes/gimpoperationdivide.c   |  136 +++++++++++++++++++
 app/operations/layer-modes/gimpoperationdivide.h   |   62 +++++++++
 app/operations/layer-modes/gimpoperationmultiply.c |    2 +-
 app/widgets/gimpwidgets-constructors.c             |    4 +-
 libgimp/gimpenums.h                                |    4 +-
 tools/pdbgen/enums.pl                              |    7 +-
 22 files changed, 595 insertions(+), 293 deletions(-)
---
diff --git a/app/core/core-enums.c b/app/core/core-enums.c
index 997dffd..392468a 100644
--- a/app/core/core-enums.c
+++ b/app/core/core-enums.c
@@ -331,6 +331,8 @@ gimp_layer_mode_get_type (void)
     { GIMP_LAYER_MODE_HSV_SATURATION, "GIMP_LAYER_MODE_HSV_SATURATION", "hsv-saturation" },
     { GIMP_LAYER_MODE_HSV_COLOR, "GIMP_LAYER_MODE_HSV_COLOR", "hsv-color" },
     { GIMP_LAYER_MODE_HSV_VALUE, "GIMP_LAYER_MODE_HSV_VALUE", "hsv-value" },
+    { GIMP_LAYER_MODE_DIVIDE, "GIMP_LAYER_MODE_DIVIDE", "divide" },
+    { GIMP_LAYER_MODE_BURN, "GIMP_LAYER_MODE_BURN", "burn" },
     { GIMP_LAYER_MODE_ERASE, "GIMP_LAYER_MODE_ERASE", "erase" },
     { GIMP_LAYER_MODE_REPLACE, "GIMP_LAYER_MODE_REPLACE", "replace" },
     { GIMP_LAYER_MODE_ANTI_ERASE, "GIMP_LAYER_MODE_ANTI_ERASE", "anti-erase" },
@@ -354,9 +356,9 @@ gimp_layer_mode_get_type (void)
     { GIMP_LAYER_MODE_HSV_SATURATION_LEGACY, NC_("layer-mode", "Saturation (HSV) (legacy)"), NULL },
     { GIMP_LAYER_MODE_HSV_COLOR_LEGACY, NC_("layer-mode", "Color (HSV) (legacy)"), NULL },
     { GIMP_LAYER_MODE_HSV_VALUE_LEGACY, NC_("layer-mode", "Value (HSV) (legacy)"), NULL },
-    { GIMP_LAYER_MODE_DIVIDE_LEGACY, NC_("layer-mode", "Divide"), NULL },
+    { GIMP_LAYER_MODE_DIVIDE_LEGACY, NC_("layer-mode", "Divide (legacy)"), NULL },
     { GIMP_LAYER_MODE_DODGE_LEGACY, NC_("layer-mode", "Dodge (legacy)"), NULL },
-    { GIMP_LAYER_MODE_BURN_LEGACY, NC_("layer-mode", "Burn"), NULL },
+    { GIMP_LAYER_MODE_BURN_LEGACY, NC_("layer-mode", "Burn (legacy)"), NULL },
     { GIMP_LAYER_MODE_HARDLIGHT_LEGACY, NC_("layer-mode", "Hard light"), NULL },
     { GIMP_LAYER_MODE_SOFTLIGHT_LEGACY, NC_("layer-mode", "Soft light"), NULL },
     { GIMP_LAYER_MODE_GRAIN_EXTRACT_LEGACY, NC_("layer-mode", "Grain extract"), NULL },
@@ -381,6 +383,8 @@ gimp_layer_mode_get_type (void)
     { GIMP_LAYER_MODE_HSV_SATURATION, NC_("layer-mode", "Saturation (HSV)"), NULL },
     { GIMP_LAYER_MODE_HSV_COLOR, NC_("layer-mode", "Color (HSV)"), NULL },
     { GIMP_LAYER_MODE_HSV_VALUE, NC_("layer-mode", "Value (HSV)"), NULL },
+    { GIMP_LAYER_MODE_DIVIDE, NC_("layer-mode", "Divide"), NULL },
+    { GIMP_LAYER_MODE_BURN, NC_("layer-mode", "Burn"), NULL },
     { GIMP_LAYER_MODE_ERASE, NC_("layer-mode", "Erase"), NULL },
     { GIMP_LAYER_MODE_REPLACE, NC_("layer-mode", "Replace"), NULL },
     { GIMP_LAYER_MODE_ANTI_ERASE, NC_("layer-mode", "Anti erase"), NULL },
diff --git a/app/core/core-enums.h b/app/core/core-enums.h
index ded1d2d..6f0c656 100644
--- a/app/core/core-enums.h
+++ b/app/core/core-enums.h
@@ -169,9 +169,9 @@ typedef enum
   GIMP_LAYER_MODE_HSV_SATURATION_LEGACY,  /*< desc="Saturation (HSV) (legacy)">*/
   GIMP_LAYER_MODE_HSV_COLOR_LEGACY,       /*< desc="Color (HSV) (legacy)" >*/
   GIMP_LAYER_MODE_HSV_VALUE_LEGACY,       /*< desc="Value (HSV) (legacy)" >*/
-  GIMP_LAYER_MODE_DIVIDE_LEGACY,          /*< desc="Divide"               >*/
+  GIMP_LAYER_MODE_DIVIDE_LEGACY,          /*< desc="Divide (legacy)"      >*/
   GIMP_LAYER_MODE_DODGE_LEGACY,           /*< desc="Dodge (legacy)"       >*/
-  GIMP_LAYER_MODE_BURN_LEGACY,            /*< desc="Burn"                 >*/
+  GIMP_LAYER_MODE_BURN_LEGACY,            /*< desc="Burn (legacy)"        >*/
   GIMP_LAYER_MODE_HARDLIGHT_LEGACY,       /*< desc="Hard light"           >*/
   GIMP_LAYER_MODE_SOFTLIGHT_LEGACY,       /*< desc="Soft light"           >*/
   GIMP_LAYER_MODE_GRAIN_EXTRACT_LEGACY,   /*< desc="Grain extract"        >*/
@@ -196,6 +196,8 @@ typedef enum
   GIMP_LAYER_MODE_HSV_SATURATION,         /*< desc="Saturation (HSV)"     >*/
   GIMP_LAYER_MODE_HSV_COLOR,              /*< desc="Color (HSV)"          >*/
   GIMP_LAYER_MODE_HSV_VALUE,              /*< desc="Value (HSV)"          >*/
+  GIMP_LAYER_MODE_DIVIDE,                 /*< desc="Divide"               >*/
+  GIMP_LAYER_MODE_BURN,                   /*< desc="Burn"                 >*/
 
   /* internal modes, not available to the PDB */
   GIMP_LAYER_MODE_ERASE      = 1000, /*< pdb-skip, desc="Erase"      >*/
diff --git a/app/gegl/gimp-gegl-nodes.c b/app/gegl/gimp-gegl-nodes.c
index 77d3d21..8e812d0 100644
--- a/app/gegl/gimp-gegl-nodes.c
+++ b/app/gegl/gimp-gegl-nodes.c
@@ -255,8 +255,12 @@ gimp_gegl_mode_node_set_mode (GeglNode      *node,
       operation = "gimp:hsv-value-legacy";
       break;
 
+    case GIMP_LAYER_MODE_DIVIDE:
+      operation = "gimp:divide";
+      break;
+
     case GIMP_LAYER_MODE_DIVIDE_LEGACY:
-      operation = "gimp:divide-mode";
+      operation = "gimp:divide-legacy";
       break;
 
     case GIMP_LAYER_MODE_DODGE:
@@ -267,8 +271,12 @@ gimp_gegl_mode_node_set_mode (GeglNode      *node,
       operation = "gimp:dodge-legacy";
       break;
 
+    case GIMP_LAYER_MODE_BURN:
+      operation = "gimp:burn";
+      break;
+
     case GIMP_LAYER_MODE_BURN_LEGACY:
-      operation = "gimp:burn-mode";
+      operation = "gimp:burn-legacy";
       break;
 
     case GIMP_LAYER_MODE_HARDLIGHT_LEGACY:
@@ -374,9 +382,11 @@ gimp_gegl_mode_node_set_mode (GeglNode      *node,
     case GIMP_LAYER_MODE_HSV_SATURATION_LEGACY:
     case GIMP_LAYER_MODE_HSV_COLOR_LEGACY:
     case GIMP_LAYER_MODE_HSV_VALUE_LEGACY:
+    case GIMP_LAYER_MODE_DIVIDE:
     case GIMP_LAYER_MODE_DIVIDE_LEGACY:
     case GIMP_LAYER_MODE_DODGE:
     case GIMP_LAYER_MODE_DODGE_LEGACY:
+    case GIMP_LAYER_MODE_BURN:
     case GIMP_LAYER_MODE_BURN_LEGACY:
     case GIMP_LAYER_MODE_HARDLIGHT_LEGACY:
     case GIMP_LAYER_MODE_SOFTLIGHT_LEGACY:
@@ -391,7 +401,6 @@ gimp_gegl_mode_node_set_mode (GeglNode      *node,
     case GIMP_LAYER_MODE_LCH_CHROMA:
     case GIMP_LAYER_MODE_LCH_COLOR:
     case GIMP_LAYER_MODE_LCH_LIGHTNESS:
-    default:
         gegl_node_set (node,
            "linear",   FALSE,
            NULL);
diff --git a/app/operations/Makefile.am b/app/operations/Makefile.am
index 919e447..91b5714 100644
--- a/app/operations/Makefile.am
+++ b/app/operations/Makefile.am
@@ -99,10 +99,6 @@ libappoperations_a_SOURCES = \
        gimpoperationpointlayermode.h           \
        gimpoperationbehindmode.c               \
        gimpoperationbehindmode.h               \
-       gimpoperationdividemode.c               \
-       gimpoperationdividemode.h               \
-       gimpoperationburnmode.c                 \
-       gimpoperationburnmode.h                 \
        gimpoperationhardlightmode.c            \
        gimpoperationhardlightmode.h            \
        gimpoperationsoftlightmode.c            \
diff --git a/app/operations/gimp-operations.c b/app/operations/gimp-operations.c
index 883e69f..ac68c7a 100644
--- a/app/operations/gimp-operations.c
+++ b/app/operations/gimp-operations.c
@@ -92,10 +92,12 @@
 #include "layer-modes-legacy/gimpoperationhsvsaturationlegacy.h"
 #include "layer-modes-legacy/gimpoperationhsvcolorlegacy.h"
 #include "layer-modes-legacy/gimpoperationhsvvaluelegacy.h"
-#include "gimpoperationdividemode.h"
+#include "layer-modes/gimpoperationdivide.h"
+#include "layer-modes-legacy/gimpoperationdividelegacy.h"
 #include "layer-modes/gimpoperationdodge.h"
 #include "layer-modes-legacy/gimpoperationdodgelegacy.h"
-#include "gimpoperationburnmode.h"
+#include "layer-modes/gimpoperationburn.h"
+#include "layer-modes-legacy/gimpoperationburnlegacy.h"
 #include "gimpoperationhardlightmode.h"
 #include "gimpoperationsoftlightmode.h"
 #include "gimpoperationgrainextractmode.h"
@@ -168,10 +170,12 @@ gimp_operations_init (void)
   g_type_class_ref (GIMP_TYPE_OPERATION_HSV_SATURATION_LEGACY);
   g_type_class_ref (GIMP_TYPE_OPERATION_HSV_COLOR_LEGACY);
   g_type_class_ref (GIMP_TYPE_OPERATION_HSV_VALUE_LEGACY);
-  g_type_class_ref (GIMP_TYPE_OPERATION_DIVIDE_MODE);
+  g_type_class_ref (GIMP_TYPE_OPERATION_DIVIDE);
+  g_type_class_ref (GIMP_TYPE_OPERATION_DIVIDE_LEGACY);
   g_type_class_ref (GIMP_TYPE_OPERATION_DODGE);
   g_type_class_ref (GIMP_TYPE_OPERATION_DODGE_LEGACY);
-  g_type_class_ref (GIMP_TYPE_OPERATION_BURN_MODE);
+  g_type_class_ref (GIMP_TYPE_OPERATION_BURN);
+  g_type_class_ref (GIMP_TYPE_OPERATION_BURN_LEGACY);
   g_type_class_ref (GIMP_TYPE_OPERATION_HARDLIGHT_MODE);
   g_type_class_ref (GIMP_TYPE_OPERATION_SOFTLIGHT_MODE);
   g_type_class_ref (GIMP_TYPE_OPERATION_GRAIN_EXTRACT_MODE);
diff --git a/app/operations/gimplayermodefunctions.c b/app/operations/gimplayermodefunctions.c
index 7bd2dfc..22ddf5d 100644
--- a/app/operations/gimplayermodefunctions.c
+++ b/app/operations/gimplayermodefunctions.c
@@ -52,10 +52,12 @@
 #include "layer-modes-legacy/gimpoperationhsvcolorlegacy.h"
 #include "layer-modes/gimpoperationhsvvalue.h"
 #include "layer-modes-legacy/gimpoperationhsvvaluelegacy.h"
-#include "gimpoperationdividemode.h"
+#include "layer-modes/gimpoperationdivide.h"
+#include "layer-modes-legacy/gimpoperationdividelegacy.h"
 #include "layer-modes/gimpoperationdodge.h"
 #include "layer-modes-legacy/gimpoperationdodgelegacy.h"
-#include "gimpoperationburnmode.h"
+#include "layer-modes/gimpoperationburn.h"
+#include "layer-modes-legacy/gimpoperationburnlegacy.h"
 #include "gimpoperationhardlightmode.h"
 #include "gimpoperationsoftlightmode.h"
 #include "gimpoperationgrainextractmode.h"
@@ -182,8 +184,12 @@ get_layer_mode_function (GimpLayerMode  paint_mode,
       func = gimp_operation_hsv_value_legacy_process_pixels;
       break;
 
+    case GIMP_LAYER_MODE_DIVIDE:
+      func = gimp_operation_divide_process_pixels;
+      break;
+
     case GIMP_LAYER_MODE_DIVIDE_LEGACY:
-      func = gimp_operation_divide_mode_process_pixels;
+      func = gimp_operation_divide_legacy_process_pixels;
       break;
 
     case GIMP_LAYER_MODE_DODGE:
@@ -195,7 +201,11 @@ get_layer_mode_function (GimpLayerMode  paint_mode,
       break;
 
     case GIMP_LAYER_MODE_BURN_LEGACY:
-      func = gimp_operation_burn_mode_process_pixels;
+      func = gimp_operation_burn_legacy_process_pixels;
+      break;
+
+    case GIMP_LAYER_MODE_BURN:
+      func = gimp_operation_burn_process_pixels;
       break;
 
     case GIMP_LAYER_MODE_HARDLIGHT_LEGACY:
diff --git a/app/operations/layer-modes-legacy/Makefile.am b/app/operations/layer-modes-legacy/Makefile.am
index 7841850..7b530ff 100644
--- a/app/operations/layer-modes-legacy/Makefile.am
+++ b/app/operations/layer-modes-legacy/Makefile.am
@@ -38,4 +38,8 @@ libapplayermodeslegacy_a_SOURCES = \
        gimpoperationhsvcolorlegacy.c   \
        gimpoperationhsvcolorlegacy.h   \
        gimpoperationhsvvaluelegacy.c   \
-       gimpoperationhsvvaluelegacy.h
+       gimpoperationhsvvaluelegacy.h   \
+       gimpoperationdividelegacy.c     \
+       gimpoperationdividelegacy.h     \
+       gimpoperationburnlegacy.c       \
+       gimpoperationburnlegacy.h 
diff --git a/app/operations/gimpoperationdividemode.c 
b/app/operations/layer-modes-legacy/gimpoperationburnlegacy.c
similarity index 79%
copy from app/operations/gimpoperationdividemode.c
copy to app/operations/layer-modes-legacy/gimpoperationburnlegacy.c
index 5f93d30..d5dc65f 100644
--- a/app/operations/gimpoperationdividemode.c
+++ b/app/operations/layer-modes-legacy/gimpoperationburnlegacy.c
@@ -1,7 +1,7 @@
 /* GIMP - The GNU Image Manipulation Program
  * Copyright (C) 1995 Spencer Kimball and Peter Mattis
  *
- * gimpoperationdividemode.c
+ * gimpoperationburnmode.c
  * Copyright (C) 2008 Michael Natterer <mitch gimp org>
  *               2012 Ville Sokk <ville sokk gmail com>
  *
@@ -23,12 +23,12 @@
 
 #include <gegl-plugin.h>
 
-#include "operations-types.h"
+#include "../operations-types.h"
 
-#include "gimpoperationdividemode.h"
+#include "gimpoperationburnlegacy.h"
 
 
-static gboolean gimp_operation_divide_mode_process (GeglOperation       *operation,
+static gboolean gimp_operation_burn_legacy_process (GeglOperation       *operation,
                                                     void                *in_buf,
                                                     void                *aux_buf,
                                                     void                *aux2_buf,
@@ -38,12 +38,12 @@ static gboolean gimp_operation_divide_mode_process (GeglOperation       *operati
                                                     gint                 level);
 
 
-G_DEFINE_TYPE (GimpOperationDivideMode, gimp_operation_divide_mode,
+G_DEFINE_TYPE (GimpOperationBurnLegacy, gimp_operation_burn_legacy,
                GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
 
 
 static void
-gimp_operation_divide_mode_class_init (GimpOperationDivideModeClass *klass)
+gimp_operation_burn_legacy_class_init (GimpOperationBurnLegacyClass *klass)
 {
   GeglOperationClass               *operation_class;
   GeglOperationPointComposer3Class *point_class;
@@ -52,20 +52,20 @@ gimp_operation_divide_mode_class_init (GimpOperationDivideModeClass *klass)
   point_class     = GEGL_OPERATION_POINT_COMPOSER3_CLASS (klass);
 
   gegl_operation_class_set_keys (operation_class,
-                                 "name",        "gimp:divide-mode",
-                                 "description", "GIMP divide mode operation",
+                                 "name",        "gimp:burn-legacy",
+                                 "description", "GIMP burn mode operation",
                                  NULL);
 
-  point_class->process = gimp_operation_divide_mode_process;
+  point_class->process = gimp_operation_burn_legacy_process;
 }
 
 static void
-gimp_operation_divide_mode_init (GimpOperationDivideMode *self)
+gimp_operation_burn_legacy_init (GimpOperationBurnLegacy *self)
 {
 }
 
 static gboolean
-gimp_operation_divide_mode_process (GeglOperation       *operation,
+gimp_operation_burn_legacy_process (GeglOperation       *operation,
                                     void                *in_buf,
                                     void                *aux_buf,
                                     void                *aux2_buf,
@@ -76,11 +76,11 @@ gimp_operation_divide_mode_process (GeglOperation       *operation,
 {
   gfloat opacity = GIMP_OPERATION_POINT_LAYER_MODE (operation)->opacity;
 
-  return gimp_operation_divide_mode_process_pixels (in_buf, aux_buf, aux2_buf, out_buf, opacity, samples, 
roi, level);
+  return gimp_operation_burn_legacy_process_pixels (in_buf, aux_buf, aux2_buf, out_buf, opacity, samples, 
roi, level);
 }
 
 gboolean
-gimp_operation_divide_mode_process_pixels (gfloat              *in,
+gimp_operation_burn_legacy_process_pixels (gfloat              *in,
                                            gfloat              *layer,
                                            gfloat              *mask,
                                            gfloat              *out,
@@ -103,15 +103,18 @@ gimp_operation_divide_mode_process_pixels (gfloat              *in,
 
       if (comp_alpha && new_alpha)
         {
-          gint   b;
           gfloat ratio = comp_alpha / new_alpha;
+          gint   b;
 
           for (b = RED; b < ALPHA; b++)
             {
-              gfloat comp = (4294967296.0 / 4294967295.0 * in[b]) / (1.0 / 4294967295.0 + layer[b]);
+              gfloat comp = 1.0 - (1.0 - in[b]) / layer[b];
+              /* The CLAMP macro is deliberately inlined and
+               * written to map comp == NAN (0 / 0) -> 1
+               */
+              comp = comp < 0 ? 0.0 : comp < 1.0 ? comp : 1.0;
 
               out[b] = comp * ratio + in[b] * (1.0 - ratio);
-              out[b] = CLAMP (out[b], 0.0, 1.0);
             }
         }
       else
diff --git a/app/operations/gimpoperationdividemode.h 
b/app/operations/layer-modes-legacy/gimpoperationburnlegacy.h
similarity index 53%
rename from app/operations/gimpoperationdividemode.h
rename to app/operations/layer-modes-legacy/gimpoperationburnlegacy.h
index 0fb7d7f..0608ec0 100644
--- a/app/operations/gimpoperationdividemode.h
+++ b/app/operations/layer-modes-legacy/gimpoperationburnlegacy.h
@@ -1,7 +1,7 @@
 /* GIMP - The GNU Image Manipulation Program
  * Copyright (C) 1995 Spencer Kimball and Peter Mattis
  *
- * gimpoperationdividemode.h
+ * gimpoperationburnmode.h
  * Copyright (C) 2008 Michael Natterer <mitch gimp org>
  *
  * This program is free software: you can redistribute it and/or modify
@@ -18,38 +18,38 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef __GIMP_OPERATION_DIVIDE_MODE_H__
-#define __GIMP_OPERATION_DIVIDE_MODE_H__
+#ifndef __GIMP_OPERATION_BURN_LEGACY_H__
+#define __GIMP_OPERATION_BURN_LEGACY_H__
 
 
-#include "gimpoperationpointlayermode.h"
+#include "../gimpoperationpointlayermode.h"
 
 
-#define GIMP_TYPE_OPERATION_DIVIDE_MODE            (gimp_operation_divide_mode_get_type ())
-#define GIMP_OPERATION_DIVIDE_MODE(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), 
GIMP_TYPE_OPERATION_DIVIDE_MODE, GimpOperationDivideMode))
-#define GIMP_OPERATION_DIVIDE_MODE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass),  
GIMP_TYPE_OPERATION_DIVIDE_MODE, GimpOperationDivideModeClass))
-#define GIMP_IS_OPERATION_DIVIDE_MODE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), 
GIMP_TYPE_OPERATION_DIVIDE_MODE))
-#define GIMP_IS_OPERATION_DIVIDE_MODE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),  
GIMP_TYPE_OPERATION_DIVIDE_MODE))
-#define GIMP_OPERATION_DIVIDE_MODE_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),  
GIMP_TYPE_OPERATION_DIVIDE_MODE, GimpOperationDivideModeClass))
+#define GIMP_TYPE_OPERATION_BURN_LEGACY            (gimp_operation_burn_legacy_get_type ())
+#define GIMP_OPERATION_BURN_LEGACY(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), 
GIMP_TYPE_OPERATION_BURN_LEGACY, GimpOperationBurnLegacy))
+#define GIMP_OPERATION_BURN_LEGACY_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass),  
GIMP_TYPE_OPERATION_BURN_LEGACY, GimpOperationBurnLegacyClass))
+#define GIMP_IS_OPERATION_BURN_LEGACY(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), 
GIMP_TYPE_OPERATION_BURN_LEGACY))
+#define GIMP_IS_OPERATION_BURN_LEGACY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),  
GIMP_TYPE_OPERATION_BURN_LEGACY))
+#define GIMP_OPERATION_BURN_LEGACY_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),  
GIMP_TYPE_OPERATION_BURN_LEGACY, GimpOperationBurnLegacyClass))
 
 
-typedef struct _GimpOperationDivideMode      GimpOperationDivideMode;
-typedef struct _GimpOperationDivideModeClass GimpOperationDivideModeClass;
+typedef struct _GimpOperationBurnLegacy      GimpOperationBurnLegacy;
+typedef struct _GimpOperationBurnLegacyClass GimpOperationBurnLegacyClass;
 
-struct _GimpOperationDivideMode
+struct _GimpOperationBurnLegacy
 {
   GimpOperationPointLayerMode  parent_instance;
 };
 
-struct _GimpOperationDivideModeClass
+struct _GimpOperationBurnLegacyClass
 {
   GimpOperationPointLayerModeClass  parent_class;
 };
 
 
-GType   gimp_operation_divide_mode_get_type (void) G_GNUC_CONST;
+GType   gimp_operation_burn_legacy_get_type (void) G_GNUC_CONST;
 
-gboolean gimp_operation_divide_mode_process_pixels (gfloat              *in,
+gboolean gimp_operation_burn_legacy_process_pixels (gfloat              *in,
                                                     gfloat              *layer,
                                                     gfloat              *mask,
                                                     gfloat              *out,
@@ -58,4 +58,4 @@ gboolean gimp_operation_divide_mode_process_pixels (gfloat              *in,
                                                     const GeglRectangle *roi,
                                                     gint                 level);
 
-#endif /* __GIMP_OPERATION_DIVIDE_MODE_H__ */
+#endif /* __GIMP_OPERATION_BURN_LEGACY_H__ */
diff --git a/app/operations/gimpoperationdividemode.c 
b/app/operations/layer-modes-legacy/gimpoperationdividelegacy.c
similarity index 51%
rename from app/operations/gimpoperationdividemode.c
rename to app/operations/layer-modes-legacy/gimpoperationdividelegacy.c
index 5f93d30..50bfac7 100644
--- a/app/operations/gimpoperationdividemode.c
+++ b/app/operations/layer-modes-legacy/gimpoperationdividelegacy.c
@@ -23,27 +23,27 @@
 
 #include <gegl-plugin.h>
 
-#include "operations-types.h"
+#include "../operations-types.h"
 
-#include "gimpoperationdividemode.h"
+#include "gimpoperationdividelegacy.h"
 
 
-static gboolean gimp_operation_divide_mode_process (GeglOperation       *operation,
-                                                    void                *in_buf,
-                                                    void                *aux_buf,
-                                                    void                *aux2_buf,
-                                                    void                *out_buf,
-                                                    glong                samples,
-                                                    const GeglRectangle *roi,
-                                                    gint                 level);
+static gboolean gimp_operation_divide_legacy_process (GeglOperation       *operation,
+                                                      void                *in_buf,
+                                                      void                *aux_buf,
+                                                      void                *aux2_buf,
+                                                      void                *out_buf,
+                                                      glong                samples,
+                                                      const GeglRectangle *roi,
+                                                      gint                 level);
 
 
-G_DEFINE_TYPE (GimpOperationDivideMode, gimp_operation_divide_mode,
+G_DEFINE_TYPE (GimpOperationDivideLegacy, gimp_operation_divide_legacy,
                GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
 
 
 static void
-gimp_operation_divide_mode_class_init (GimpOperationDivideModeClass *klass)
+gimp_operation_divide_legacy_class_init (GimpOperationDivideLegacyClass *klass)
 {
   GeglOperationClass               *operation_class;
   GeglOperationPointComposer3Class *point_class;
@@ -52,42 +52,42 @@ gimp_operation_divide_mode_class_init (GimpOperationDivideModeClass *klass)
   point_class     = GEGL_OPERATION_POINT_COMPOSER3_CLASS (klass);
 
   gegl_operation_class_set_keys (operation_class,
-                                 "name",        "gimp:divide-mode",
+                                 "name",        "gimp:divide-legacy",
                                  "description", "GIMP divide mode operation",
                                  NULL);
 
-  point_class->process = gimp_operation_divide_mode_process;
+  point_class->process = gimp_operation_divide_legacy_process;
 }
 
 static void
-gimp_operation_divide_mode_init (GimpOperationDivideMode *self)
+gimp_operation_divide_legacy_init (GimpOperationDivideLegacy *self)
 {
 }
 
 static gboolean
-gimp_operation_divide_mode_process (GeglOperation       *operation,
-                                    void                *in_buf,
-                                    void                *aux_buf,
-                                    void                *aux2_buf,
-                                    void                *out_buf,
-                                    glong                samples,
-                                    const GeglRectangle *roi,
-                                    gint                 level)
+gimp_operation_divide_legacy_process (GeglOperation       *operation,
+                                      void                *in_buf,
+                                      void                *aux_buf,
+                                      void                *aux2_buf,
+                                      void                *out_buf,
+                                      glong                samples,
+                                      const GeglRectangle *roi,
+                                      gint                 level)
 {
   gfloat opacity = GIMP_OPERATION_POINT_LAYER_MODE (operation)->opacity;
 
-  return gimp_operation_divide_mode_process_pixels (in_buf, aux_buf, aux2_buf, out_buf, opacity, samples, 
roi, level);
+  return gimp_operation_divide_legacy_process_pixels (in_buf, aux_buf, aux2_buf, out_buf, opacity, samples, 
roi, level);
 }
 
 gboolean
-gimp_operation_divide_mode_process_pixels (gfloat              *in,
-                                           gfloat              *layer,
-                                           gfloat              *mask,
-                                           gfloat              *out,
-                                           gfloat               opacity,
-                                           glong                samples,
-                                           const GeglRectangle *roi,
-                                           gint                 level)
+gimp_operation_divide_legacy_process_pixels (gfloat              *in,
+                                             gfloat              *layer,
+                                             gfloat              *mask,
+                                             gfloat              *out,
+                                             gfloat               opacity,
+                                             glong                samples,
+                                             const GeglRectangle *roi,
+                                             gint                 level)
 {
   const gboolean has_mask = mask != NULL;
 
diff --git a/app/operations/layer-modes-legacy/gimpoperationdividelegacy.h 
b/app/operations/layer-modes-legacy/gimpoperationdividelegacy.h
new file mode 100644
index 0000000..da9fcdd
--- /dev/null
+++ b/app/operations/layer-modes-legacy/gimpoperationdividelegacy.h
@@ -0,0 +1,61 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * gimpoperationdividemode.h
+ * Copyright (C) 2008 Michael Natterer <mitch gimp org>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __GIMP_OPERATION_DIVIDE_LEGACY_H__
+#define __GIMP_OPERATION_DIVIDE_LEGACY_H__
+
+
+#include "../gimpoperationpointlayermode.h"
+
+
+#define GIMP_TYPE_OPERATION_DIVIDE_LEGACY            (gimp_operation_divide_legacy_get_type ())
+#define GIMP_OPERATION_DIVIDE_LEGACY(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), 
GIMP_TYPE_OPERATION_DIVIDE_LEGACY, GimpOperationDivideLegacy))
+#define GIMP_OPERATION_DIVIDE_LEGACY_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass),  
GIMP_TYPE_OPERATION_DIVIDE_LEGACY, GimpOperationDivideLegacyClass))
+#define GIMP_IS_OPERATION_DIVIDE_LEGACY(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), 
GIMP_TYPE_OPERATION_DIVIDE_LEGACY))
+#define GIMP_IS_OPERATION_DIVIDE_LEGACY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),  
GIMP_TYPE_OPERATION_DIVIDE_LEGACY))
+#define GIMP_OPERATION_DIVIDE_LEGACY_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),  
GIMP_TYPE_OPERATION_DIVIDE_LEGACY, GimpOperationDivideLegacyClass))
+
+
+typedef struct _GimpOperationDivideLegacy      GimpOperationDivideLegacy;
+typedef struct _GimpOperationDivideLegacyClass GimpOperationDivideLegacyClass;
+
+struct _GimpOperationDivideLegacy
+{
+  GimpOperationPointLayerMode  parent_instance;
+};
+
+struct _GimpOperationDivideLegacyClass
+{
+  GimpOperationPointLayerModeClass  parent_class;
+};
+
+
+GType   gimp_operation_divide_legacy_get_type (void) G_GNUC_CONST;
+
+gboolean gimp_operation_divide_legacy_process_pixels (gfloat              *in,
+                                                      gfloat              *layer,
+                                                      gfloat              *mask,
+                                                      gfloat              *out,
+                                                      gfloat               opacity,
+                                                      glong                samples,
+                                                      const GeglRectangle *roi,
+                                                      gint                 level);
+
+#endif /* __GIMP_OPERATION_DIVIDE_LEGACY_H__ */
diff --git a/app/operations/layer-modes/Makefile.am b/app/operations/layer-modes/Makefile.am
index 272d2e7..1710f13 100644
--- a/app/operations/layer-modes/Makefile.am
+++ b/app/operations/layer-modes/Makefile.am
@@ -59,7 +59,12 @@ libapplayermodes_generic_a_sources = \
        gimpoperationerase.c            \
        gimpoperationerase.h            \
        gimpoperationantierase.c        \
-       gimpoperationantierase.h
+       gimpoperationantierase.h        \
+       gimpoperationhsvvalue.h         \
+       gimpoperationdivide.c           \
+       gimpoperationdivide.h           \
+       gimpoperationburn.c             \
+       gimpoperationburn.h 
 
 libapplayermodes_sse2_a_sources = \
        gimpoperationnormal-sse2.c
diff --git a/app/operations/layer-modes/gimpoperationburn.c b/app/operations/layer-modes/gimpoperationburn.c
new file mode 100644
index 0000000..d35737e
--- /dev/null
+++ b/app/operations/layer-modes/gimpoperationburn.c
@@ -0,0 +1,139 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * gimpoperationburnmode.c
+ * Copyright (C) 2008 Michael Natterer <mitch gimp org>
+ *               2012 Ville Sokk <ville sokk gmail com>
+ *               2017 Øyvind Kolås <pippin gimp org>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "config.h"
+
+#include <gegl-plugin.h>
+
+#include "../operations-types.h"
+
+#include "gimpoperationburn.h"
+
+
+static gboolean gimp_operation_burn_process (GeglOperation       *operation,
+                                             void                *in_buf,
+                                             void                *aux_buf,
+                                             void                *aux2_buf,
+                                             void                *out_buf,
+                                             glong                samples,
+                                             const GeglRectangle *roi,
+                                             gint                 level);
+
+
+G_DEFINE_TYPE (GimpOperationBurn, gimp_operation_burn,
+               GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
+
+
+static void
+gimp_operation_burn_class_init (GimpOperationBurnClass *klass)
+{
+  GeglOperationClass               *operation_class;
+  GeglOperationPointComposer3Class *point_class;
+
+  operation_class = GEGL_OPERATION_CLASS (klass);
+  point_class     = GEGL_OPERATION_POINT_COMPOSER3_CLASS (klass);
+
+  gegl_operation_class_set_keys (operation_class,
+                                 "name",        "gimp:burn",
+                                 "description", "GIMP burn mode operation",
+                                 NULL);
+
+  point_class->process = gimp_operation_burn_process;
+}
+
+static void
+gimp_operation_burn_init (GimpOperationBurn *self)
+{
+}
+
+static gboolean
+gimp_operation_burn_process (GeglOperation       *operation,
+                             void                *in_buf,
+                             void                *aux_buf,
+                             void                *aux2_buf,
+                             void                *out_buf,
+                             glong                samples,
+                             const GeglRectangle *roi,
+                             gint                 level)
+{
+  gfloat opacity = GIMP_OPERATION_POINT_LAYER_MODE (operation)->opacity;
+
+  return gimp_operation_burn_process_pixels (in_buf, aux_buf, aux2_buf, out_buf, opacity, samples, roi, 
level);
+}
+
+gboolean
+gimp_operation_burn_process_pixels (gfloat              *in,
+                                    gfloat              *layer,
+                                    gfloat              *mask,
+                                    gfloat              *out,
+                                    gfloat               opacity,
+                                    glong                samples,
+                                    const GeglRectangle *roi,
+                                    gint                 level)
+{
+  const gboolean has_mask = mask != NULL;
+
+  while (samples--)
+    {
+      gfloat comp_alpha;
+
+      comp_alpha = layer[ALPHA] * opacity;
+      if (has_mask)
+        comp_alpha *= *mask;
+
+      if (comp_alpha != 0.0)
+        {
+          gint   b;
+
+          for (b = RED; b < ALPHA; b++)
+            {
+              gfloat comp = 1.0 - (1.0 - in[b]) / layer[b];
+              /* The CLAMP macro is deliberately inlined and
+               * written to map comp == NAN (0 / 0) -> 1
+               */
+              comp = comp < 0 ? 0.0 : comp < 1.0 ? comp : 1.0;
+
+              out[b] = comp * comp_alpha + in[b] * (1.0 - comp_alpha);
+            }
+        }
+      else
+        {
+          gint b;
+
+          for (b = RED; b < ALPHA; b++)
+            {
+              out[b] = in[b];
+            }
+        }
+
+      out[ALPHA] = in[ALPHA];
+
+      in    += 4;
+      layer += 4;
+      out   += 4;
+
+      if (has_mask)
+        mask++;
+    }
+
+  return TRUE;
+}
diff --git a/app/operations/layer-modes/gimpoperationburn.h b/app/operations/layer-modes/gimpoperationburn.h
new file mode 100644
index 0000000..ca42565
--- /dev/null
+++ b/app/operations/layer-modes/gimpoperationburn.h
@@ -0,0 +1,62 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * gimpoperationburnmode.h
+ * Copyright (C) 2008 Michael Natterer <mitch gimp org>
+ *               2017 Øyvind Kolås <pippin gimp org>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __GIMP_OPERATION_BURN_H__
+#define __GIMP_OPERATION_BURN_H__
+
+
+#include "../gimpoperationpointlayermode.h"
+
+
+#define GIMP_TYPE_OPERATION_BURN            (gimp_operation_burn_get_type ())
+#define GIMP_OPERATION_BURN(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_OPERATION_BURN, 
GimpOperationBurn))
+#define GIMP_OPERATION_BURN_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass),  GIMP_TYPE_OPERATION_BURN, 
GimpOperationBurnClass))
+#define GIMP_IS_OPERATION_BURN(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_OPERATION_BURN))
+#define GIMP_IS_OPERATION_BURN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),  GIMP_TYPE_OPERATION_BURN))
+#define GIMP_OPERATION_BURN_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),  GIMP_TYPE_OPERATION_BURN, 
GimpOperationBurnClass))
+
+
+typedef struct _GimpOperationBurn      GimpOperationBurn;
+typedef struct _GimpOperationBurnClass GimpOperationBurnClass;
+
+struct _GimpOperationBurn
+{
+  GimpOperationPointLayerMode  parent_instance;
+};
+
+struct _GimpOperationBurnClass
+{
+  GimpOperationPointLayerModeClass  parent_class;
+};
+
+
+GType   gimp_operation_burn_get_type (void) G_GNUC_CONST;
+
+gboolean gimp_operation_burn_process_pixels (gfloat              *in,
+                                             gfloat              *layer,
+                                             gfloat              *mask,
+                                             gfloat              *out,
+                                             gfloat               opacity,
+                                             glong                samples,
+                                             const GeglRectangle *roi,
+                                             gint                 level);
+
+#endif /* __GIMP_OPERATION_BURN_H__ */
diff --git a/app/operations/layer-modes/gimpoperationdivide.c 
b/app/operations/layer-modes/gimpoperationdivide.c
new file mode 100644
index 0000000..7ff6fca
--- /dev/null
+++ b/app/operations/layer-modes/gimpoperationdivide.c
@@ -0,0 +1,136 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * gimpoperationdividemode.c
+ * Copyright (C) 2008 Michael Natterer <mitch gimp org>
+ *               2012 Ville Sokk <ville sokk gmail com>
+ *               2017 Øyvind Kolås <pippin gimp org>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "config.h"
+
+#include <gegl-plugin.h>
+
+#include "../operations-types.h"
+
+#include "gimpoperationdivide.h"
+
+
+static gboolean gimp_operation_divide_process (GeglOperation       *operation,
+                                               void                *in_buf,
+                                               void                *aux_buf,
+                                               void                *aux2_buf,
+                                               void                *out_buf,
+                                               glong                samples,
+                                               const GeglRectangle *roi,
+                                               gint                 level);
+
+
+G_DEFINE_TYPE (GimpOperationDivide, gimp_operation_divide,
+               GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
+
+
+static void
+gimp_operation_divide_class_init (GimpOperationDivideClass *klass)
+{
+  GeglOperationClass               *operation_class;
+  GeglOperationPointComposer3Class *point_class;
+
+  operation_class = GEGL_OPERATION_CLASS (klass);
+  point_class     = GEGL_OPERATION_POINT_COMPOSER3_CLASS (klass);
+
+  gegl_operation_class_set_keys (operation_class,
+                                 "name",        "gimp:divide",
+                                 "description", "GIMP divide mode operation",
+                                 NULL);
+
+  point_class->process = gimp_operation_divide_process;
+}
+
+static void
+gimp_operation_divide_init (GimpOperationDivide *self)
+{
+}
+
+static gboolean
+gimp_operation_divide_process (GeglOperation       *operation,
+                               void                *in_buf,
+                               void                *aux_buf,
+                               void                *aux2_buf,
+                               void                *out_buf,
+                               glong                samples,
+                               const GeglRectangle *roi,
+                               gint                 level)
+{
+  gfloat opacity = GIMP_OPERATION_POINT_LAYER_MODE (operation)->opacity;
+
+  return gimp_operation_divide_process_pixels (in_buf, aux_buf, aux2_buf, out_buf, opacity, samples, roi, 
level);
+}
+
+gboolean
+gimp_operation_divide_process_pixels (gfloat              *in,
+                                      gfloat              *layer,
+                                      gfloat              *mask,
+                                      gfloat              *out,
+                                      gfloat               opacity,
+                                      glong                samples,
+                                      const GeglRectangle *roi,
+                                      gint                 level)
+{
+  const gboolean has_mask = mask != NULL;
+
+  while (samples--)
+    {
+      gfloat comp_alpha;
+
+      comp_alpha = layer[ALPHA] * opacity;
+      if (has_mask)
+        comp_alpha *= *mask;
+
+      if (comp_alpha != 0.0f)
+        {
+          gint   b;
+
+          for (b = RED; b < ALPHA; b++)
+            {
+              gfloat comp = (4294967296.0 / 4294967295.0 * in[b]) / (1.0 / 4294967295.0 + layer[b]);
+
+              out[b] = comp * comp_alpha + in[b] * (1.0 - comp_alpha);
+              out[b] = CLAMP (out[b], 0.0, 1.0);
+            }
+        }
+      else
+        {
+          gint b;
+
+          for (b = RED; b < ALPHA; b++)
+            {
+              out[b] = in[b];
+            }
+        }
+
+      out[ALPHA] = in[ALPHA];
+
+      in    += 4;
+      layer += 4;
+      out   += 4;
+
+      if (has_mask)
+        mask++;
+    }
+
+  return TRUE;
+}
diff --git a/app/operations/layer-modes/gimpoperationdivide.h 
b/app/operations/layer-modes/gimpoperationdivide.h
new file mode 100644
index 0000000..9eb3f9b
--- /dev/null
+++ b/app/operations/layer-modes/gimpoperationdivide.h
@@ -0,0 +1,62 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * gimpoperationdividemode.h
+ * Copyright (C) 2008 Michael Natterer <mitch gimp org>
+ *               2017 Øyvind Kolås <pippin gimp org>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __GIMP_OPERATION_DIVIDE_H__
+#define __GIMP_OPERATION_DIVIDE_H__
+
+
+#include "../gimpoperationpointlayermode.h"
+
+
+#define GIMP_TYPE_OPERATION_DIVIDE            (gimp_operation_divide_get_type ())
+#define GIMP_OPERATION_DIVIDE(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), 
GIMP_TYPE_OPERATION_DIVIDE, GimpOperationDivide))
+#define GIMP_OPERATION_DIVIDE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass),  
GIMP_TYPE_OPERATION_DIVIDE, GimpOperationDivideClass))
+#define GIMP_IS_OPERATION_DIVIDE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), 
GIMP_TYPE_OPERATION_DIVIDE))
+#define GIMP_IS_OPERATION_DIVIDE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),  
GIMP_TYPE_OPERATION_DIVIDE))
+#define GIMP_OPERATION_DIVIDE_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),  
GIMP_TYPE_OPERATION_DIVIDE, GimpOperationDivideClass))
+
+
+typedef struct _GimpOperationDivide      GimpOperationDivide;
+typedef struct _GimpOperationDivideClass GimpOperationDivideClass;
+
+struct _GimpOperationDivide
+{
+  GimpOperationPointLayerMode  parent_instance;
+};
+
+struct _GimpOperationDivideClass
+{
+  GimpOperationPointLayerModeClass  parent_class;
+};
+
+
+GType   gimp_operation_divide_get_type (void) G_GNUC_CONST;
+
+gboolean gimp_operation_divide_process_pixels (gfloat              *in,
+                                               gfloat              *layer,
+                                               gfloat              *mask,
+                                               gfloat              *out,
+                                               gfloat               opacity,
+                                               glong                samples,
+                                               const GeglRectangle *roi,
+                                               gint                 level);
+
+#endif /* __GIMP_OPERATION_DIVIDE_H__ */
diff --git a/app/operations/layer-modes/gimpoperationmultiply.c 
b/app/operations/layer-modes/gimpoperationmultiply.c
index 53e2590..d313754 100644
--- a/app/operations/layer-modes/gimpoperationmultiply.c
+++ b/app/operations/layer-modes/gimpoperationmultiply.c
@@ -53,7 +53,7 @@ gimp_operation_multiply_class_init (GimpOperationMultiplyClass *klass)
   point_class     = GEGL_OPERATION_POINT_COMPOSER3_CLASS (klass);
 
   gegl_operation_class_set_keys (operation_class,
-                                 "name",        "gimp:multiply-mode",
+                                 "name",        "gimp:multiply",
                                  "description", "GIMP multiply mode operation",
                                  NULL);
 
diff --git a/app/widgets/gimpwidgets-constructors.c b/app/widgets/gimpwidgets-constructors.c
index 07d46f8..1588656 100644
--- a/app/widgets/gimpwidgets-constructors.c
+++ b/app/widgets/gimpwidgets-constructors.c
@@ -104,7 +104,7 @@ gimp_paint_mode_menu_new (gboolean with_behind_mode,
   GtkWidget    *combo;
 
   store = gimp_enum_store_new_with_values (GIMP_TYPE_LAYER_MODE,
-                                           39,
+                                           41,
                                            GIMP_LAYER_MODE_NORMAL,
                                            GIMP_LAYER_MODE_NORMAL_NON_LINEAR,
                                            GIMP_LAYER_MODE_DISSOLVE,
@@ -121,6 +121,7 @@ gimp_paint_mode_menu_new (gboolean with_behind_mode,
                                            GIMP_LAYER_MODE_MULTIPLY,
                                            GIMP_LAYER_MODE_MULTIPLY_LINEAR,
                                            GIMP_LAYER_MODE_MULTIPLY_LEGACY,
+                                           GIMP_LAYER_MODE_BURN,
                                            GIMP_LAYER_MODE_BURN_LEGACY,
                                            GIMP_LAYER_MODE_OVERLAY,
                                            GIMP_LAYER_MODE_SOFTLIGHT_LEGACY,
@@ -131,6 +132,7 @@ gimp_paint_mode_menu_new (gboolean with_behind_mode,
                                            GIMP_LAYER_MODE_SUBTRACT_LEGACY,
                                            GIMP_LAYER_MODE_GRAIN_EXTRACT_LEGACY,
                                            GIMP_LAYER_MODE_GRAIN_MERGE_LEGACY,
+                                           GIMP_LAYER_MODE_DIVIDE,
                                            GIMP_LAYER_MODE_DIVIDE_LEGACY,
                                            GIMP_LAYER_MODE_HSV_HUE,
                                            GIMP_LAYER_MODE_HSV_SATURATION,
diff --git a/libgimp/gimpenums.h b/libgimp/gimpenums.h
index 80d8ee0..6190261 100644
--- a/libgimp/gimpenums.h
+++ b/libgimp/gimpenums.h
@@ -110,7 +110,9 @@ typedef enum
   GIMP_LAYER_MODE_HSV_HUE,
   GIMP_LAYER_MODE_HSV_SATURATION,
   GIMP_LAYER_MODE_HSV_COLOR,
-  GIMP_LAYER_MODE_HSV_VALUE
+  GIMP_LAYER_MODE_HSV_VALUE,
+  GIMP_LAYER_MODE_DIVIDE,
+  GIMP_LAYER_MODE_BURN
 } GimpLayerMode;
 
 
diff --git a/tools/pdbgen/enums.pl b/tools/pdbgen/enums.pl
index d73306e..28ed6a0 100644
--- a/tools/pdbgen/enums.pl
+++ b/tools/pdbgen/enums.pl
@@ -731,7 +731,8 @@ package Gimp::CodeGen::enums;
                          GIMP_LAYER_MODE_HSV_HUE
                          GIMP_LAYER_MODE_HSV_SATURATION
                          GIMP_LAYER_MODE_HSV_COLOR
-                         GIMP_LAYER_MODE_HSV_VALUE) ],
+                         GIMP_LAYER_MODE_HSV_VALUE GIMP_LAYER_MODE_DIVIDE
+                         GIMP_LAYER_MODE_BURN) ],
          mapping => { GIMP_LAYER_MODE_NORMAL_NON_LINEAR => '0',
                       GIMP_LAYER_MODE_DISSOLVE => '1',
                       GIMP_LAYER_MODE_BEHIND => '2',
@@ -773,7 +774,9 @@ package Gimp::CodeGen::enums;
                       GIMP_LAYER_MODE_HSV_HUE => '38',
                       GIMP_LAYER_MODE_HSV_SATURATION => '39',
                       GIMP_LAYER_MODE_HSV_COLOR => '40',
-                      GIMP_LAYER_MODE_HSV_VALUE => '41' }
+                      GIMP_LAYER_MODE_HSV_VALUE => '41',
+                      GIMP_LAYER_MODE_DIVIDE => '42',
+                      GIMP_LAYER_MODE_BURN => '43' }
        },
     GimpBrushApplicationMode =>
        { contig => 1,


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