2017-02-05 15:59:29 +01:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
|
|
|
* gimp-layer-modes.c
|
|
|
|
* Copyright (C) 2017 Michael Natterer <mitch@gimp.org>
|
|
|
|
* Ø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 <glib-object.h>
|
|
|
|
|
|
|
|
#include "../operations-types.h"
|
|
|
|
|
2017-02-15 02:25:44 +01:00
|
|
|
#include "operations/layer-modes-legacy/gimpoperationadditionlegacy.h"
|
|
|
|
#include "operations/layer-modes-legacy/gimpoperationburnlegacy.h"
|
|
|
|
#include "operations/layer-modes-legacy/gimpoperationdarkenonlylegacy.h"
|
|
|
|
#include "operations/layer-modes-legacy/gimpoperationdifferencelegacy.h"
|
|
|
|
#include "operations/layer-modes-legacy/gimpoperationdividelegacy.h"
|
|
|
|
#include "operations/layer-modes-legacy/gimpoperationdodgelegacy.h"
|
|
|
|
#include "operations/layer-modes-legacy/gimpoperationgrainextractlegacy.h"
|
|
|
|
#include "operations/layer-modes-legacy/gimpoperationgrainmergelegacy.h"
|
|
|
|
#include "operations/layer-modes-legacy/gimpoperationhardlightlegacy.h"
|
2017-03-16 06:17:05 -04:00
|
|
|
#include "operations/layer-modes-legacy/gimpoperationhslcolorlegacy.h"
|
2017-02-15 02:25:44 +01:00
|
|
|
#include "operations/layer-modes-legacy/gimpoperationhsvhuelegacy.h"
|
|
|
|
#include "operations/layer-modes-legacy/gimpoperationhsvsaturationlegacy.h"
|
|
|
|
#include "operations/layer-modes-legacy/gimpoperationhsvvaluelegacy.h"
|
|
|
|
#include "operations/layer-modes-legacy/gimpoperationlightenonlylegacy.h"
|
|
|
|
#include "operations/layer-modes-legacy/gimpoperationmultiplylegacy.h"
|
|
|
|
#include "operations/layer-modes-legacy/gimpoperationscreenlegacy.h"
|
|
|
|
#include "operations/layer-modes-legacy/gimpoperationsoftlightlegacy.h"
|
|
|
|
#include "operations/layer-modes-legacy/gimpoperationsubtractlegacy.h"
|
|
|
|
|
|
|
|
#include "gimpoperationantierase.h"
|
|
|
|
#include "gimpoperationbehind.h"
|
|
|
|
#include "gimpoperationdissolve.h"
|
|
|
|
#include "gimpoperationerase.h"
|
2017-03-10 17:59:17 -05:00
|
|
|
#include "gimpoperationmerge.h"
|
2017-02-15 02:25:44 +01:00
|
|
|
#include "gimpoperationnormal.h"
|
|
|
|
#include "gimpoperationreplace.h"
|
2017-03-10 18:28:40 -05:00
|
|
|
#include "gimpoperationsplit.h"
|
2017-02-15 02:25:44 +01:00
|
|
|
|
2017-02-05 15:59:29 +01:00
|
|
|
#include "gimp-layer-modes.h"
|
|
|
|
|
|
|
|
|
2017-02-05 16:06:53 +01:00
|
|
|
typedef struct _GimpLayerModeInfo GimpLayerModeInfo;
|
|
|
|
|
|
|
|
struct _GimpLayerModeInfo
|
|
|
|
{
|
app: move bottom-layer special casing to GimpOperationLayerMode
GimpFilter's is_last_node field only reflects the item's position
within the parent stack. When a layer is contained in a pass-
through group, it can be the last layer of the group, while not
being the last layer in the graph as a whole (paticularly, if
there are visible layers below the group). In fact, when we have
nested pass-through groups, whether or not a layer is the last
node depends on which group we're considering as the root (since
we exclude the backdrop from the group's projection, resulting in
different graphs for different groups).
Instead of rolling our own graph traversal, just move the relevant
logic to GimpOperationLayerMode, and let GEGL do the work for us.
At processing time, we can tell if we're the last node by checking
if we have any input.
For this to work, GimpOperationLayerMode's process() function needs
to have control over what's going on. Replace the derived op
classes, which override process(), with a call to the layer mode's
function (as per gimp_layer_mode_get_function()) in
GimpOperationLayerMode's process() function. (Well, actually, this
commit keeps the ops around, and just hacks around them in
gimp_layer_mode_get_operation(), because laziness :P)
Keep using the layer's is_last_node property to do the invalidation.
2017-04-21 19:42:04 -04:00
|
|
|
GimpLayerMode layer_mode;
|
|
|
|
const gchar *op_name;
|
|
|
|
GimpLayerModeFunc function;
|
|
|
|
GimpLayerModeFlags flags;
|
|
|
|
GimpLayerModeContext context;
|
|
|
|
GimpLayerCompositeMode paint_composite_mode;
|
|
|
|
GimpLayerCompositeMode composite_mode;
|
|
|
|
GimpLayerColorSpace composite_space;
|
|
|
|
GimpLayerColorSpace blend_space;
|
|
|
|
GimpLayerCompositeRegion affected_region;
|
2017-02-05 16:06:53 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2017-02-05 15:59:29 +01:00
|
|
|
/* static variables */
|
|
|
|
|
2017-02-15 02:25:44 +01:00
|
|
|
static const GimpLayerModeInfo layer_mode_infos[] =
|
2017-02-05 15:59:29 +01:00
|
|
|
{
|
2017-02-26 16:26:34 +01:00
|
|
|
{ GIMP_LAYER_MODE_NORMAL_LEGACY,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
|
|
|
.op_name = "gimp:normal",
|
|
|
|
.function = gimp_operation_normal_process,
|
2017-03-08 13:16:37 -05:00
|
|
|
.flags = GIMP_LAYER_MODE_FLAG_LEGACY |
|
|
|
|
GIMP_LAYER_MODE_FLAG_BLEND_SPACE_IMMUTABLE |
|
2017-02-26 16:26:34 +01:00
|
|
|
GIMP_LAYER_MODE_FLAG_COMPOSITE_SPACE_IMMUTABLE |
|
|
|
|
GIMP_LAYER_MODE_FLAG_COMPOSITE_MODE_IMMUTABLE,
|
2017-02-17 03:49:29 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_OVER,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_OVER,
|
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
{ GIMP_LAYER_MODE_DISSOLVE,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
|
|
|
.op_name = "gimp:dissolve",
|
|
|
|
.function = gimp_operation_dissolve_process,
|
2017-02-17 10:20:04 -05:00
|
|
|
.flags = GIMP_LAYER_MODE_FLAG_BLEND_SPACE_IMMUTABLE |
|
2017-02-16 20:25:57 -05:00
|
|
|
GIMP_LAYER_MODE_FLAG_COMPOSITE_SPACE_IMMUTABLE,
|
2017-02-17 03:49:29 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_OVER,
|
app: move bottom-layer special casing to GimpOperationLayerMode
GimpFilter's is_last_node field only reflects the item's position
within the parent stack. When a layer is contained in a pass-
through group, it can be the last layer of the group, while not
being the last layer in the graph as a whole (paticularly, if
there are visible layers below the group). In fact, when we have
nested pass-through groups, whether or not a layer is the last
node depends on which group we're considering as the root (since
we exclude the backdrop from the group's projection, resulting in
different graphs for different groups).
Instead of rolling our own graph traversal, just move the relevant
logic to GimpOperationLayerMode, and let GEGL do the work for us.
At processing time, we can tell if we're the last node by checking
if we have any input.
For this to work, GimpOperationLayerMode's process() function needs
to have control over what's going on. Replace the derived op
classes, which override process(), with a call to the layer mode's
function (as per gimp_layer_mode_get_function()) in
GimpOperationLayerMode's process() function. (Well, actually, this
commit keeps the ops around, and just hacks around them in
gimp_layer_mode_get_operation(), because laziness :P)
Keep using the layer's is_last_node property to do the invalidation.
2017-04-21 19:42:04 -04:00
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_OVER,
|
|
|
|
.affected_region = GIMP_LAYER_COMPOSITE_REGION_SOURCE
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
2017-02-19 23:14:44 +01:00
|
|
|
{ GIMP_LAYER_MODE_BEHIND_LEGACY,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
|
|
|
.op_name = "gimp:behind",
|
|
|
|
.function = gimp_operation_behind_process,
|
2017-02-19 23:14:44 +01:00
|
|
|
.flags = GIMP_LAYER_MODE_FLAG_LEGACY |
|
|
|
|
GIMP_LAYER_MODE_FLAG_BLEND_SPACE_IMMUTABLE |
|
|
|
|
GIMP_LAYER_MODE_FLAG_COMPOSITE_SPACE_IMMUTABLE |
|
|
|
|
GIMP_LAYER_MODE_FLAG_COMPOSITE_MODE_IMMUTABLE,
|
2017-02-17 03:49:29 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_PAINT |
|
|
|
|
GIMP_LAYER_MODE_CONTEXT_FADE,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_OVER,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_OVER,
|
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
{ GIMP_LAYER_MODE_MULTIPLY_LEGACY,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
|
|
|
.op_name = "gimp:multiply-legacy",
|
|
|
|
.function = gimp_operation_multiply_legacy_process,
|
|
|
|
.flags = GIMP_LAYER_MODE_FLAG_LEGACY |
|
|
|
|
GIMP_LAYER_MODE_FLAG_BLEND_SPACE_IMMUTABLE |
|
|
|
|
GIMP_LAYER_MODE_FLAG_COMPOSITE_SPACE_IMMUTABLE |
|
|
|
|
GIMP_LAYER_MODE_FLAG_COMPOSITE_MODE_IMMUTABLE,
|
2017-02-17 03:49:29 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL,
|
|
|
|
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
{ GIMP_LAYER_MODE_SCREEN_LEGACY,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
|
|
|
.op_name = "gimp:screen-legacy",
|
|
|
|
.function = gimp_operation_screen_legacy_process,
|
|
|
|
.flags = GIMP_LAYER_MODE_FLAG_LEGACY |
|
|
|
|
GIMP_LAYER_MODE_FLAG_BLEND_SPACE_IMMUTABLE |
|
|
|
|
GIMP_LAYER_MODE_FLAG_COMPOSITE_SPACE_IMMUTABLE |
|
|
|
|
GIMP_LAYER_MODE_FLAG_COMPOSITE_MODE_IMMUTABLE,
|
2017-02-17 03:49:29 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL,
|
|
|
|
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
{ GIMP_LAYER_MODE_OVERLAY_LEGACY,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
|
|
|
.op_name = "gimp:softlight-legacy",
|
|
|
|
.function = gimp_operation_softlight_legacy_process,
|
|
|
|
.flags = GIMP_LAYER_MODE_FLAG_LEGACY |
|
|
|
|
GIMP_LAYER_MODE_FLAG_BLEND_SPACE_IMMUTABLE |
|
|
|
|
GIMP_LAYER_MODE_FLAG_COMPOSITE_SPACE_IMMUTABLE |
|
|
|
|
GIMP_LAYER_MODE_FLAG_COMPOSITE_MODE_IMMUTABLE,
|
2017-02-17 03:49:29 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL,
|
|
|
|
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
{ GIMP_LAYER_MODE_DIFFERENCE_LEGACY,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
|
|
|
.op_name = "gimp:difference-legacy",
|
|
|
|
.function = gimp_operation_difference_legacy_process,
|
|
|
|
.flags = GIMP_LAYER_MODE_FLAG_LEGACY |
|
|
|
|
GIMP_LAYER_MODE_FLAG_BLEND_SPACE_IMMUTABLE |
|
|
|
|
GIMP_LAYER_MODE_FLAG_COMPOSITE_SPACE_IMMUTABLE |
|
|
|
|
GIMP_LAYER_MODE_FLAG_COMPOSITE_MODE_IMMUTABLE,
|
2017-02-17 03:49:29 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL,
|
|
|
|
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
{ GIMP_LAYER_MODE_ADDITION_LEGACY,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
|
|
|
.op_name = "gimp:addition-legacy",
|
|
|
|
.function = gimp_operation_addition_legacy_process,
|
|
|
|
.flags = GIMP_LAYER_MODE_FLAG_LEGACY |
|
|
|
|
GIMP_LAYER_MODE_FLAG_BLEND_SPACE_IMMUTABLE |
|
|
|
|
GIMP_LAYER_MODE_FLAG_COMPOSITE_SPACE_IMMUTABLE |
|
|
|
|
GIMP_LAYER_MODE_FLAG_COMPOSITE_MODE_IMMUTABLE,
|
2017-02-17 03:49:29 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL,
|
|
|
|
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
{ GIMP_LAYER_MODE_SUBTRACT_LEGACY,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
|
|
|
.op_name = "gimp:subtract-legacy",
|
|
|
|
.function = gimp_operation_subtract_legacy_process,
|
|
|
|
.flags = GIMP_LAYER_MODE_FLAG_LEGACY |
|
|
|
|
GIMP_LAYER_MODE_FLAG_BLEND_SPACE_IMMUTABLE |
|
|
|
|
GIMP_LAYER_MODE_FLAG_COMPOSITE_SPACE_IMMUTABLE |
|
|
|
|
GIMP_LAYER_MODE_FLAG_COMPOSITE_MODE_IMMUTABLE,
|
2017-02-17 03:49:29 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL,
|
|
|
|
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
{ GIMP_LAYER_MODE_DARKEN_ONLY_LEGACY,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
|
|
|
.op_name = "gimp:darken-only-legacy",
|
|
|
|
.function = gimp_operation_darken_only_legacy_process,
|
|
|
|
.flags = GIMP_LAYER_MODE_FLAG_LEGACY |
|
|
|
|
GIMP_LAYER_MODE_FLAG_BLEND_SPACE_IMMUTABLE |
|
|
|
|
GIMP_LAYER_MODE_FLAG_COMPOSITE_SPACE_IMMUTABLE |
|
|
|
|
GIMP_LAYER_MODE_FLAG_COMPOSITE_MODE_IMMUTABLE,
|
2017-02-17 03:49:29 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL,
|
|
|
|
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
{ GIMP_LAYER_MODE_LIGHTEN_ONLY_LEGACY,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
|
|
|
.op_name = "gimp:lighten-only-legacy",
|
|
|
|
.function = gimp_operation_lighten_only_legacy_process,
|
|
|
|
.flags = GIMP_LAYER_MODE_FLAG_LEGACY |
|
|
|
|
GIMP_LAYER_MODE_FLAG_BLEND_SPACE_IMMUTABLE |
|
|
|
|
GIMP_LAYER_MODE_FLAG_COMPOSITE_SPACE_IMMUTABLE |
|
|
|
|
GIMP_LAYER_MODE_FLAG_COMPOSITE_MODE_IMMUTABLE,
|
2017-02-17 03:49:29 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL,
|
|
|
|
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
{ GIMP_LAYER_MODE_HSV_HUE_LEGACY,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
|
|
|
.op_name = "gimp:hsv-hue-legacy",
|
|
|
|
.function = gimp_operation_hsv_hue_legacy_process,
|
|
|
|
.flags = GIMP_LAYER_MODE_FLAG_LEGACY |
|
|
|
|
GIMP_LAYER_MODE_FLAG_BLEND_SPACE_IMMUTABLE |
|
|
|
|
GIMP_LAYER_MODE_FLAG_COMPOSITE_SPACE_IMMUTABLE |
|
|
|
|
GIMP_LAYER_MODE_FLAG_COMPOSITE_MODE_IMMUTABLE,
|
2017-02-17 03:49:29 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL,
|
|
|
|
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
{ GIMP_LAYER_MODE_HSV_SATURATION_LEGACY,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
|
|
|
.op_name = "gimp:hsv-saturation-legacy",
|
|
|
|
.function = gimp_operation_hsv_saturation_legacy_process,
|
|
|
|
.flags = GIMP_LAYER_MODE_FLAG_LEGACY |
|
|
|
|
GIMP_LAYER_MODE_FLAG_BLEND_SPACE_IMMUTABLE |
|
|
|
|
GIMP_LAYER_MODE_FLAG_COMPOSITE_SPACE_IMMUTABLE |
|
|
|
|
GIMP_LAYER_MODE_FLAG_COMPOSITE_MODE_IMMUTABLE,
|
2017-02-17 03:49:29 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL,
|
|
|
|
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
2017-03-16 06:17:05 -04:00
|
|
|
{ GIMP_LAYER_MODE_HSL_COLOR_LEGACY,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
2017-03-16 06:17:05 -04:00
|
|
|
.op_name = "gimp:hsl-color-legacy",
|
|
|
|
.function = gimp_operation_hsl_color_legacy_process,
|
2017-02-16 20:25:57 -05:00
|
|
|
.flags = GIMP_LAYER_MODE_FLAG_LEGACY |
|
|
|
|
GIMP_LAYER_MODE_FLAG_BLEND_SPACE_IMMUTABLE |
|
|
|
|
GIMP_LAYER_MODE_FLAG_COMPOSITE_SPACE_IMMUTABLE |
|
|
|
|
GIMP_LAYER_MODE_FLAG_COMPOSITE_MODE_IMMUTABLE,
|
2017-02-17 03:49:29 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL,
|
|
|
|
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
{ GIMP_LAYER_MODE_HSV_VALUE_LEGACY,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
|
|
|
.op_name = "gimp:hsv-value-legacy",
|
|
|
|
.function = gimp_operation_hsv_value_legacy_process,
|
|
|
|
.flags = GIMP_LAYER_MODE_FLAG_LEGACY |
|
|
|
|
GIMP_LAYER_MODE_FLAG_BLEND_SPACE_IMMUTABLE |
|
|
|
|
GIMP_LAYER_MODE_FLAG_COMPOSITE_SPACE_IMMUTABLE |
|
|
|
|
GIMP_LAYER_MODE_FLAG_COMPOSITE_MODE_IMMUTABLE,
|
2017-02-17 03:49:29 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL,
|
|
|
|
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
{ GIMP_LAYER_MODE_DIVIDE_LEGACY,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
|
|
|
.op_name = "gimp:divide-legacy",
|
|
|
|
.function = gimp_operation_divide_legacy_process,
|
|
|
|
.flags = GIMP_LAYER_MODE_FLAG_LEGACY |
|
|
|
|
GIMP_LAYER_MODE_FLAG_BLEND_SPACE_IMMUTABLE |
|
|
|
|
GIMP_LAYER_MODE_FLAG_COMPOSITE_SPACE_IMMUTABLE |
|
|
|
|
GIMP_LAYER_MODE_FLAG_COMPOSITE_MODE_IMMUTABLE,
|
2017-02-17 03:49:29 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL,
|
|
|
|
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
{ GIMP_LAYER_MODE_DODGE_LEGACY,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
|
|
|
.op_name = "gimp:dodge-legacy",
|
|
|
|
.function = gimp_operation_dodge_legacy_process,
|
|
|
|
.flags = GIMP_LAYER_MODE_FLAG_LEGACY |
|
|
|
|
GIMP_LAYER_MODE_FLAG_BLEND_SPACE_IMMUTABLE |
|
|
|
|
GIMP_LAYER_MODE_FLAG_COMPOSITE_SPACE_IMMUTABLE |
|
|
|
|
GIMP_LAYER_MODE_FLAG_COMPOSITE_MODE_IMMUTABLE,
|
2017-02-17 03:49:29 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL,
|
|
|
|
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
{ GIMP_LAYER_MODE_BURN_LEGACY,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
|
|
|
.op_name = "gimp:burn-legacy",
|
|
|
|
.function = gimp_operation_burn_legacy_process,
|
|
|
|
.flags = GIMP_LAYER_MODE_FLAG_LEGACY |
|
|
|
|
GIMP_LAYER_MODE_FLAG_BLEND_SPACE_IMMUTABLE |
|
|
|
|
GIMP_LAYER_MODE_FLAG_COMPOSITE_SPACE_IMMUTABLE |
|
|
|
|
GIMP_LAYER_MODE_FLAG_COMPOSITE_MODE_IMMUTABLE,
|
2017-02-17 03:49:29 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL,
|
|
|
|
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
{ GIMP_LAYER_MODE_HARDLIGHT_LEGACY,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
|
|
|
.op_name = "gimp:hardlight-legacy",
|
|
|
|
.function = gimp_operation_hardlight_legacy_process,
|
|
|
|
.flags = GIMP_LAYER_MODE_FLAG_LEGACY |
|
|
|
|
GIMP_LAYER_MODE_FLAG_BLEND_SPACE_IMMUTABLE |
|
|
|
|
GIMP_LAYER_MODE_FLAG_COMPOSITE_SPACE_IMMUTABLE |
|
|
|
|
GIMP_LAYER_MODE_FLAG_COMPOSITE_MODE_IMMUTABLE,
|
2017-02-17 03:49:29 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL,
|
|
|
|
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
{ GIMP_LAYER_MODE_SOFTLIGHT_LEGACY,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
|
|
|
.op_name = "gimp:softlight-legacy",
|
|
|
|
.function = gimp_operation_softlight_legacy_process,
|
|
|
|
.flags = GIMP_LAYER_MODE_FLAG_LEGACY |
|
|
|
|
GIMP_LAYER_MODE_FLAG_BLEND_SPACE_IMMUTABLE |
|
|
|
|
GIMP_LAYER_MODE_FLAG_COMPOSITE_SPACE_IMMUTABLE |
|
|
|
|
GIMP_LAYER_MODE_FLAG_COMPOSITE_MODE_IMMUTABLE,
|
2017-02-17 03:49:29 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL,
|
|
|
|
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
{ GIMP_LAYER_MODE_GRAIN_EXTRACT_LEGACY,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
|
|
|
.op_name = "gimp:grain-extract-legacy",
|
|
|
|
.function = gimp_operation_grain_extract_legacy_process,
|
|
|
|
.flags = GIMP_LAYER_MODE_FLAG_LEGACY |
|
|
|
|
GIMP_LAYER_MODE_FLAG_BLEND_SPACE_IMMUTABLE |
|
|
|
|
GIMP_LAYER_MODE_FLAG_COMPOSITE_SPACE_IMMUTABLE |
|
|
|
|
GIMP_LAYER_MODE_FLAG_COMPOSITE_MODE_IMMUTABLE,
|
2017-02-17 03:49:29 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL,
|
|
|
|
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
{ GIMP_LAYER_MODE_GRAIN_MERGE_LEGACY,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
|
|
|
.op_name = "gimp:grain-merge-legacy",
|
|
|
|
.function = gimp_operation_grain_merge_legacy_process,
|
|
|
|
.flags = GIMP_LAYER_MODE_FLAG_LEGACY |
|
|
|
|
GIMP_LAYER_MODE_FLAG_BLEND_SPACE_IMMUTABLE |
|
|
|
|
GIMP_LAYER_MODE_FLAG_COMPOSITE_SPACE_IMMUTABLE |
|
|
|
|
GIMP_LAYER_MODE_FLAG_COMPOSITE_MODE_IMMUTABLE,
|
2017-02-17 03:49:29 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL,
|
|
|
|
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
2017-03-08 13:06:46 -05:00
|
|
|
{ GIMP_LAYER_MODE_COLOR_ERASE_LEGACY,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
2017-03-08 13:06:46 -05:00
|
|
|
.op_name = "gimp:layer-mode",
|
|
|
|
.function = gimp_operation_layer_mode_process_pixels,
|
|
|
|
.flags = GIMP_LAYER_MODE_FLAG_LEGACY |
|
|
|
|
GIMP_LAYER_MODE_FLAG_BLEND_SPACE_IMMUTABLE |
|
2017-02-17 18:11:06 -05:00
|
|
|
GIMP_LAYER_MODE_FLAG_COMPOSITE_SPACE_IMMUTABLE |
|
2017-03-08 06:36:39 -05:00
|
|
|
GIMP_LAYER_MODE_FLAG_COMPOSITE_MODE_IMMUTABLE |
|
|
|
|
GIMP_LAYER_MODE_FLAG_SUBTRACTIVE,
|
2017-03-10 14:41:25 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL,
|
|
|
|
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
{ GIMP_LAYER_MODE_OVERLAY,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
|
|
|
.op_name = "gimp:layer-mode",
|
|
|
|
.function = gimp_operation_layer_mode_process_pixels,
|
2017-02-17 03:49:29 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_OVER,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_LINEAR,
|
|
|
|
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
{ GIMP_LAYER_MODE_LCH_HUE,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
|
|
|
.op_name = "gimp:layer-mode",
|
|
|
|
.function = gimp_operation_layer_mode_process_pixels,
|
2017-02-17 10:20:04 -05:00
|
|
|
.flags = GIMP_LAYER_MODE_FLAG_BLEND_SPACE_IMMUTABLE,
|
2017-02-17 03:49:29 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_OVER,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_LINEAR,
|
|
|
|
.blend_space = GIMP_LAYER_COLOR_SPACE_LAB
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
{ GIMP_LAYER_MODE_LCH_CHROMA,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
|
|
|
.op_name = "gimp:layer-mode",
|
|
|
|
.function = gimp_operation_layer_mode_process_pixels,
|
2017-02-17 10:20:04 -05:00
|
|
|
.flags = GIMP_LAYER_MODE_FLAG_BLEND_SPACE_IMMUTABLE,
|
2017-02-17 03:49:29 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_OVER,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_LINEAR,
|
|
|
|
.blend_space = GIMP_LAYER_COLOR_SPACE_LAB
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
{ GIMP_LAYER_MODE_LCH_COLOR,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
|
|
|
.op_name = "gimp:layer-mode",
|
|
|
|
.function = gimp_operation_layer_mode_process_pixels,
|
2017-02-17 10:20:04 -05:00
|
|
|
.flags = GIMP_LAYER_MODE_FLAG_BLEND_SPACE_IMMUTABLE,
|
2017-02-17 03:49:29 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_OVER,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_LINEAR,
|
|
|
|
.blend_space = GIMP_LAYER_COLOR_SPACE_LAB
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
{ GIMP_LAYER_MODE_LCH_LIGHTNESS,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
|
|
|
.op_name = "gimp:layer-mode",
|
|
|
|
.function = gimp_operation_layer_mode_process_pixels,
|
2017-02-17 10:20:04 -05:00
|
|
|
.flags = GIMP_LAYER_MODE_FLAG_BLEND_SPACE_IMMUTABLE,
|
2017-02-17 03:49:29 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_OVER,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_LINEAR,
|
|
|
|
.blend_space = GIMP_LAYER_COLOR_SPACE_LAB
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
2017-02-26 16:26:34 +01:00
|
|
|
{ GIMP_LAYER_MODE_NORMAL,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
|
|
|
.op_name = "gimp:normal",
|
|
|
|
.function = gimp_operation_normal_process,
|
2017-02-26 16:43:59 +01:00
|
|
|
.flags = GIMP_LAYER_MODE_FLAG_BLEND_SPACE_IMMUTABLE,
|
2017-02-17 03:49:29 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_OVER,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_OVER,
|
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_LINEAR
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
2017-02-19 23:14:44 +01:00
|
|
|
{ GIMP_LAYER_MODE_BEHIND,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
|
|
|
.op_name = "gimp:behind",
|
|
|
|
.function = gimp_operation_behind_process,
|
2017-02-17 10:20:04 -05:00
|
|
|
.flags = GIMP_LAYER_MODE_FLAG_BLEND_SPACE_IMMUTABLE,
|
2017-02-17 03:49:29 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_PAINT |
|
|
|
|
GIMP_LAYER_MODE_CONTEXT_FADE,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_OVER,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_OVER,
|
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_LINEAR
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
{ GIMP_LAYER_MODE_MULTIPLY,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
|
|
|
.op_name = "gimp:layer-mode",
|
|
|
|
.function = gimp_operation_layer_mode_process_pixels,
|
2017-02-17 03:49:29 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_OVER,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_LINEAR,
|
2017-02-20 20:00:37 +01:00
|
|
|
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_LINEAR
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
{ GIMP_LAYER_MODE_SCREEN,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
|
|
|
.op_name = "gimp:layer-mode",
|
|
|
|
.function = gimp_operation_layer_mode_process_pixels,
|
2017-02-17 03:49:29 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_OVER,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_LINEAR,
|
|
|
|
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
{ GIMP_LAYER_MODE_DIFFERENCE,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
|
|
|
.op_name = "gimp:layer-mode",
|
|
|
|
.function = gimp_operation_layer_mode_process_pixels,
|
2017-02-17 03:49:29 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_OVER,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_LINEAR,
|
|
|
|
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
{ GIMP_LAYER_MODE_ADDITION,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
|
|
|
.op_name = "gimp:layer-mode",
|
|
|
|
.function = gimp_operation_layer_mode_process_pixels,
|
2017-02-17 03:49:29 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_OVER,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_LINEAR,
|
2017-02-20 20:00:37 +01:00
|
|
|
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_LINEAR
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
{ GIMP_LAYER_MODE_SUBTRACT,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
|
|
|
.op_name = "gimp:layer-mode",
|
|
|
|
.function = gimp_operation_layer_mode_process_pixels,
|
2017-02-17 03:49:29 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_OVER,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_LINEAR,
|
2017-02-20 20:00:37 +01:00
|
|
|
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_LINEAR
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
{ GIMP_LAYER_MODE_DARKEN_ONLY,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
|
|
|
.op_name = "gimp:layer-mode",
|
|
|
|
.function = gimp_operation_layer_mode_process_pixels,
|
2017-02-17 10:20:04 -05:00
|
|
|
.flags = GIMP_LAYER_MODE_FLAG_BLEND_SPACE_IMMUTABLE,
|
2017-02-17 03:49:29 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_OVER,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
2017-02-20 20:12:26 +01:00
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_LINEAR
|
|
|
|
/* no blend_space: reuse composite space, no conversion thus fewer copies */
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
{ GIMP_LAYER_MODE_LIGHTEN_ONLY,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
|
|
|
.op_name = "gimp:layer-mode",
|
|
|
|
.function = gimp_operation_layer_mode_process_pixels,
|
2017-02-17 10:20:04 -05:00
|
|
|
.flags = GIMP_LAYER_MODE_FLAG_BLEND_SPACE_IMMUTABLE,
|
2017-02-17 03:49:29 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_OVER,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
2017-02-20 20:12:26 +01:00
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_LINEAR
|
|
|
|
/* no blend_space: reuse composite space, no conversion thus fewer copies */
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
{ GIMP_LAYER_MODE_HSV_HUE,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
|
|
|
.op_name = "gimp:layer-mode",
|
|
|
|
.function = gimp_operation_layer_mode_process_pixels,
|
2017-02-17 10:20:04 -05:00
|
|
|
.flags = GIMP_LAYER_MODE_FLAG_BLEND_SPACE_IMMUTABLE,
|
2017-02-17 03:49:29 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_OVER,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_LINEAR,
|
|
|
|
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
{ GIMP_LAYER_MODE_HSV_SATURATION,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
|
|
|
.op_name = "gimp:layer-mode",
|
|
|
|
.function = gimp_operation_layer_mode_process_pixels,
|
2017-02-17 10:20:04 -05:00
|
|
|
.flags = GIMP_LAYER_MODE_FLAG_BLEND_SPACE_IMMUTABLE,
|
2017-02-17 03:49:29 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_OVER,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_LINEAR,
|
|
|
|
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
2017-03-15 19:30:01 -04:00
|
|
|
{ GIMP_LAYER_MODE_HSL_COLOR,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
|
|
|
.op_name = "gimp:layer-mode",
|
|
|
|
.function = gimp_operation_layer_mode_process_pixels,
|
2017-02-17 10:20:04 -05:00
|
|
|
.flags = GIMP_LAYER_MODE_FLAG_BLEND_SPACE_IMMUTABLE,
|
2017-02-17 03:49:29 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_OVER,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_LINEAR,
|
|
|
|
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
{ GIMP_LAYER_MODE_HSV_VALUE,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
|
|
|
.op_name = "gimp:layer-mode",
|
|
|
|
.function = gimp_operation_layer_mode_process_pixels,
|
2017-02-17 10:20:04 -05:00
|
|
|
.flags = GIMP_LAYER_MODE_FLAG_BLEND_SPACE_IMMUTABLE,
|
2017-02-17 03:49:29 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_OVER,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_LINEAR,
|
|
|
|
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
{ GIMP_LAYER_MODE_DIVIDE,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
|
|
|
.op_name = "gimp:layer-mode",
|
|
|
|
.function = gimp_operation_layer_mode_process_pixels,
|
2017-02-17 03:49:29 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_OVER,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_LINEAR,
|
2017-02-20 20:00:37 +01:00
|
|
|
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_LINEAR
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
{ GIMP_LAYER_MODE_DODGE,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
|
|
|
.op_name = "gimp:layer-mode",
|
|
|
|
.function = gimp_operation_layer_mode_process_pixels,
|
2017-02-17 03:49:29 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_OVER,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_LINEAR,
|
|
|
|
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
{ GIMP_LAYER_MODE_BURN,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
|
|
|
.op_name = "gimp:layer-mode",
|
|
|
|
.function = gimp_operation_layer_mode_process_pixels,
|
2017-02-17 03:49:29 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_OVER,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_LINEAR,
|
|
|
|
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
{ GIMP_LAYER_MODE_HARDLIGHT,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
|
|
|
.op_name = "gimp:layer-mode",
|
|
|
|
.function = gimp_operation_layer_mode_process_pixels,
|
2017-02-17 03:49:29 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_OVER,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_LINEAR,
|
|
|
|
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
{ GIMP_LAYER_MODE_SOFTLIGHT,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
|
|
|
.op_name = "gimp:layer-mode",
|
|
|
|
.function = gimp_operation_layer_mode_process_pixels,
|
2017-02-17 03:49:29 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_OVER,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_LINEAR,
|
|
|
|
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
{ GIMP_LAYER_MODE_GRAIN_EXTRACT,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
|
|
|
.op_name = "gimp:layer-mode",
|
|
|
|
.function = gimp_operation_layer_mode_process_pixels,
|
2017-02-17 03:49:29 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_OVER,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_LINEAR,
|
|
|
|
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
{ GIMP_LAYER_MODE_GRAIN_MERGE,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
|
|
|
.op_name = "gimp:layer-mode",
|
|
|
|
.function = gimp_operation_layer_mode_process_pixels,
|
2017-02-17 03:49:29 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_OVER,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_LINEAR,
|
|
|
|
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
{ GIMP_LAYER_MODE_VIVID_LIGHT,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
|
|
|
.op_name = "gimp:layer-mode",
|
|
|
|
.function = gimp_operation_layer_mode_process_pixels,
|
2017-02-17 03:49:29 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_OVER,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_LINEAR,
|
|
|
|
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
{ GIMP_LAYER_MODE_PIN_LIGHT,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
|
|
|
.op_name = "gimp:layer-mode",
|
|
|
|
.function = gimp_operation_layer_mode_process_pixels,
|
2017-02-17 03:49:29 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_OVER,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_LINEAR,
|
|
|
|
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
{ GIMP_LAYER_MODE_LINEAR_LIGHT,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
|
|
|
.op_name = "gimp:layer-mode",
|
|
|
|
.function = gimp_operation_layer_mode_process_pixels,
|
2017-02-17 03:49:29 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_OVER,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_LINEAR,
|
|
|
|
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
{ GIMP_LAYER_MODE_HARD_MIX,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
|
|
|
.op_name = "gimp:layer-mode",
|
|
|
|
.function = gimp_operation_layer_mode_process_pixels,
|
2017-02-17 03:49:29 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_OVER,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_LINEAR,
|
|
|
|
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
{ GIMP_LAYER_MODE_EXCLUSION,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
|
|
|
.op_name = "gimp:layer-mode",
|
|
|
|
.function = gimp_operation_layer_mode_process_pixels,
|
2017-02-17 03:49:29 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_OVER,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_LINEAR,
|
|
|
|
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
{ GIMP_LAYER_MODE_LINEAR_BURN,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
|
|
|
.op_name = "gimp:layer-mode",
|
|
|
|
.function = gimp_operation_layer_mode_process_pixels,
|
2017-02-17 03:49:29 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_OVER,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_LINEAR,
|
|
|
|
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
{ GIMP_LAYER_MODE_LUMA_DARKEN_ONLY,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
|
|
|
.op_name = "gimp:layer-mode",
|
|
|
|
.function = gimp_operation_layer_mode_process_pixels,
|
2017-02-17 03:49:29 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_OVER,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_LINEAR,
|
|
|
|
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
{ GIMP_LAYER_MODE_LUMA_LIGHTEN_ONLY,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
|
|
|
.op_name = "gimp:layer-mode",
|
|
|
|
.function = gimp_operation_layer_mode_process_pixels,
|
2017-02-17 03:49:29 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_OVER,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_LINEAR,
|
|
|
|
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
2017-02-20 18:21:12 +01:00
|
|
|
{ GIMP_LAYER_MODE_LUMINANCE,
|
|
|
|
|
|
|
|
.op_name = "gimp:layer-mode",
|
|
|
|
.function = gimp_operation_layer_mode_process_pixels,
|
|
|
|
.flags = GIMP_LAYER_MODE_FLAG_BLEND_SPACE_IMMUTABLE,
|
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_OVER,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_LINEAR,
|
|
|
|
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_LINEAR
|
|
|
|
},
|
|
|
|
|
2017-03-08 13:06:46 -05:00
|
|
|
{ GIMP_LAYER_MODE_COLOR_ERASE,
|
|
|
|
|
|
|
|
.op_name = "gimp:layer-mode",
|
|
|
|
.function = gimp_operation_layer_mode_process_pixels,
|
|
|
|
.flags = GIMP_LAYER_MODE_FLAG_SUBTRACTIVE,
|
2017-03-10 14:41:25 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
2017-03-08 13:06:46 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_LINEAR,
|
|
|
|
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_LINEAR
|
|
|
|
},
|
|
|
|
|
2017-02-05 15:59:29 +01:00
|
|
|
{ GIMP_LAYER_MODE_ERASE,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
|
|
|
.op_name = "gimp:erase",
|
|
|
|
.function = gimp_operation_erase_process,
|
2017-03-08 06:36:39 -05:00
|
|
|
.flags = GIMP_LAYER_MODE_FLAG_BLEND_SPACE_IMMUTABLE |
|
|
|
|
GIMP_LAYER_MODE_FLAG_SUBTRACTIVE,
|
2017-03-10 14:35:46 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_LINEAR
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
2017-03-10 17:59:17 -05:00
|
|
|
{ GIMP_LAYER_MODE_MERGE,
|
|
|
|
|
|
|
|
.op_name = "gimp:merge",
|
|
|
|
.function = gimp_operation_merge_process,
|
|
|
|
.flags = GIMP_LAYER_MODE_FLAG_BLEND_SPACE_IMMUTABLE,
|
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_OVER,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_OVER,
|
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_LINEAR
|
|
|
|
},
|
|
|
|
|
2017-03-10 18:28:40 -05:00
|
|
|
{ GIMP_LAYER_MODE_SPLIT,
|
|
|
|
|
|
|
|
.op_name = "gimp:split",
|
|
|
|
.function = gimp_operation_split_process,
|
|
|
|
.flags = GIMP_LAYER_MODE_FLAG_BLEND_SPACE_IMMUTABLE |
|
|
|
|
GIMP_LAYER_MODE_FLAG_COMPOSITE_SPACE_IMMUTABLE |
|
|
|
|
GIMP_LAYER_MODE_FLAG_SUBTRACTIVE,
|
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
|
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP
|
|
|
|
},
|
|
|
|
|
2017-04-21 13:38:22 -04:00
|
|
|
{ GIMP_LAYER_MODE_PASS_THROUGH,
|
|
|
|
|
|
|
|
.op_name = "gimp:replace",
|
|
|
|
.function = gimp_operation_replace_process,
|
|
|
|
.flags = GIMP_LAYER_MODE_FLAG_BLEND_SPACE_IMMUTABLE |
|
|
|
|
GIMP_LAYER_MODE_FLAG_COMPOSITE_MODE_IMMUTABLE,
|
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_GROUP,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_OVER,
|
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_LINEAR
|
|
|
|
},
|
|
|
|
|
2017-02-05 15:59:29 +01:00
|
|
|
{ GIMP_LAYER_MODE_REPLACE,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
|
|
|
.op_name = "gimp:replace",
|
|
|
|
.function = gimp_operation_replace_process,
|
2017-02-17 10:20:04 -05:00
|
|
|
.flags = GIMP_LAYER_MODE_FLAG_BLEND_SPACE_IMMUTABLE,
|
2017-02-17 03:49:29 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_FADE,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_OVER,
|
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_OVER,
|
app: move bottom-layer special casing to GimpOperationLayerMode
GimpFilter's is_last_node field only reflects the item's position
within the parent stack. When a layer is contained in a pass-
through group, it can be the last layer of the group, while not
being the last layer in the graph as a whole (paticularly, if
there are visible layers below the group). In fact, when we have
nested pass-through groups, whether or not a layer is the last
node depends on which group we're considering as the root (since
we exclude the backdrop from the group's projection, resulting in
different graphs for different groups).
Instead of rolling our own graph traversal, just move the relevant
logic to GimpOperationLayerMode, and let GEGL do the work for us.
At processing time, we can tell if we're the last node by checking
if we have any input.
For this to work, GimpOperationLayerMode's process() function needs
to have control over what's going on. Replace the derived op
classes, which override process(), with a call to the layer mode's
function (as per gimp_layer_mode_get_function()) in
GimpOperationLayerMode's process() function. (Well, actually, this
commit keeps the ops around, and just hacks around them in
gimp_layer_mode_get_operation(), because laziness :P)
Keep using the layer's is_last_node property to do the invalidation.
2017-04-21 19:42:04 -04:00
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_LINEAR,
|
|
|
|
.affected_region = GIMP_LAYER_COMPOSITE_REGION_DESTINATION
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
{ GIMP_LAYER_MODE_ANTI_ERASE,
|
2017-02-16 20:25:57 -05:00
|
|
|
|
|
|
|
.op_name = "gimp:anti-erase",
|
|
|
|
.function = gimp_operation_anti_erase_process,
|
2017-02-17 10:20:04 -05:00
|
|
|
.flags = GIMP_LAYER_MODE_FLAG_BLEND_SPACE_IMMUTABLE |
|
2017-02-16 20:25:57 -05:00
|
|
|
GIMP_LAYER_MODE_FLAG_COMPOSITE_SPACE_IMMUTABLE,
|
2017-02-17 03:49:29 -05:00
|
|
|
.context = GIMP_LAYER_MODE_CONTEXT_FADE,
|
2017-02-16 20:25:57 -05:00
|
|
|
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_OVER,
|
app: move bottom-layer special casing to GimpOperationLayerMode
GimpFilter's is_last_node field only reflects the item's position
within the parent stack. When a layer is contained in a pass-
through group, it can be the last layer of the group, while not
being the last layer in the graph as a whole (paticularly, if
there are visible layers below the group). In fact, when we have
nested pass-through groups, whether or not a layer is the last
node depends on which group we're considering as the root (since
we exclude the backdrop from the group's projection, resulting in
different graphs for different groups).
Instead of rolling our own graph traversal, just move the relevant
logic to GimpOperationLayerMode, and let GEGL do the work for us.
At processing time, we can tell if we're the last node by checking
if we have any input.
For this to work, GimpOperationLayerMode's process() function needs
to have control over what's going on. Replace the derived op
classes, which override process(), with a call to the layer mode's
function (as per gimp_layer_mode_get_function()) in
GimpOperationLayerMode's process() function. (Well, actually, this
commit keeps the ops around, and just hacks around them in
gimp_layer_mode_get_operation(), because laziness :P)
Keep using the layer's is_last_node property to do the invalidation.
2017-04-21 19:42:04 -04:00
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_OVER,
|
|
|
|
.affected_region = GIMP_LAYER_COMPOSITE_REGION_SOURCE
|
2017-02-05 15:59:29 +01:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
static const GimpLayerMode layer_mode_group_default[] =
|
|
|
|
{
|
2017-04-21 13:38:22 -04:00
|
|
|
GIMP_LAYER_MODE_PASS_THROUGH,
|
|
|
|
|
|
|
|
GIMP_LAYER_MODE_SEPARATOR,
|
|
|
|
|
2017-02-05 15:59:29 +01:00
|
|
|
GIMP_LAYER_MODE_NORMAL,
|
2017-02-17 05:20:53 -05:00
|
|
|
GIMP_LAYER_MODE_REPLACE,
|
2017-02-05 15:59:29 +01:00
|
|
|
GIMP_LAYER_MODE_DISSOLVE,
|
2017-02-17 05:20:53 -05:00
|
|
|
GIMP_LAYER_MODE_BEHIND,
|
|
|
|
GIMP_LAYER_MODE_COLOR_ERASE,
|
|
|
|
GIMP_LAYER_MODE_ERASE,
|
|
|
|
GIMP_LAYER_MODE_ANTI_ERASE,
|
2017-03-10 17:59:17 -05:00
|
|
|
GIMP_LAYER_MODE_MERGE,
|
2017-03-10 18:28:40 -05:00
|
|
|
GIMP_LAYER_MODE_SPLIT,
|
2017-02-17 05:20:53 -05:00
|
|
|
|
|
|
|
GIMP_LAYER_MODE_SEPARATOR,
|
2017-02-05 15:59:29 +01:00
|
|
|
|
|
|
|
GIMP_LAYER_MODE_LIGHTEN_ONLY,
|
|
|
|
GIMP_LAYER_MODE_LUMA_LIGHTEN_ONLY,
|
|
|
|
GIMP_LAYER_MODE_SCREEN,
|
|
|
|
GIMP_LAYER_MODE_DODGE,
|
|
|
|
GIMP_LAYER_MODE_ADDITION,
|
|
|
|
|
2017-02-17 05:20:53 -05:00
|
|
|
GIMP_LAYER_MODE_SEPARATOR,
|
|
|
|
|
2017-02-05 15:59:29 +01:00
|
|
|
GIMP_LAYER_MODE_DARKEN_ONLY,
|
|
|
|
GIMP_LAYER_MODE_LUMA_DARKEN_ONLY,
|
|
|
|
GIMP_LAYER_MODE_MULTIPLY,
|
|
|
|
GIMP_LAYER_MODE_BURN,
|
|
|
|
|
2017-02-17 05:20:53 -05:00
|
|
|
GIMP_LAYER_MODE_SEPARATOR,
|
|
|
|
|
2017-02-05 15:59:29 +01:00
|
|
|
GIMP_LAYER_MODE_OVERLAY,
|
|
|
|
GIMP_LAYER_MODE_SOFTLIGHT,
|
|
|
|
GIMP_LAYER_MODE_HARDLIGHT,
|
|
|
|
GIMP_LAYER_MODE_VIVID_LIGHT,
|
|
|
|
GIMP_LAYER_MODE_PIN_LIGHT,
|
|
|
|
GIMP_LAYER_MODE_LINEAR_LIGHT,
|
|
|
|
GIMP_LAYER_MODE_HARD_MIX,
|
|
|
|
|
2017-02-17 05:20:53 -05:00
|
|
|
GIMP_LAYER_MODE_SEPARATOR,
|
|
|
|
|
2017-02-05 15:59:29 +01:00
|
|
|
GIMP_LAYER_MODE_DIFFERENCE,
|
|
|
|
GIMP_LAYER_MODE_SUBTRACT,
|
|
|
|
GIMP_LAYER_MODE_GRAIN_EXTRACT,
|
|
|
|
GIMP_LAYER_MODE_GRAIN_MERGE,
|
|
|
|
GIMP_LAYER_MODE_DIVIDE,
|
|
|
|
|
2017-02-17 05:20:53 -05:00
|
|
|
GIMP_LAYER_MODE_SEPARATOR,
|
|
|
|
|
2017-02-05 15:59:29 +01:00
|
|
|
GIMP_LAYER_MODE_HSV_HUE,
|
|
|
|
GIMP_LAYER_MODE_HSV_SATURATION,
|
2017-03-15 19:30:01 -04:00
|
|
|
GIMP_LAYER_MODE_HSL_COLOR,
|
2017-02-05 15:59:29 +01:00
|
|
|
GIMP_LAYER_MODE_HSV_VALUE,
|
|
|
|
|
2017-02-17 05:20:53 -05:00
|
|
|
GIMP_LAYER_MODE_SEPARATOR,
|
|
|
|
|
2017-02-05 15:59:29 +01:00
|
|
|
GIMP_LAYER_MODE_LCH_HUE,
|
|
|
|
GIMP_LAYER_MODE_LCH_CHROMA,
|
|
|
|
GIMP_LAYER_MODE_LCH_COLOR,
|
|
|
|
GIMP_LAYER_MODE_LCH_LIGHTNESS,
|
2017-02-20 05:26:51 -05:00
|
|
|
GIMP_LAYER_MODE_LUMINANCE,
|
2017-02-05 15:59:29 +01:00
|
|
|
|
2017-02-17 05:20:53 -05:00
|
|
|
GIMP_LAYER_MODE_SEPARATOR,
|
|
|
|
|
2017-02-05 15:59:29 +01:00
|
|
|
GIMP_LAYER_MODE_EXCLUSION,
|
2017-03-15 14:52:14 -04:00
|
|
|
GIMP_LAYER_MODE_LINEAR_BURN
|
2017-02-05 15:59:29 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
static const GimpLayerMode layer_mode_group_legacy[] =
|
|
|
|
{
|
2017-02-26 16:26:34 +01:00
|
|
|
GIMP_LAYER_MODE_NORMAL_LEGACY,
|
2017-02-05 15:59:29 +01:00
|
|
|
GIMP_LAYER_MODE_DISSOLVE,
|
2017-02-19 23:14:44 +01:00
|
|
|
GIMP_LAYER_MODE_BEHIND_LEGACY,
|
2017-03-08 13:06:46 -05:00
|
|
|
GIMP_LAYER_MODE_COLOR_ERASE_LEGACY,
|
2017-02-05 15:59:29 +01:00
|
|
|
|
2017-02-17 05:20:53 -05:00
|
|
|
GIMP_LAYER_MODE_SEPARATOR,
|
|
|
|
|
2017-02-05 15:59:29 +01:00
|
|
|
GIMP_LAYER_MODE_LIGHTEN_ONLY_LEGACY,
|
|
|
|
GIMP_LAYER_MODE_SCREEN_LEGACY,
|
|
|
|
GIMP_LAYER_MODE_DODGE_LEGACY,
|
|
|
|
GIMP_LAYER_MODE_ADDITION_LEGACY,
|
|
|
|
|
2017-02-17 05:20:53 -05:00
|
|
|
GIMP_LAYER_MODE_SEPARATOR,
|
|
|
|
|
2017-02-05 15:59:29 +01:00
|
|
|
GIMP_LAYER_MODE_DARKEN_ONLY_LEGACY,
|
|
|
|
GIMP_LAYER_MODE_MULTIPLY_LEGACY,
|
|
|
|
GIMP_LAYER_MODE_BURN_LEGACY,
|
|
|
|
|
2017-02-17 05:20:53 -05:00
|
|
|
GIMP_LAYER_MODE_SEPARATOR,
|
|
|
|
|
2017-03-08 18:08:36 +01:00
|
|
|
GIMP_LAYER_MODE_OVERLAY,
|
2017-02-05 15:59:29 +01:00
|
|
|
GIMP_LAYER_MODE_SOFTLIGHT_LEGACY,
|
|
|
|
GIMP_LAYER_MODE_HARDLIGHT_LEGACY,
|
|
|
|
|
2017-02-17 05:20:53 -05:00
|
|
|
GIMP_LAYER_MODE_SEPARATOR,
|
|
|
|
|
2017-02-05 15:59:29 +01:00
|
|
|
GIMP_LAYER_MODE_DIFFERENCE_LEGACY,
|
|
|
|
GIMP_LAYER_MODE_SUBTRACT_LEGACY,
|
|
|
|
GIMP_LAYER_MODE_GRAIN_EXTRACT_LEGACY,
|
|
|
|
GIMP_LAYER_MODE_GRAIN_MERGE_LEGACY,
|
|
|
|
GIMP_LAYER_MODE_DIVIDE_LEGACY,
|
|
|
|
|
2017-02-17 05:20:53 -05:00
|
|
|
GIMP_LAYER_MODE_SEPARATOR,
|
|
|
|
|
2017-02-05 15:59:29 +01:00
|
|
|
GIMP_LAYER_MODE_HSV_HUE_LEGACY,
|
|
|
|
GIMP_LAYER_MODE_HSV_SATURATION_LEGACY,
|
2017-03-16 06:17:05 -04:00
|
|
|
GIMP_LAYER_MODE_HSL_COLOR_LEGACY,
|
2017-02-05 15:59:29 +01:00
|
|
|
GIMP_LAYER_MODE_HSV_VALUE_LEGACY
|
|
|
|
};
|
|
|
|
|
2017-02-19 23:14:44 +01:00
|
|
|
static const GimpLayerMode layer_mode_groups[][2] =
|
2017-02-05 15:59:29 +01:00
|
|
|
{
|
2017-02-20 14:20:39 -05:00
|
|
|
{ [GIMP_LAYER_MODE_GROUP_DEFAULT] = GIMP_LAYER_MODE_NORMAL,
|
2017-02-26 16:26:34 +01:00
|
|
|
[GIMP_LAYER_MODE_GROUP_LEGACY ] = GIMP_LAYER_MODE_NORMAL_LEGACY
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
2017-02-20 14:20:39 -05:00
|
|
|
{ [GIMP_LAYER_MODE_GROUP_DEFAULT] = GIMP_LAYER_MODE_DISSOLVE,
|
|
|
|
[GIMP_LAYER_MODE_GROUP_LEGACY ] = GIMP_LAYER_MODE_DISSOLVE
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
2017-02-20 14:20:39 -05:00
|
|
|
{ [GIMP_LAYER_MODE_GROUP_DEFAULT] = GIMP_LAYER_MODE_BEHIND,
|
|
|
|
[GIMP_LAYER_MODE_GROUP_LEGACY ] = GIMP_LAYER_MODE_BEHIND_LEGACY
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
2017-02-20 14:20:39 -05:00
|
|
|
{ [GIMP_LAYER_MODE_GROUP_DEFAULT] = GIMP_LAYER_MODE_MULTIPLY,
|
|
|
|
[GIMP_LAYER_MODE_GROUP_LEGACY ] = GIMP_LAYER_MODE_MULTIPLY_LEGACY
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
2017-02-20 14:20:39 -05:00
|
|
|
{ [GIMP_LAYER_MODE_GROUP_DEFAULT] = GIMP_LAYER_MODE_SCREEN,
|
|
|
|
[GIMP_LAYER_MODE_GROUP_LEGACY ] = GIMP_LAYER_MODE_SCREEN_LEGACY
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
2017-02-20 14:20:39 -05:00
|
|
|
{ [GIMP_LAYER_MODE_GROUP_DEFAULT] = GIMP_LAYER_MODE_OVERLAY,
|
|
|
|
[GIMP_LAYER_MODE_GROUP_LEGACY ] = -1
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
2017-02-20 14:20:39 -05:00
|
|
|
{ [GIMP_LAYER_MODE_GROUP_DEFAULT] = GIMP_LAYER_MODE_DIFFERENCE,
|
|
|
|
[GIMP_LAYER_MODE_GROUP_LEGACY ] = GIMP_LAYER_MODE_DIFFERENCE_LEGACY
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
2017-02-20 14:20:39 -05:00
|
|
|
{ [GIMP_LAYER_MODE_GROUP_DEFAULT] = GIMP_LAYER_MODE_ADDITION,
|
|
|
|
[GIMP_LAYER_MODE_GROUP_LEGACY ] = GIMP_LAYER_MODE_ADDITION_LEGACY
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
2017-02-20 14:20:39 -05:00
|
|
|
{ [GIMP_LAYER_MODE_GROUP_DEFAULT] = GIMP_LAYER_MODE_SUBTRACT,
|
|
|
|
[GIMP_LAYER_MODE_GROUP_LEGACY ] = GIMP_LAYER_MODE_SUBTRACT_LEGACY
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
2017-02-20 14:20:39 -05:00
|
|
|
{ [GIMP_LAYER_MODE_GROUP_DEFAULT] = GIMP_LAYER_MODE_DARKEN_ONLY,
|
|
|
|
[GIMP_LAYER_MODE_GROUP_LEGACY ] = GIMP_LAYER_MODE_DARKEN_ONLY_LEGACY
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
2017-02-20 14:20:39 -05:00
|
|
|
{ [GIMP_LAYER_MODE_GROUP_DEFAULT] = GIMP_LAYER_MODE_LIGHTEN_ONLY,
|
|
|
|
[GIMP_LAYER_MODE_GROUP_LEGACY ] = GIMP_LAYER_MODE_LIGHTEN_ONLY_LEGACY
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
2017-02-20 14:20:39 -05:00
|
|
|
{ [GIMP_LAYER_MODE_GROUP_DEFAULT] = GIMP_LAYER_MODE_HSV_HUE,
|
|
|
|
[GIMP_LAYER_MODE_GROUP_LEGACY ] = GIMP_LAYER_MODE_HSV_HUE_LEGACY
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
2017-02-20 14:20:39 -05:00
|
|
|
{ [GIMP_LAYER_MODE_GROUP_DEFAULT] = GIMP_LAYER_MODE_HSV_SATURATION,
|
|
|
|
[GIMP_LAYER_MODE_GROUP_LEGACY ] = GIMP_LAYER_MODE_HSV_SATURATION_LEGACY
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
2017-03-15 19:30:01 -04:00
|
|
|
{ [GIMP_LAYER_MODE_GROUP_DEFAULT] = GIMP_LAYER_MODE_HSL_COLOR,
|
2017-03-16 06:17:05 -04:00
|
|
|
[GIMP_LAYER_MODE_GROUP_LEGACY ] = GIMP_LAYER_MODE_HSL_COLOR_LEGACY
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
2017-02-20 14:20:39 -05:00
|
|
|
{ [GIMP_LAYER_MODE_GROUP_DEFAULT] = GIMP_LAYER_MODE_HSV_VALUE,
|
|
|
|
[GIMP_LAYER_MODE_GROUP_LEGACY ] = GIMP_LAYER_MODE_HSV_VALUE_LEGACY
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
2017-02-20 14:20:39 -05:00
|
|
|
{ [GIMP_LAYER_MODE_GROUP_DEFAULT] = GIMP_LAYER_MODE_DIVIDE,
|
|
|
|
[GIMP_LAYER_MODE_GROUP_LEGACY ] = GIMP_LAYER_MODE_DIVIDE_LEGACY
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
2017-02-20 14:20:39 -05:00
|
|
|
{ [GIMP_LAYER_MODE_GROUP_DEFAULT] = GIMP_LAYER_MODE_DODGE,
|
|
|
|
[GIMP_LAYER_MODE_GROUP_LEGACY ] = GIMP_LAYER_MODE_DODGE_LEGACY
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
2017-02-20 14:20:39 -05:00
|
|
|
{ [GIMP_LAYER_MODE_GROUP_DEFAULT] = GIMP_LAYER_MODE_BURN,
|
|
|
|
[GIMP_LAYER_MODE_GROUP_LEGACY ] = GIMP_LAYER_MODE_BURN_LEGACY
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
2017-02-20 14:20:39 -05:00
|
|
|
{ [GIMP_LAYER_MODE_GROUP_DEFAULT] = GIMP_LAYER_MODE_HARDLIGHT,
|
|
|
|
[GIMP_LAYER_MODE_GROUP_LEGACY ] = GIMP_LAYER_MODE_HARDLIGHT_LEGACY
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
2017-02-20 14:20:39 -05:00
|
|
|
{ [GIMP_LAYER_MODE_GROUP_DEFAULT] = GIMP_LAYER_MODE_SOFTLIGHT,
|
|
|
|
[GIMP_LAYER_MODE_GROUP_LEGACY ] = GIMP_LAYER_MODE_SOFTLIGHT_LEGACY
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
2017-02-20 14:20:39 -05:00
|
|
|
{ [GIMP_LAYER_MODE_GROUP_DEFAULT] = GIMP_LAYER_MODE_GRAIN_EXTRACT,
|
|
|
|
[GIMP_LAYER_MODE_GROUP_LEGACY ] = GIMP_LAYER_MODE_GRAIN_EXTRACT_LEGACY
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
2017-02-20 14:20:39 -05:00
|
|
|
{ [GIMP_LAYER_MODE_GROUP_DEFAULT] = GIMP_LAYER_MODE_GRAIN_MERGE,
|
|
|
|
[GIMP_LAYER_MODE_GROUP_LEGACY ] = GIMP_LAYER_MODE_GRAIN_MERGE_LEGACY
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
2017-02-20 14:20:39 -05:00
|
|
|
{ [GIMP_LAYER_MODE_GROUP_DEFAULT] = GIMP_LAYER_MODE_COLOR_ERASE,
|
2017-03-08 13:06:46 -05:00
|
|
|
[GIMP_LAYER_MODE_GROUP_LEGACY ] = GIMP_LAYER_MODE_COLOR_ERASE_LEGACY,
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
2017-02-20 14:20:39 -05:00
|
|
|
{ [GIMP_LAYER_MODE_GROUP_DEFAULT] = GIMP_LAYER_MODE_VIVID_LIGHT,
|
|
|
|
[GIMP_LAYER_MODE_GROUP_LEGACY ] = -1
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
2017-02-20 14:20:39 -05:00
|
|
|
{ [GIMP_LAYER_MODE_GROUP_DEFAULT] = GIMP_LAYER_MODE_PIN_LIGHT,
|
|
|
|
[GIMP_LAYER_MODE_GROUP_LEGACY ] = -1
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
2017-02-20 14:20:39 -05:00
|
|
|
{ [GIMP_LAYER_MODE_GROUP_DEFAULT] = GIMP_LAYER_MODE_LINEAR_LIGHT,
|
|
|
|
[GIMP_LAYER_MODE_GROUP_LEGACY ] = -1
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
2017-02-20 14:20:39 -05:00
|
|
|
{ [GIMP_LAYER_MODE_GROUP_DEFAULT] = GIMP_LAYER_MODE_HARD_MIX,
|
|
|
|
[GIMP_LAYER_MODE_GROUP_LEGACY ] = -1
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
2017-02-20 14:20:39 -05:00
|
|
|
{ [GIMP_LAYER_MODE_GROUP_DEFAULT] = GIMP_LAYER_MODE_EXCLUSION,
|
|
|
|
[GIMP_LAYER_MODE_GROUP_LEGACY ] = -1
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
2017-02-20 14:20:39 -05:00
|
|
|
{ [GIMP_LAYER_MODE_GROUP_DEFAULT] = GIMP_LAYER_MODE_LINEAR_BURN,
|
|
|
|
[GIMP_LAYER_MODE_GROUP_LEGACY ] = -1
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
2017-02-20 14:20:39 -05:00
|
|
|
{ [GIMP_LAYER_MODE_GROUP_DEFAULT] = GIMP_LAYER_MODE_LUMA_DARKEN_ONLY,
|
|
|
|
[GIMP_LAYER_MODE_GROUP_LEGACY ] = -1
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
2017-02-20 14:20:39 -05:00
|
|
|
{ [GIMP_LAYER_MODE_GROUP_DEFAULT] = GIMP_LAYER_MODE_LUMA_LIGHTEN_ONLY,
|
|
|
|
[GIMP_LAYER_MODE_GROUP_LEGACY ] = -1
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
2017-02-20 14:20:39 -05:00
|
|
|
{ [GIMP_LAYER_MODE_GROUP_DEFAULT] = GIMP_LAYER_MODE_LUMINANCE,
|
|
|
|
[GIMP_LAYER_MODE_GROUP_LEGACY ] = -1
|
2017-02-20 13:36:00 -05:00
|
|
|
},
|
|
|
|
|
2017-02-20 14:20:39 -05:00
|
|
|
{ [GIMP_LAYER_MODE_GROUP_DEFAULT] = GIMP_LAYER_MODE_ERASE,
|
|
|
|
[GIMP_LAYER_MODE_GROUP_LEGACY ] = -1
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
2017-03-10 17:59:17 -05:00
|
|
|
{ [GIMP_LAYER_MODE_GROUP_DEFAULT] = GIMP_LAYER_MODE_MERGE,
|
|
|
|
[GIMP_LAYER_MODE_GROUP_LEGACY ] = -1
|
|
|
|
},
|
|
|
|
|
2017-03-10 18:28:40 -05:00
|
|
|
{ [GIMP_LAYER_MODE_GROUP_DEFAULT] = GIMP_LAYER_MODE_SPLIT,
|
|
|
|
[GIMP_LAYER_MODE_GROUP_LEGACY ] = -1
|
|
|
|
},
|
|
|
|
|
2017-04-21 13:38:22 -04:00
|
|
|
{ [GIMP_LAYER_MODE_GROUP_DEFAULT] = GIMP_LAYER_MODE_PASS_THROUGH,
|
|
|
|
[GIMP_LAYER_MODE_GROUP_LEGACY ] = -1,
|
|
|
|
},
|
|
|
|
|
2017-02-20 14:20:39 -05:00
|
|
|
{ [GIMP_LAYER_MODE_GROUP_DEFAULT] = GIMP_LAYER_MODE_REPLACE,
|
|
|
|
[GIMP_LAYER_MODE_GROUP_LEGACY ] = -1
|
2017-02-05 15:59:29 +01:00
|
|
|
},
|
|
|
|
|
2017-02-20 14:20:39 -05:00
|
|
|
{ [GIMP_LAYER_MODE_GROUP_DEFAULT] = GIMP_LAYER_MODE_ANTI_ERASE,
|
|
|
|
[GIMP_LAYER_MODE_GROUP_LEGACY ] = -1
|
2017-02-05 16:30:54 +01:00
|
|
|
}
|
2017-02-05 15:59:29 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/* public functions */
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_layer_modes_init (void)
|
|
|
|
{
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
for (i = 0; i < G_N_ELEMENTS (layer_mode_infos); i++)
|
|
|
|
{
|
|
|
|
g_assert ((GimpLayerMode) i == layer_mode_infos[i].layer_mode);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-02-05 16:06:53 +01:00
|
|
|
static const GimpLayerModeInfo *
|
2017-02-05 15:59:29 +01:00
|
|
|
gimp_layer_mode_info (GimpLayerMode mode)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (mode < G_N_ELEMENTS (layer_mode_infos),
|
|
|
|
&layer_mode_infos[0]);
|
|
|
|
|
|
|
|
return &layer_mode_infos[mode];
|
|
|
|
}
|
|
|
|
|
|
|
|
gboolean
|
2017-02-20 14:20:39 -05:00
|
|
|
gimp_layer_mode_is_legacy (GimpLayerMode mode)
|
2017-02-05 15:59:29 +01:00
|
|
|
{
|
|
|
|
const GimpLayerModeInfo *info = gimp_layer_mode_info (mode);
|
2017-02-20 14:20:39 -05:00
|
|
|
|
|
|
|
if (! info)
|
2017-02-05 15:59:29 +01:00
|
|
|
return FALSE;
|
2017-02-20 14:20:39 -05:00
|
|
|
|
2017-02-05 15:59:29 +01:00
|
|
|
return (info->flags & GIMP_LAYER_MODE_FLAG_LEGACY) != 0;
|
|
|
|
}
|
|
|
|
|
2017-02-13 22:12:39 +01:00
|
|
|
gboolean
|
2017-02-20 14:20:39 -05:00
|
|
|
gimp_layer_mode_is_blend_space_mutable (GimpLayerMode mode)
|
2017-02-13 22:12:39 +01:00
|
|
|
{
|
|
|
|
const GimpLayerModeInfo *info = gimp_layer_mode_info (mode);
|
2017-02-20 14:20:39 -05:00
|
|
|
|
|
|
|
if (! info)
|
2017-02-13 22:12:39 +01:00
|
|
|
return FALSE;
|
2017-02-20 14:20:39 -05:00
|
|
|
|
2017-02-13 22:12:39 +01:00
|
|
|
return (info->flags & GIMP_LAYER_MODE_FLAG_BLEND_SPACE_IMMUTABLE) == 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
gboolean
|
2017-02-20 14:20:39 -05:00
|
|
|
gimp_layer_mode_is_composite_space_mutable (GimpLayerMode mode)
|
2017-02-13 22:12:39 +01:00
|
|
|
{
|
|
|
|
const GimpLayerModeInfo *info = gimp_layer_mode_info (mode);
|
2017-02-20 14:20:39 -05:00
|
|
|
|
|
|
|
if (! info)
|
2017-02-13 22:12:39 +01:00
|
|
|
return FALSE;
|
2017-02-20 14:20:39 -05:00
|
|
|
|
2017-02-13 22:12:39 +01:00
|
|
|
return (info->flags & GIMP_LAYER_MODE_FLAG_COMPOSITE_SPACE_IMMUTABLE) == 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
gboolean
|
2017-02-20 14:20:39 -05:00
|
|
|
gimp_layer_mode_is_composite_mode_mutable (GimpLayerMode mode)
|
2017-02-13 22:12:39 +01:00
|
|
|
{
|
|
|
|
const GimpLayerModeInfo *info = gimp_layer_mode_info (mode);
|
2017-02-20 14:20:39 -05:00
|
|
|
|
|
|
|
if (! info)
|
2017-02-13 22:12:39 +01:00
|
|
|
return FALSE;
|
2017-02-20 14:20:39 -05:00
|
|
|
|
2017-02-13 22:12:39 +01:00
|
|
|
return (info->flags & GIMP_LAYER_MODE_FLAG_COMPOSITE_MODE_IMMUTABLE) == 0;
|
|
|
|
}
|
|
|
|
|
2017-03-08 06:36:39 -05:00
|
|
|
gboolean
|
|
|
|
gimp_layer_mode_is_subtractive (GimpLayerMode mode)
|
|
|
|
{
|
|
|
|
const GimpLayerModeInfo *info = gimp_layer_mode_info (mode);
|
|
|
|
|
|
|
|
if (! info)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
return (info->flags & GIMP_LAYER_MODE_FLAG_SUBTRACTIVE) != 0;
|
|
|
|
}
|
|
|
|
|
2017-02-05 15:59:29 +01:00
|
|
|
GimpLayerColorSpace
|
2017-02-20 14:20:39 -05:00
|
|
|
gimp_layer_mode_get_blend_space (GimpLayerMode mode)
|
2017-02-05 15:59:29 +01:00
|
|
|
{
|
|
|
|
const GimpLayerModeInfo *info = gimp_layer_mode_info (mode);
|
2017-02-20 14:20:39 -05:00
|
|
|
|
|
|
|
if (! info)
|
2017-02-05 15:59:29 +01:00
|
|
|
return GIMP_LAYER_COLOR_SPACE_RGB_LINEAR;
|
2017-02-20 14:20:39 -05:00
|
|
|
|
2017-02-05 15:59:29 +01:00
|
|
|
return info->blend_space;
|
|
|
|
}
|
|
|
|
|
|
|
|
GimpLayerColorSpace
|
2017-02-20 14:20:39 -05:00
|
|
|
gimp_layer_mode_get_composite_space (GimpLayerMode mode)
|
2017-02-05 15:59:29 +01:00
|
|
|
{
|
|
|
|
const GimpLayerModeInfo *info = gimp_layer_mode_info (mode);
|
2017-02-20 14:20:39 -05:00
|
|
|
|
|
|
|
if (! info)
|
2017-02-05 15:59:29 +01:00
|
|
|
return GIMP_LAYER_COLOR_SPACE_RGB_LINEAR;
|
2017-02-20 14:20:39 -05:00
|
|
|
|
2017-02-05 15:59:29 +01:00
|
|
|
return info->composite_space;
|
|
|
|
}
|
|
|
|
|
|
|
|
GimpLayerCompositeMode
|
2017-02-20 14:20:39 -05:00
|
|
|
gimp_layer_mode_get_composite_mode (GimpLayerMode mode)
|
2017-02-05 15:59:29 +01:00
|
|
|
{
|
|
|
|
const GimpLayerModeInfo *info = gimp_layer_mode_info (mode);
|
2017-02-20 14:20:39 -05:00
|
|
|
|
|
|
|
if (! info)
|
2017-02-05 15:59:29 +01:00
|
|
|
return GIMP_LAYER_COMPOSITE_SRC_OVER;
|
2017-02-20 14:20:39 -05:00
|
|
|
|
2017-02-05 15:59:29 +01:00
|
|
|
return info->composite_mode;
|
|
|
|
}
|
|
|
|
|
2017-02-14 22:51:47 +01:00
|
|
|
GimpLayerCompositeMode
|
2017-02-20 14:20:39 -05:00
|
|
|
gimp_layer_mode_get_paint_composite_mode (GimpLayerMode mode)
|
2017-02-14 22:51:47 +01:00
|
|
|
{
|
|
|
|
const GimpLayerModeInfo *info = gimp_layer_mode_info (mode);
|
2017-02-20 14:20:39 -05:00
|
|
|
|
|
|
|
if (! info)
|
2017-02-14 22:51:47 +01:00
|
|
|
return GIMP_LAYER_COMPOSITE_SRC_OVER;
|
2017-02-20 14:20:39 -05:00
|
|
|
|
2017-02-14 22:51:47 +01:00
|
|
|
return info->paint_composite_mode;
|
|
|
|
}
|
|
|
|
|
2017-02-05 15:59:29 +01:00
|
|
|
const gchar *
|
2017-02-20 14:20:39 -05:00
|
|
|
gimp_layer_mode_get_operation (GimpLayerMode mode)
|
2017-02-05 15:59:29 +01:00
|
|
|
{
|
app: move bottom-layer special casing to GimpOperationLayerMode
GimpFilter's is_last_node field only reflects the item's position
within the parent stack. When a layer is contained in a pass-
through group, it can be the last layer of the group, while not
being the last layer in the graph as a whole (paticularly, if
there are visible layers below the group). In fact, when we have
nested pass-through groups, whether or not a layer is the last
node depends on which group we're considering as the root (since
we exclude the backdrop from the group's projection, resulting in
different graphs for different groups).
Instead of rolling our own graph traversal, just move the relevant
logic to GimpOperationLayerMode, and let GEGL do the work for us.
At processing time, we can tell if we're the last node by checking
if we have any input.
For this to work, GimpOperationLayerMode's process() function needs
to have control over what's going on. Replace the derived op
classes, which override process(), with a call to the layer mode's
function (as per gimp_layer_mode_get_function()) in
GimpOperationLayerMode's process() function. (Well, actually, this
commit keeps the ops around, and just hacks around them in
gimp_layer_mode_get_operation(), because laziness :P)
Keep using the layer's is_last_node property to do the invalidation.
2017-04-21 19:42:04 -04:00
|
|
|
return "gimp:layer-mode";
|
2017-02-05 15:59:29 +01:00
|
|
|
}
|
|
|
|
|
2017-02-15 02:25:44 +01:00
|
|
|
GimpLayerModeFunc
|
2017-02-20 14:20:39 -05:00
|
|
|
gimp_layer_mode_get_function (GimpLayerMode mode)
|
2017-02-15 02:25:44 +01:00
|
|
|
{
|
|
|
|
const GimpLayerModeInfo *info = gimp_layer_mode_info (mode);
|
2017-02-20 14:20:39 -05:00
|
|
|
|
|
|
|
if (! info)
|
2017-02-15 02:25:44 +01:00
|
|
|
return gimp_operation_layer_mode_process_pixels;
|
2017-02-20 14:20:39 -05:00
|
|
|
|
2017-02-15 02:25:44 +01:00
|
|
|
return info->function;
|
|
|
|
}
|
|
|
|
|
2017-02-17 03:49:29 -05:00
|
|
|
GimpLayerModeContext
|
|
|
|
gimp_layer_mode_get_context (GimpLayerMode mode)
|
|
|
|
{
|
|
|
|
const GimpLayerModeInfo *info = gimp_layer_mode_info (mode);
|
2017-02-20 14:20:39 -05:00
|
|
|
|
|
|
|
if (! info)
|
2017-02-17 03:49:29 -05:00
|
|
|
return 0;
|
2017-02-20 14:20:39 -05:00
|
|
|
|
2017-02-17 03:49:29 -05:00
|
|
|
return info->context;
|
|
|
|
}
|
|
|
|
|
2017-02-20 23:51:32 +01:00
|
|
|
GimpLayerMode *
|
|
|
|
gimp_layer_mode_get_context_array (GimpLayerMode mode,
|
|
|
|
GimpLayerModeContext context,
|
|
|
|
gint *n_modes)
|
|
|
|
{
|
|
|
|
GimpLayerModeGroup group;
|
|
|
|
const GimpLayerMode *group_modes;
|
|
|
|
gint n_group_modes;
|
|
|
|
GimpLayerMode *array;
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
group = gimp_layer_mode_get_group (mode);
|
|
|
|
|
|
|
|
group_modes = gimp_layer_mode_get_group_array (group, &n_group_modes);
|
|
|
|
|
|
|
|
array = g_new0 (GimpLayerMode, n_group_modes);
|
|
|
|
*n_modes = 0;
|
|
|
|
|
|
|
|
for (i = 0; i < n_group_modes; i++)
|
|
|
|
{
|
|
|
|
if (group_modes[i] != GIMP_LAYER_MODE_SEPARATOR &&
|
|
|
|
(gimp_layer_mode_get_context (group_modes[i]) & context))
|
|
|
|
{
|
|
|
|
array[*n_modes] = group_modes[i];
|
|
|
|
(*n_modes)++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return array;
|
|
|
|
}
|
|
|
|
|
2017-02-05 15:59:29 +01:00
|
|
|
static gboolean
|
|
|
|
is_mode_in_array (const GimpLayerMode *modes,
|
|
|
|
gint n_modes,
|
|
|
|
GimpLayerMode mode)
|
|
|
|
{
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
for (i = 0; i < n_modes; i++)
|
2017-02-20 14:20:39 -05:00
|
|
|
{
|
|
|
|
if (modes[i] == mode)
|
|
|
|
return TRUE;
|
|
|
|
}
|
2017-02-05 15:59:29 +01:00
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
GimpLayerModeGroup
|
2017-02-20 14:20:39 -05:00
|
|
|
gimp_layer_mode_get_group (GimpLayerMode mode)
|
2017-02-05 15:59:29 +01:00
|
|
|
{
|
|
|
|
if (is_mode_in_array (layer_mode_group_default,
|
|
|
|
G_N_ELEMENTS (layer_mode_group_default), mode))
|
|
|
|
{
|
|
|
|
return GIMP_LAYER_MODE_GROUP_DEFAULT;
|
|
|
|
}
|
|
|
|
else if (is_mode_in_array (layer_mode_group_legacy,
|
|
|
|
G_N_ELEMENTS (layer_mode_group_legacy), mode))
|
|
|
|
{
|
|
|
|
return GIMP_LAYER_MODE_GROUP_LEGACY;
|
|
|
|
}
|
|
|
|
|
|
|
|
return GIMP_LAYER_MODE_GROUP_DEFAULT;
|
|
|
|
}
|
|
|
|
|
|
|
|
const GimpLayerMode *
|
|
|
|
gimp_layer_mode_get_group_array (GimpLayerModeGroup group,
|
|
|
|
gint *n_modes)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (n_modes != NULL, NULL);
|
|
|
|
|
|
|
|
switch (group)
|
|
|
|
{
|
|
|
|
case GIMP_LAYER_MODE_GROUP_DEFAULT:
|
|
|
|
*n_modes = G_N_ELEMENTS (layer_mode_group_default);
|
|
|
|
return layer_mode_group_default;
|
|
|
|
|
|
|
|
case GIMP_LAYER_MODE_GROUP_LEGACY:
|
|
|
|
*n_modes = G_N_ELEMENTS (layer_mode_group_legacy);
|
|
|
|
return layer_mode_group_legacy;
|
|
|
|
|
|
|
|
default:
|
|
|
|
g_return_val_if_reached (NULL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
gboolean
|
|
|
|
gimp_layer_mode_get_for_group (GimpLayerMode old_mode,
|
|
|
|
GimpLayerModeGroup new_group,
|
|
|
|
GimpLayerMode *new_mode)
|
|
|
|
{
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
g_return_val_if_fail (new_mode != NULL, FALSE);
|
|
|
|
|
|
|
|
for (i = 0; i < G_N_ELEMENTS (layer_mode_groups); i++)
|
|
|
|
{
|
2017-02-19 23:14:44 +01:00
|
|
|
if (is_mode_in_array (layer_mode_groups[i], 2, old_mode))
|
2017-02-05 15:59:29 +01:00
|
|
|
{
|
|
|
|
*new_mode = layer_mode_groups[i][new_group];
|
|
|
|
|
|
|
|
if (*new_mode != -1)
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
*new_mode = -1;
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
2017-02-17 10:20:04 -05:00
|
|
|
|
|
|
|
const Babl *
|
|
|
|
gimp_layer_mode_get_format (GimpLayerMode mode,
|
|
|
|
GimpLayerColorSpace composite_space,
|
|
|
|
GimpLayerColorSpace blend_space,
|
|
|
|
const Babl *preferred_format)
|
|
|
|
{
|
|
|
|
/* for now, all modes perform i/o in the composite space. */
|
|
|
|
(void) mode;
|
|
|
|
(void) blend_space;
|
|
|
|
|
|
|
|
if (composite_space == GIMP_LAYER_COLOR_SPACE_AUTO)
|
|
|
|
composite_space = gimp_layer_mode_get_composite_space (mode);
|
|
|
|
|
|
|
|
switch (composite_space)
|
|
|
|
{
|
|
|
|
case GIMP_LAYER_COLOR_SPACE_AUTO:
|
|
|
|
/* compositing is color-space agnostic. try to return the preferred
|
|
|
|
* format, and fall back to linear.
|
|
|
|
*/
|
|
|
|
if (preferred_format == babl_format ("RGBA float") ||
|
|
|
|
preferred_format == babl_format ("R'G'B'A float"))
|
|
|
|
{
|
|
|
|
return preferred_format;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return babl_format ("RGBA float");
|
|
|
|
}
|
|
|
|
|
|
|
|
case GIMP_LAYER_COLOR_SPACE_RGB_LINEAR:
|
|
|
|
return babl_format ("RGBA float");
|
|
|
|
|
|
|
|
case GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL:
|
|
|
|
return babl_format ("R'G'B'A float");
|
|
|
|
|
|
|
|
case GIMP_LAYER_COLOR_SPACE_LAB:
|
|
|
|
return babl_format ("CIE Lab alpha float");
|
|
|
|
}
|
|
|
|
|
|
|
|
g_return_val_if_reached (babl_format ("RGBA float"));
|
|
|
|
}
|
2017-05-11 15:46:59 -04:00
|
|
|
|
app: move bottom-layer special casing to GimpOperationLayerMode
GimpFilter's is_last_node field only reflects the item's position
within the parent stack. When a layer is contained in a pass-
through group, it can be the last layer of the group, while not
being the last layer in the graph as a whole (paticularly, if
there are visible layers below the group). In fact, when we have
nested pass-through groups, whether or not a layer is the last
node depends on which group we're considering as the root (since
we exclude the backdrop from the group's projection, resulting in
different graphs for different groups).
Instead of rolling our own graph traversal, just move the relevant
logic to GimpOperationLayerMode, and let GEGL do the work for us.
At processing time, we can tell if we're the last node by checking
if we have any input.
For this to work, GimpOperationLayerMode's process() function needs
to have control over what's going on. Replace the derived op
classes, which override process(), with a call to the layer mode's
function (as per gimp_layer_mode_get_function()) in
GimpOperationLayerMode's process() function. (Well, actually, this
commit keeps the ops around, and just hacks around them in
gimp_layer_mode_get_operation(), because laziness :P)
Keep using the layer's is_last_node property to do the invalidation.
2017-04-21 19:42:04 -04:00
|
|
|
GimpLayerCompositeRegion
|
|
|
|
gimp_layer_mode_get_affected_region (GimpLayerMode mode)
|
|
|
|
{
|
|
|
|
const GimpLayerModeInfo *info = gimp_layer_mode_info (mode);
|
|
|
|
|
|
|
|
if (! info)
|
|
|
|
return GIMP_LAYER_COMPOSITE_REGION_INTERSECTION;
|
|
|
|
|
|
|
|
return info->affected_region;
|
|
|
|
}
|
|
|
|
|
2017-05-11 15:46:59 -04:00
|
|
|
GimpLayerCompositeRegion
|
|
|
|
gimp_layer_mode_get_included_region (GimpLayerMode mode,
|
|
|
|
GimpLayerCompositeMode composite_mode)
|
|
|
|
{
|
|
|
|
if (composite_mode == GIMP_LAYER_COMPOSITE_AUTO)
|
|
|
|
composite_mode = gimp_layer_mode_get_composite_mode (mode);
|
|
|
|
|
|
|
|
switch (composite_mode)
|
|
|
|
{
|
|
|
|
case GIMP_LAYER_COMPOSITE_SRC_OVER:
|
|
|
|
return GIMP_LAYER_COMPOSITE_REGION_UNION;
|
|
|
|
|
|
|
|
case GIMP_LAYER_COMPOSITE_SRC_ATOP:
|
|
|
|
return GIMP_LAYER_COMPOSITE_REGION_DESTINATION;
|
|
|
|
|
|
|
|
case GIMP_LAYER_COMPOSITE_DST_ATOP:
|
|
|
|
return GIMP_LAYER_COMPOSITE_REGION_SOURCE;
|
|
|
|
|
|
|
|
case GIMP_LAYER_COMPOSITE_SRC_IN:
|
|
|
|
return GIMP_LAYER_COMPOSITE_REGION_INTERSECTION;
|
|
|
|
|
|
|
|
default:
|
|
|
|
g_return_val_if_reached (GIMP_LAYER_COMPOSITE_REGION_INTERSECTION);
|
|
|
|
}
|
|
|
|
}
|