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"
|
|
|
|
|
app: layer mode code shuffling
Commit 3635cf04ab69bafb76d7583da804f580f2d5fbf3 moved the special
handling of bottom-layer compositing to GimpOperationLayerMode.
This required giving the op more control over the process()
function of its subclasses. As a temporary workaround, the commit
bypassed the subclasses entirely, using "gimp:layer-mode" for all
modes. This is the reckoning :)
Add a process() virtual function to GimpOperationLayerMode, which
its subclasses should override instead of
GeglOperationPointComposer3's process() functions. Reinstate the
subclasses (by returning the correct op in
gimp_layer_mode_get_oepration()), and have them override this
function.
Improve the way gimp_operation_layer_mode_process() dispatches to
the actual process function, to slightly lower its overhead and
fix some thread-safety issues.
Remove the "function" field of the layer-mode info array, and have
gimp_layer_mode_get_function() return the
GimpOperationLayerMode::process() function of the corresponding
op's class (caching the result, to keep it cheap.) This reduces
redundancy, allows us to make the ops' process() functions private,
and simplifies SSE dispatching (only used by NORMAL mode,
currently.)
Move the blend and composite functions of the non-specialized
layer modes to gimpoperationlayermode-{blend,composite}.[hc],
respectively, to improve code organization.
Move the SSE2 composite functions to a separate file, so that they
can be built as part of libapplayermodes_sse2, allowing
libapplayermodes to be built without SSE2 compiler flags. This
allows building GIMP with SSE acceleration enabled, while running
the resulting binary on a target with no SSE accelration.
Add a "blend_function" field to the layer-mode info array, and use
it to specify the blend function for the non-specialized modes.
This replaces the separate switch() statement that we used
previously.
Remove the "affected_region" field of the layer-mode info array.
We don't need it anymore, since we can go back to using
GimpOperationLayerMode's virtual get_affected_region() function.
Last but not least, a bunch of code cleanups and consistency
adjustments.
2017-08-17 10:26:49 -04:00
|
|
|
#include "gimpoperationlayermode.h"
|
|
|
|
#include "gimpoperationlayermode-blend.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;
|
app: layer mode code shuffling
Commit 3635cf04ab69bafb76d7583da804f580f2d5fbf3 moved the special
handling of bottom-layer compositing to GimpOperationLayerMode.
This required giving the op more control over the process()
function of its subclasses. As a temporary workaround, the commit
bypassed the subclasses entirely, using "gimp:layer-mode" for all
modes. This is the reckoning :)
Add a process() virtual function to GimpOperationLayerMode, which
its subclasses should override instead of
GeglOperationPointComposer3's process() functions. Reinstate the
subclasses (by returning the correct op in
gimp_layer_mode_get_oepration()), and have them override this
function.
Improve the way gimp_operation_layer_mode_process() dispatches to
the actual process function, to slightly lower its overhead and
fix some thread-safety issues.
Remove the "function" field of the layer-mode info array, and have
gimp_layer_mode_get_function() return the
GimpOperationLayerMode::process() function of the corresponding
op's class (caching the result, to keep it cheap.) This reduces
redundancy, allows us to make the ops' process() functions private,
and simplifies SSE dispatching (only used by NORMAL mode,
currently.)
Move the blend and composite functions of the non-specialized
layer modes to gimpoperationlayermode-{blend,composite}.[hc],
respectively, to improve code organization.
Move the SSE2 composite functions to a separate file, so that they
can be built as part of libapplayermodes_sse2, allowing
libapplayermodes to be built without SSE2 compiler flags. This
allows building GIMP with SSE acceleration enabled, while running
the resulting binary on a target with no SSE accelration.
Add a "blend_function" field to the layer-mode info array, and use
it to specify the blend function for the non-specialized modes.
This replaces the separate switch() statement that we used
previously.
Remove the "affected_region" field of the layer-mode info array.
We don't need it anymore, since we can go back to using
GimpOperationLayerMode's virtual get_affected_region() function.
Last but not least, a bunch of code cleanups and consistency
adjustments.
2017-08-17 10:26:49 -04:00
|
|
|
GimpLayerModeBlendFunc blend_function;
|
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
|
|
|
GimpLayerModeFlags flags;
|
|
|
|
GimpLayerModeContext context;
|
|
|
|
GimpLayerCompositeMode paint_composite_mode;
|
|
|
|
GimpLayerCompositeMode composite_mode;
|
|
|
|
GimpLayerColorSpace composite_space;
|
|
|
|
GimpLayerColorSpace blend_space;
|
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",
|
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",
|
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: layer mode code shuffling
Commit 3635cf04ab69bafb76d7583da804f580f2d5fbf3 moved the special
handling of bottom-layer compositing to GimpOperationLayerMode.
This required giving the op more control over the process()
function of its subclasses. As a temporary workaround, the commit
bypassed the subclasses entirely, using "gimp:layer-mode" for all
modes. This is the reckoning :)
Add a process() virtual function to GimpOperationLayerMode, which
its subclasses should override instead of
GeglOperationPointComposer3's process() functions. Reinstate the
subclasses (by returning the correct op in
gimp_layer_mode_get_oepration()), and have them override this
function.
Improve the way gimp_operation_layer_mode_process() dispatches to
the actual process function, to slightly lower its overhead and
fix some thread-safety issues.
Remove the "function" field of the layer-mode info array, and have
gimp_layer_mode_get_function() return the
GimpOperationLayerMode::process() function of the corresponding
op's class (caching the result, to keep it cheap.) This reduces
redundancy, allows us to make the ops' process() functions private,
and simplifies SSE dispatching (only used by NORMAL mode,
currently.)
Move the blend and composite functions of the non-specialized
layer modes to gimpoperationlayermode-{blend,composite}.[hc],
respectively, to improve code organization.
Move the SSE2 composite functions to a separate file, so that they
can be built as part of libapplayermodes_sse2, allowing
libapplayermodes to be built without SSE2 compiler flags. This
allows building GIMP with SSE acceleration enabled, while running
the resulting binary on a target with no SSE accelration.
Add a "blend_function" field to the layer-mode info array, and use
it to specify the blend function for the non-specialized modes.
This replaces the separate switch() statement that we used
previously.
Remove the "affected_region" field of the layer-mode info array.
We don't need it anymore, since we can go back to using
GimpOperationLayerMode's virtual get_affected_region() function.
Last but not least, a bunch of code cleanups and consistency
adjustments.
2017-08-17 10:26:49 -04:00
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_OVER
|
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",
|
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",
|
|
|
|
.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",
|
|
|
|
.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",
|
|
|
|
.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",
|
|
|
|
.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",
|
|
|
|
.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",
|
|
|
|
.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",
|
|
|
|
.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",
|
|
|
|
.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",
|
|
|
|
.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",
|
|
|
|
.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",
|
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",
|
|
|
|
.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",
|
|
|
|
.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",
|
|
|
|
.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",
|
|
|
|
.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",
|
|
|
|
.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",
|
|
|
|
.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",
|
|
|
|
.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",
|
|
|
|
.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",
|
2017-08-19 15:30:28 -04:00
|
|
|
.blend_function = gimp_operation_layer_mode_blend_color_erase,
|
2017-03-08 13:06:46 -05:00
|
|
|
.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",
|
app: layer mode code shuffling
Commit 3635cf04ab69bafb76d7583da804f580f2d5fbf3 moved the special
handling of bottom-layer compositing to GimpOperationLayerMode.
This required giving the op more control over the process()
function of its subclasses. As a temporary workaround, the commit
bypassed the subclasses entirely, using "gimp:layer-mode" for all
modes. This is the reckoning :)
Add a process() virtual function to GimpOperationLayerMode, which
its subclasses should override instead of
GeglOperationPointComposer3's process() functions. Reinstate the
subclasses (by returning the correct op in
gimp_layer_mode_get_oepration()), and have them override this
function.
Improve the way gimp_operation_layer_mode_process() dispatches to
the actual process function, to slightly lower its overhead and
fix some thread-safety issues.
Remove the "function" field of the layer-mode info array, and have
gimp_layer_mode_get_function() return the
GimpOperationLayerMode::process() function of the corresponding
op's class (caching the result, to keep it cheap.) This reduces
redundancy, allows us to make the ops' process() functions private,
and simplifies SSE dispatching (only used by NORMAL mode,
currently.)
Move the blend and composite functions of the non-specialized
layer modes to gimpoperationlayermode-{blend,composite}.[hc],
respectively, to improve code organization.
Move the SSE2 composite functions to a separate file, so that they
can be built as part of libapplayermodes_sse2, allowing
libapplayermodes to be built without SSE2 compiler flags. This
allows building GIMP with SSE acceleration enabled, while running
the resulting binary on a target with no SSE accelration.
Add a "blend_function" field to the layer-mode info array, and use
it to specify the blend function for the non-specialized modes.
This replaces the separate switch() statement that we used
previously.
Remove the "affected_region" field of the layer-mode info array.
We don't need it anymore, since we can go back to using
GimpOperationLayerMode's virtual get_affected_region() function.
Last but not least, a bunch of code cleanups and consistency
adjustments.
2017-08-17 10:26:49 -04:00
|
|
|
.blend_function = gimp_operation_layer_mode_blend_overlay,
|
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",
|
app: layer mode code shuffling
Commit 3635cf04ab69bafb76d7583da804f580f2d5fbf3 moved the special
handling of bottom-layer compositing to GimpOperationLayerMode.
This required giving the op more control over the process()
function of its subclasses. As a temporary workaround, the commit
bypassed the subclasses entirely, using "gimp:layer-mode" for all
modes. This is the reckoning :)
Add a process() virtual function to GimpOperationLayerMode, which
its subclasses should override instead of
GeglOperationPointComposer3's process() functions. Reinstate the
subclasses (by returning the correct op in
gimp_layer_mode_get_oepration()), and have them override this
function.
Improve the way gimp_operation_layer_mode_process() dispatches to
the actual process function, to slightly lower its overhead and
fix some thread-safety issues.
Remove the "function" field of the layer-mode info array, and have
gimp_layer_mode_get_function() return the
GimpOperationLayerMode::process() function of the corresponding
op's class (caching the result, to keep it cheap.) This reduces
redundancy, allows us to make the ops' process() functions private,
and simplifies SSE dispatching (only used by NORMAL mode,
currently.)
Move the blend and composite functions of the non-specialized
layer modes to gimpoperationlayermode-{blend,composite}.[hc],
respectively, to improve code organization.
Move the SSE2 composite functions to a separate file, so that they
can be built as part of libapplayermodes_sse2, allowing
libapplayermodes to be built without SSE2 compiler flags. This
allows building GIMP with SSE acceleration enabled, while running
the resulting binary on a target with no SSE accelration.
Add a "blend_function" field to the layer-mode info array, and use
it to specify the blend function for the non-specialized modes.
This replaces the separate switch() statement that we used
previously.
Remove the "affected_region" field of the layer-mode info array.
We don't need it anymore, since we can go back to using
GimpOperationLayerMode's virtual get_affected_region() function.
Last but not least, a bunch of code cleanups and consistency
adjustments.
2017-08-17 10:26:49 -04:00
|
|
|
.blend_function = gimp_operation_layer_mode_blend_lch_hue,
|
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",
|
app: layer mode code shuffling
Commit 3635cf04ab69bafb76d7583da804f580f2d5fbf3 moved the special
handling of bottom-layer compositing to GimpOperationLayerMode.
This required giving the op more control over the process()
function of its subclasses. As a temporary workaround, the commit
bypassed the subclasses entirely, using "gimp:layer-mode" for all
modes. This is the reckoning :)
Add a process() virtual function to GimpOperationLayerMode, which
its subclasses should override instead of
GeglOperationPointComposer3's process() functions. Reinstate the
subclasses (by returning the correct op in
gimp_layer_mode_get_oepration()), and have them override this
function.
Improve the way gimp_operation_layer_mode_process() dispatches to
the actual process function, to slightly lower its overhead and
fix some thread-safety issues.
Remove the "function" field of the layer-mode info array, and have
gimp_layer_mode_get_function() return the
GimpOperationLayerMode::process() function of the corresponding
op's class (caching the result, to keep it cheap.) This reduces
redundancy, allows us to make the ops' process() functions private,
and simplifies SSE dispatching (only used by NORMAL mode,
currently.)
Move the blend and composite functions of the non-specialized
layer modes to gimpoperationlayermode-{blend,composite}.[hc],
respectively, to improve code organization.
Move the SSE2 composite functions to a separate file, so that they
can be built as part of libapplayermodes_sse2, allowing
libapplayermodes to be built without SSE2 compiler flags. This
allows building GIMP with SSE acceleration enabled, while running
the resulting binary on a target with no SSE accelration.
Add a "blend_function" field to the layer-mode info array, and use
it to specify the blend function for the non-specialized modes.
This replaces the separate switch() statement that we used
previously.
Remove the "affected_region" field of the layer-mode info array.
We don't need it anymore, since we can go back to using
GimpOperationLayerMode's virtual get_affected_region() function.
Last but not least, a bunch of code cleanups and consistency
adjustments.
2017-08-17 10:26:49 -04:00
|
|
|
.blend_function = gimp_operation_layer_mode_blend_lch_chroma,
|
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",
|
app: layer mode code shuffling
Commit 3635cf04ab69bafb76d7583da804f580f2d5fbf3 moved the special
handling of bottom-layer compositing to GimpOperationLayerMode.
This required giving the op more control over the process()
function of its subclasses. As a temporary workaround, the commit
bypassed the subclasses entirely, using "gimp:layer-mode" for all
modes. This is the reckoning :)
Add a process() virtual function to GimpOperationLayerMode, which
its subclasses should override instead of
GeglOperationPointComposer3's process() functions. Reinstate the
subclasses (by returning the correct op in
gimp_layer_mode_get_oepration()), and have them override this
function.
Improve the way gimp_operation_layer_mode_process() dispatches to
the actual process function, to slightly lower its overhead and
fix some thread-safety issues.
Remove the "function" field of the layer-mode info array, and have
gimp_layer_mode_get_function() return the
GimpOperationLayerMode::process() function of the corresponding
op's class (caching the result, to keep it cheap.) This reduces
redundancy, allows us to make the ops' process() functions private,
and simplifies SSE dispatching (only used by NORMAL mode,
currently.)
Move the blend and composite functions of the non-specialized
layer modes to gimpoperationlayermode-{blend,composite}.[hc],
respectively, to improve code organization.
Move the SSE2 composite functions to a separate file, so that they
can be built as part of libapplayermodes_sse2, allowing
libapplayermodes to be built without SSE2 compiler flags. This
allows building GIMP with SSE acceleration enabled, while running
the resulting binary on a target with no SSE accelration.
Add a "blend_function" field to the layer-mode info array, and use
it to specify the blend function for the non-specialized modes.
This replaces the separate switch() statement that we used
previously.
Remove the "affected_region" field of the layer-mode info array.
We don't need it anymore, since we can go back to using
GimpOperationLayerMode's virtual get_affected_region() function.
Last but not least, a bunch of code cleanups and consistency
adjustments.
2017-08-17 10:26:49 -04:00
|
|
|
.blend_function = gimp_operation_layer_mode_blend_lch_color,
|
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",
|
app: layer mode code shuffling
Commit 3635cf04ab69bafb76d7583da804f580f2d5fbf3 moved the special
handling of bottom-layer compositing to GimpOperationLayerMode.
This required giving the op more control over the process()
function of its subclasses. As a temporary workaround, the commit
bypassed the subclasses entirely, using "gimp:layer-mode" for all
modes. This is the reckoning :)
Add a process() virtual function to GimpOperationLayerMode, which
its subclasses should override instead of
GeglOperationPointComposer3's process() functions. Reinstate the
subclasses (by returning the correct op in
gimp_layer_mode_get_oepration()), and have them override this
function.
Improve the way gimp_operation_layer_mode_process() dispatches to
the actual process function, to slightly lower its overhead and
fix some thread-safety issues.
Remove the "function" field of the layer-mode info array, and have
gimp_layer_mode_get_function() return the
GimpOperationLayerMode::process() function of the corresponding
op's class (caching the result, to keep it cheap.) This reduces
redundancy, allows us to make the ops' process() functions private,
and simplifies SSE dispatching (only used by NORMAL mode,
currently.)
Move the blend and composite functions of the non-specialized
layer modes to gimpoperationlayermode-{blend,composite}.[hc],
respectively, to improve code organization.
Move the SSE2 composite functions to a separate file, so that they
can be built as part of libapplayermodes_sse2, allowing
libapplayermodes to be built without SSE2 compiler flags. This
allows building GIMP with SSE acceleration enabled, while running
the resulting binary on a target with no SSE accelration.
Add a "blend_function" field to the layer-mode info array, and use
it to specify the blend function for the non-specialized modes.
This replaces the separate switch() statement that we used
previously.
Remove the "affected_region" field of the layer-mode info array.
We don't need it anymore, since we can go back to using
GimpOperationLayerMode's virtual get_affected_region() function.
Last but not least, a bunch of code cleanups and consistency
adjustments.
2017-08-17 10:26:49 -04:00
|
|
|
.blend_function = gimp_operation_layer_mode_blend_lch_lightness,
|
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",
|
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",
|
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",
|
app: layer mode code shuffling
Commit 3635cf04ab69bafb76d7583da804f580f2d5fbf3 moved the special
handling of bottom-layer compositing to GimpOperationLayerMode.
This required giving the op more control over the process()
function of its subclasses. As a temporary workaround, the commit
bypassed the subclasses entirely, using "gimp:layer-mode" for all
modes. This is the reckoning :)
Add a process() virtual function to GimpOperationLayerMode, which
its subclasses should override instead of
GeglOperationPointComposer3's process() functions. Reinstate the
subclasses (by returning the correct op in
gimp_layer_mode_get_oepration()), and have them override this
function.
Improve the way gimp_operation_layer_mode_process() dispatches to
the actual process function, to slightly lower its overhead and
fix some thread-safety issues.
Remove the "function" field of the layer-mode info array, and have
gimp_layer_mode_get_function() return the
GimpOperationLayerMode::process() function of the corresponding
op's class (caching the result, to keep it cheap.) This reduces
redundancy, allows us to make the ops' process() functions private,
and simplifies SSE dispatching (only used by NORMAL mode,
currently.)
Move the blend and composite functions of the non-specialized
layer modes to gimpoperationlayermode-{blend,composite}.[hc],
respectively, to improve code organization.
Move the SSE2 composite functions to a separate file, so that they
can be built as part of libapplayermodes_sse2, allowing
libapplayermodes to be built without SSE2 compiler flags. This
allows building GIMP with SSE acceleration enabled, while running
the resulting binary on a target with no SSE accelration.
Add a "blend_function" field to the layer-mode info array, and use
it to specify the blend function for the non-specialized modes.
This replaces the separate switch() statement that we used
previously.
Remove the "affected_region" field of the layer-mode info array.
We don't need it anymore, since we can go back to using
GimpOperationLayerMode's virtual get_affected_region() function.
Last but not least, a bunch of code cleanups and consistency
adjustments.
2017-08-17 10:26:49 -04:00
|
|
|
.blend_function = gimp_operation_layer_mode_blend_multiply,
|
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",
|
app: layer mode code shuffling
Commit 3635cf04ab69bafb76d7583da804f580f2d5fbf3 moved the special
handling of bottom-layer compositing to GimpOperationLayerMode.
This required giving the op more control over the process()
function of its subclasses. As a temporary workaround, the commit
bypassed the subclasses entirely, using "gimp:layer-mode" for all
modes. This is the reckoning :)
Add a process() virtual function to GimpOperationLayerMode, which
its subclasses should override instead of
GeglOperationPointComposer3's process() functions. Reinstate the
subclasses (by returning the correct op in
gimp_layer_mode_get_oepration()), and have them override this
function.
Improve the way gimp_operation_layer_mode_process() dispatches to
the actual process function, to slightly lower its overhead and
fix some thread-safety issues.
Remove the "function" field of the layer-mode info array, and have
gimp_layer_mode_get_function() return the
GimpOperationLayerMode::process() function of the corresponding
op's class (caching the result, to keep it cheap.) This reduces
redundancy, allows us to make the ops' process() functions private,
and simplifies SSE dispatching (only used by NORMAL mode,
currently.)
Move the blend and composite functions of the non-specialized
layer modes to gimpoperationlayermode-{blend,composite}.[hc],
respectively, to improve code organization.
Move the SSE2 composite functions to a separate file, so that they
can be built as part of libapplayermodes_sse2, allowing
libapplayermodes to be built without SSE2 compiler flags. This
allows building GIMP with SSE acceleration enabled, while running
the resulting binary on a target with no SSE accelration.
Add a "blend_function" field to the layer-mode info array, and use
it to specify the blend function for the non-specialized modes.
This replaces the separate switch() statement that we used
previously.
Remove the "affected_region" field of the layer-mode info array.
We don't need it anymore, since we can go back to using
GimpOperationLayerMode's virtual get_affected_region() function.
Last but not least, a bunch of code cleanups and consistency
adjustments.
2017-08-17 10:26:49 -04:00
|
|
|
.blend_function = gimp_operation_layer_mode_blend_screen,
|
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",
|
app: layer mode code shuffling
Commit 3635cf04ab69bafb76d7583da804f580f2d5fbf3 moved the special
handling of bottom-layer compositing to GimpOperationLayerMode.
This required giving the op more control over the process()
function of its subclasses. As a temporary workaround, the commit
bypassed the subclasses entirely, using "gimp:layer-mode" for all
modes. This is the reckoning :)
Add a process() virtual function to GimpOperationLayerMode, which
its subclasses should override instead of
GeglOperationPointComposer3's process() functions. Reinstate the
subclasses (by returning the correct op in
gimp_layer_mode_get_oepration()), and have them override this
function.
Improve the way gimp_operation_layer_mode_process() dispatches to
the actual process function, to slightly lower its overhead and
fix some thread-safety issues.
Remove the "function" field of the layer-mode info array, and have
gimp_layer_mode_get_function() return the
GimpOperationLayerMode::process() function of the corresponding
op's class (caching the result, to keep it cheap.) This reduces
redundancy, allows us to make the ops' process() functions private,
and simplifies SSE dispatching (only used by NORMAL mode,
currently.)
Move the blend and composite functions of the non-specialized
layer modes to gimpoperationlayermode-{blend,composite}.[hc],
respectively, to improve code organization.
Move the SSE2 composite functions to a separate file, so that they
can be built as part of libapplayermodes_sse2, allowing
libapplayermodes to be built without SSE2 compiler flags. This
allows building GIMP with SSE acceleration enabled, while running
the resulting binary on a target with no SSE accelration.
Add a "blend_function" field to the layer-mode info array, and use
it to specify the blend function for the non-specialized modes.
This replaces the separate switch() statement that we used
previously.
Remove the "affected_region" field of the layer-mode info array.
We don't need it anymore, since we can go back to using
GimpOperationLayerMode's virtual get_affected_region() function.
Last but not least, a bunch of code cleanups and consistency
adjustments.
2017-08-17 10:26:49 -04:00
|
|
|
.blend_function = gimp_operation_layer_mode_blend_difference,
|
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",
|
app: layer mode code shuffling
Commit 3635cf04ab69bafb76d7583da804f580f2d5fbf3 moved the special
handling of bottom-layer compositing to GimpOperationLayerMode.
This required giving the op more control over the process()
function of its subclasses. As a temporary workaround, the commit
bypassed the subclasses entirely, using "gimp:layer-mode" for all
modes. This is the reckoning :)
Add a process() virtual function to GimpOperationLayerMode, which
its subclasses should override instead of
GeglOperationPointComposer3's process() functions. Reinstate the
subclasses (by returning the correct op in
gimp_layer_mode_get_oepration()), and have them override this
function.
Improve the way gimp_operation_layer_mode_process() dispatches to
the actual process function, to slightly lower its overhead and
fix some thread-safety issues.
Remove the "function" field of the layer-mode info array, and have
gimp_layer_mode_get_function() return the
GimpOperationLayerMode::process() function of the corresponding
op's class (caching the result, to keep it cheap.) This reduces
redundancy, allows us to make the ops' process() functions private,
and simplifies SSE dispatching (only used by NORMAL mode,
currently.)
Move the blend and composite functions of the non-specialized
layer modes to gimpoperationlayermode-{blend,composite}.[hc],
respectively, to improve code organization.
Move the SSE2 composite functions to a separate file, so that they
can be built as part of libapplayermodes_sse2, allowing
libapplayermodes to be built without SSE2 compiler flags. This
allows building GIMP with SSE acceleration enabled, while running
the resulting binary on a target with no SSE accelration.
Add a "blend_function" field to the layer-mode info array, and use
it to specify the blend function for the non-specialized modes.
This replaces the separate switch() statement that we used
previously.
Remove the "affected_region" field of the layer-mode info array.
We don't need it anymore, since we can go back to using
GimpOperationLayerMode's virtual get_affected_region() function.
Last but not least, a bunch of code cleanups and consistency
adjustments.
2017-08-17 10:26:49 -04:00
|
|
|
.blend_function = gimp_operation_layer_mode_blend_addition,
|
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",
|
app: layer mode code shuffling
Commit 3635cf04ab69bafb76d7583da804f580f2d5fbf3 moved the special
handling of bottom-layer compositing to GimpOperationLayerMode.
This required giving the op more control over the process()
function of its subclasses. As a temporary workaround, the commit
bypassed the subclasses entirely, using "gimp:layer-mode" for all
modes. This is the reckoning :)
Add a process() virtual function to GimpOperationLayerMode, which
its subclasses should override instead of
GeglOperationPointComposer3's process() functions. Reinstate the
subclasses (by returning the correct op in
gimp_layer_mode_get_oepration()), and have them override this
function.
Improve the way gimp_operation_layer_mode_process() dispatches to
the actual process function, to slightly lower its overhead and
fix some thread-safety issues.
Remove the "function" field of the layer-mode info array, and have
gimp_layer_mode_get_function() return the
GimpOperationLayerMode::process() function of the corresponding
op's class (caching the result, to keep it cheap.) This reduces
redundancy, allows us to make the ops' process() functions private,
and simplifies SSE dispatching (only used by NORMAL mode,
currently.)
Move the blend and composite functions of the non-specialized
layer modes to gimpoperationlayermode-{blend,composite}.[hc],
respectively, to improve code organization.
Move the SSE2 composite functions to a separate file, so that they
can be built as part of libapplayermodes_sse2, allowing
libapplayermodes to be built without SSE2 compiler flags. This
allows building GIMP with SSE acceleration enabled, while running
the resulting binary on a target with no SSE accelration.
Add a "blend_function" field to the layer-mode info array, and use
it to specify the blend function for the non-specialized modes.
This replaces the separate switch() statement that we used
previously.
Remove the "affected_region" field of the layer-mode info array.
We don't need it anymore, since we can go back to using
GimpOperationLayerMode's virtual get_affected_region() function.
Last but not least, a bunch of code cleanups and consistency
adjustments.
2017-08-17 10:26:49 -04:00
|
|
|
.blend_function = gimp_operation_layer_mode_blend_subtract,
|
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",
|
app: layer mode code shuffling
Commit 3635cf04ab69bafb76d7583da804f580f2d5fbf3 moved the special
handling of bottom-layer compositing to GimpOperationLayerMode.
This required giving the op more control over the process()
function of its subclasses. As a temporary workaround, the commit
bypassed the subclasses entirely, using "gimp:layer-mode" for all
modes. This is the reckoning :)
Add a process() virtual function to GimpOperationLayerMode, which
its subclasses should override instead of
GeglOperationPointComposer3's process() functions. Reinstate the
subclasses (by returning the correct op in
gimp_layer_mode_get_oepration()), and have them override this
function.
Improve the way gimp_operation_layer_mode_process() dispatches to
the actual process function, to slightly lower its overhead and
fix some thread-safety issues.
Remove the "function" field of the layer-mode info array, and have
gimp_layer_mode_get_function() return the
GimpOperationLayerMode::process() function of the corresponding
op's class (caching the result, to keep it cheap.) This reduces
redundancy, allows us to make the ops' process() functions private,
and simplifies SSE dispatching (only used by NORMAL mode,
currently.)
Move the blend and composite functions of the non-specialized
layer modes to gimpoperationlayermode-{blend,composite}.[hc],
respectively, to improve code organization.
Move the SSE2 composite functions to a separate file, so that they
can be built as part of libapplayermodes_sse2, allowing
libapplayermodes to be built without SSE2 compiler flags. This
allows building GIMP with SSE acceleration enabled, while running
the resulting binary on a target with no SSE accelration.
Add a "blend_function" field to the layer-mode info array, and use
it to specify the blend function for the non-specialized modes.
This replaces the separate switch() statement that we used
previously.
Remove the "affected_region" field of the layer-mode info array.
We don't need it anymore, since we can go back to using
GimpOperationLayerMode's virtual get_affected_region() function.
Last but not least, a bunch of code cleanups and consistency
adjustments.
2017-08-17 10:26:49 -04:00
|
|
|
.blend_function = gimp_operation_layer_mode_blend_darken_only,
|
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",
|
app: layer mode code shuffling
Commit 3635cf04ab69bafb76d7583da804f580f2d5fbf3 moved the special
handling of bottom-layer compositing to GimpOperationLayerMode.
This required giving the op more control over the process()
function of its subclasses. As a temporary workaround, the commit
bypassed the subclasses entirely, using "gimp:layer-mode" for all
modes. This is the reckoning :)
Add a process() virtual function to GimpOperationLayerMode, which
its subclasses should override instead of
GeglOperationPointComposer3's process() functions. Reinstate the
subclasses (by returning the correct op in
gimp_layer_mode_get_oepration()), and have them override this
function.
Improve the way gimp_operation_layer_mode_process() dispatches to
the actual process function, to slightly lower its overhead and
fix some thread-safety issues.
Remove the "function" field of the layer-mode info array, and have
gimp_layer_mode_get_function() return the
GimpOperationLayerMode::process() function of the corresponding
op's class (caching the result, to keep it cheap.) This reduces
redundancy, allows us to make the ops' process() functions private,
and simplifies SSE dispatching (only used by NORMAL mode,
currently.)
Move the blend and composite functions of the non-specialized
layer modes to gimpoperationlayermode-{blend,composite}.[hc],
respectively, to improve code organization.
Move the SSE2 composite functions to a separate file, so that they
can be built as part of libapplayermodes_sse2, allowing
libapplayermodes to be built without SSE2 compiler flags. This
allows building GIMP with SSE acceleration enabled, while running
the resulting binary on a target with no SSE accelration.
Add a "blend_function" field to the layer-mode info array, and use
it to specify the blend function for the non-specialized modes.
This replaces the separate switch() statement that we used
previously.
Remove the "affected_region" field of the layer-mode info array.
We don't need it anymore, since we can go back to using
GimpOperationLayerMode's virtual get_affected_region() function.
Last but not least, a bunch of code cleanups and consistency
adjustments.
2017-08-17 10:26:49 -04:00
|
|
|
.blend_function = gimp_operation_layer_mode_blend_lighten_only,
|
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",
|
app: layer mode code shuffling
Commit 3635cf04ab69bafb76d7583da804f580f2d5fbf3 moved the special
handling of bottom-layer compositing to GimpOperationLayerMode.
This required giving the op more control over the process()
function of its subclasses. As a temporary workaround, the commit
bypassed the subclasses entirely, using "gimp:layer-mode" for all
modes. This is the reckoning :)
Add a process() virtual function to GimpOperationLayerMode, which
its subclasses should override instead of
GeglOperationPointComposer3's process() functions. Reinstate the
subclasses (by returning the correct op in
gimp_layer_mode_get_oepration()), and have them override this
function.
Improve the way gimp_operation_layer_mode_process() dispatches to
the actual process function, to slightly lower its overhead and
fix some thread-safety issues.
Remove the "function" field of the layer-mode info array, and have
gimp_layer_mode_get_function() return the
GimpOperationLayerMode::process() function of the corresponding
op's class (caching the result, to keep it cheap.) This reduces
redundancy, allows us to make the ops' process() functions private,
and simplifies SSE dispatching (only used by NORMAL mode,
currently.)
Move the blend and composite functions of the non-specialized
layer modes to gimpoperationlayermode-{blend,composite}.[hc],
respectively, to improve code organization.
Move the SSE2 composite functions to a separate file, so that they
can be built as part of libapplayermodes_sse2, allowing
libapplayermodes to be built without SSE2 compiler flags. This
allows building GIMP with SSE acceleration enabled, while running
the resulting binary on a target with no SSE accelration.
Add a "blend_function" field to the layer-mode info array, and use
it to specify the blend function for the non-specialized modes.
This replaces the separate switch() statement that we used
previously.
Remove the "affected_region" field of the layer-mode info array.
We don't need it anymore, since we can go back to using
GimpOperationLayerMode's virtual get_affected_region() function.
Last but not least, a bunch of code cleanups and consistency
adjustments.
2017-08-17 10:26:49 -04:00
|
|
|
.blend_function = gimp_operation_layer_mode_blend_hsv_hue,
|
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",
|
app: layer mode code shuffling
Commit 3635cf04ab69bafb76d7583da804f580f2d5fbf3 moved the special
handling of bottom-layer compositing to GimpOperationLayerMode.
This required giving the op more control over the process()
function of its subclasses. As a temporary workaround, the commit
bypassed the subclasses entirely, using "gimp:layer-mode" for all
modes. This is the reckoning :)
Add a process() virtual function to GimpOperationLayerMode, which
its subclasses should override instead of
GeglOperationPointComposer3's process() functions. Reinstate the
subclasses (by returning the correct op in
gimp_layer_mode_get_oepration()), and have them override this
function.
Improve the way gimp_operation_layer_mode_process() dispatches to
the actual process function, to slightly lower its overhead and
fix some thread-safety issues.
Remove the "function" field of the layer-mode info array, and have
gimp_layer_mode_get_function() return the
GimpOperationLayerMode::process() function of the corresponding
op's class (caching the result, to keep it cheap.) This reduces
redundancy, allows us to make the ops' process() functions private,
and simplifies SSE dispatching (only used by NORMAL mode,
currently.)
Move the blend and composite functions of the non-specialized
layer modes to gimpoperationlayermode-{blend,composite}.[hc],
respectively, to improve code organization.
Move the SSE2 composite functions to a separate file, so that they
can be built as part of libapplayermodes_sse2, allowing
libapplayermodes to be built without SSE2 compiler flags. This
allows building GIMP with SSE acceleration enabled, while running
the resulting binary on a target with no SSE accelration.
Add a "blend_function" field to the layer-mode info array, and use
it to specify the blend function for the non-specialized modes.
This replaces the separate switch() statement that we used
previously.
Remove the "affected_region" field of the layer-mode info array.
We don't need it anymore, since we can go back to using
GimpOperationLayerMode's virtual get_affected_region() function.
Last but not least, a bunch of code cleanups and consistency
adjustments.
2017-08-17 10:26:49 -04:00
|
|
|
.blend_function = gimp_operation_layer_mode_blend_hsv_saturation,
|
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",
|
app: layer mode code shuffling
Commit 3635cf04ab69bafb76d7583da804f580f2d5fbf3 moved the special
handling of bottom-layer compositing to GimpOperationLayerMode.
This required giving the op more control over the process()
function of its subclasses. As a temporary workaround, the commit
bypassed the subclasses entirely, using "gimp:layer-mode" for all
modes. This is the reckoning :)
Add a process() virtual function to GimpOperationLayerMode, which
its subclasses should override instead of
GeglOperationPointComposer3's process() functions. Reinstate the
subclasses (by returning the correct op in
gimp_layer_mode_get_oepration()), and have them override this
function.
Improve the way gimp_operation_layer_mode_process() dispatches to
the actual process function, to slightly lower its overhead and
fix some thread-safety issues.
Remove the "function" field of the layer-mode info array, and have
gimp_layer_mode_get_function() return the
GimpOperationLayerMode::process() function of the corresponding
op's class (caching the result, to keep it cheap.) This reduces
redundancy, allows us to make the ops' process() functions private,
and simplifies SSE dispatching (only used by NORMAL mode,
currently.)
Move the blend and composite functions of the non-specialized
layer modes to gimpoperationlayermode-{blend,composite}.[hc],
respectively, to improve code organization.
Move the SSE2 composite functions to a separate file, so that they
can be built as part of libapplayermodes_sse2, allowing
libapplayermodes to be built without SSE2 compiler flags. This
allows building GIMP with SSE acceleration enabled, while running
the resulting binary on a target with no SSE accelration.
Add a "blend_function" field to the layer-mode info array, and use
it to specify the blend function for the non-specialized modes.
This replaces the separate switch() statement that we used
previously.
Remove the "affected_region" field of the layer-mode info array.
We don't need it anymore, since we can go back to using
GimpOperationLayerMode's virtual get_affected_region() function.
Last but not least, a bunch of code cleanups and consistency
adjustments.
2017-08-17 10:26:49 -04:00
|
|
|
.blend_function = gimp_operation_layer_mode_blend_hsl_color,
|
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",
|
app: layer mode code shuffling
Commit 3635cf04ab69bafb76d7583da804f580f2d5fbf3 moved the special
handling of bottom-layer compositing to GimpOperationLayerMode.
This required giving the op more control over the process()
function of its subclasses. As a temporary workaround, the commit
bypassed the subclasses entirely, using "gimp:layer-mode" for all
modes. This is the reckoning :)
Add a process() virtual function to GimpOperationLayerMode, which
its subclasses should override instead of
GeglOperationPointComposer3's process() functions. Reinstate the
subclasses (by returning the correct op in
gimp_layer_mode_get_oepration()), and have them override this
function.
Improve the way gimp_operation_layer_mode_process() dispatches to
the actual process function, to slightly lower its overhead and
fix some thread-safety issues.
Remove the "function" field of the layer-mode info array, and have
gimp_layer_mode_get_function() return the
GimpOperationLayerMode::process() function of the corresponding
op's class (caching the result, to keep it cheap.) This reduces
redundancy, allows us to make the ops' process() functions private,
and simplifies SSE dispatching (only used by NORMAL mode,
currently.)
Move the blend and composite functions of the non-specialized
layer modes to gimpoperationlayermode-{blend,composite}.[hc],
respectively, to improve code organization.
Move the SSE2 composite functions to a separate file, so that they
can be built as part of libapplayermodes_sse2, allowing
libapplayermodes to be built without SSE2 compiler flags. This
allows building GIMP with SSE acceleration enabled, while running
the resulting binary on a target with no SSE accelration.
Add a "blend_function" field to the layer-mode info array, and use
it to specify the blend function for the non-specialized modes.
This replaces the separate switch() statement that we used
previously.
Remove the "affected_region" field of the layer-mode info array.
We don't need it anymore, since we can go back to using
GimpOperationLayerMode's virtual get_affected_region() function.
Last but not least, a bunch of code cleanups and consistency
adjustments.
2017-08-17 10:26:49 -04:00
|
|
|
.blend_function = gimp_operation_layer_mode_blend_hsv_value,
|
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",
|
app: layer mode code shuffling
Commit 3635cf04ab69bafb76d7583da804f580f2d5fbf3 moved the special
handling of bottom-layer compositing to GimpOperationLayerMode.
This required giving the op more control over the process()
function of its subclasses. As a temporary workaround, the commit
bypassed the subclasses entirely, using "gimp:layer-mode" for all
modes. This is the reckoning :)
Add a process() virtual function to GimpOperationLayerMode, which
its subclasses should override instead of
GeglOperationPointComposer3's process() functions. Reinstate the
subclasses (by returning the correct op in
gimp_layer_mode_get_oepration()), and have them override this
function.
Improve the way gimp_operation_layer_mode_process() dispatches to
the actual process function, to slightly lower its overhead and
fix some thread-safety issues.
Remove the "function" field of the layer-mode info array, and have
gimp_layer_mode_get_function() return the
GimpOperationLayerMode::process() function of the corresponding
op's class (caching the result, to keep it cheap.) This reduces
redundancy, allows us to make the ops' process() functions private,
and simplifies SSE dispatching (only used by NORMAL mode,
currently.)
Move the blend and composite functions of the non-specialized
layer modes to gimpoperationlayermode-{blend,composite}.[hc],
respectively, to improve code organization.
Move the SSE2 composite functions to a separate file, so that they
can be built as part of libapplayermodes_sse2, allowing
libapplayermodes to be built without SSE2 compiler flags. This
allows building GIMP with SSE acceleration enabled, while running
the resulting binary on a target with no SSE accelration.
Add a "blend_function" field to the layer-mode info array, and use
it to specify the blend function for the non-specialized modes.
This replaces the separate switch() statement that we used
previously.
Remove the "affected_region" field of the layer-mode info array.
We don't need it anymore, since we can go back to using
GimpOperationLayerMode's virtual get_affected_region() function.
Last but not least, a bunch of code cleanups and consistency
adjustments.
2017-08-17 10:26:49 -04:00
|
|
|
.blend_function = gimp_operation_layer_mode_blend_divide,
|
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",
|
app: layer mode code shuffling
Commit 3635cf04ab69bafb76d7583da804f580f2d5fbf3 moved the special
handling of bottom-layer compositing to GimpOperationLayerMode.
This required giving the op more control over the process()
function of its subclasses. As a temporary workaround, the commit
bypassed the subclasses entirely, using "gimp:layer-mode" for all
modes. This is the reckoning :)
Add a process() virtual function to GimpOperationLayerMode, which
its subclasses should override instead of
GeglOperationPointComposer3's process() functions. Reinstate the
subclasses (by returning the correct op in
gimp_layer_mode_get_oepration()), and have them override this
function.
Improve the way gimp_operation_layer_mode_process() dispatches to
the actual process function, to slightly lower its overhead and
fix some thread-safety issues.
Remove the "function" field of the layer-mode info array, and have
gimp_layer_mode_get_function() return the
GimpOperationLayerMode::process() function of the corresponding
op's class (caching the result, to keep it cheap.) This reduces
redundancy, allows us to make the ops' process() functions private,
and simplifies SSE dispatching (only used by NORMAL mode,
currently.)
Move the blend and composite functions of the non-specialized
layer modes to gimpoperationlayermode-{blend,composite}.[hc],
respectively, to improve code organization.
Move the SSE2 composite functions to a separate file, so that they
can be built as part of libapplayermodes_sse2, allowing
libapplayermodes to be built without SSE2 compiler flags. This
allows building GIMP with SSE acceleration enabled, while running
the resulting binary on a target with no SSE accelration.
Add a "blend_function" field to the layer-mode info array, and use
it to specify the blend function for the non-specialized modes.
This replaces the separate switch() statement that we used
previously.
Remove the "affected_region" field of the layer-mode info array.
We don't need it anymore, since we can go back to using
GimpOperationLayerMode's virtual get_affected_region() function.
Last but not least, a bunch of code cleanups and consistency
adjustments.
2017-08-17 10:26:49 -04:00
|
|
|
.blend_function = gimp_operation_layer_mode_blend_dodge,
|
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",
|
app: layer mode code shuffling
Commit 3635cf04ab69bafb76d7583da804f580f2d5fbf3 moved the special
handling of bottom-layer compositing to GimpOperationLayerMode.
This required giving the op more control over the process()
function of its subclasses. As a temporary workaround, the commit
bypassed the subclasses entirely, using "gimp:layer-mode" for all
modes. This is the reckoning :)
Add a process() virtual function to GimpOperationLayerMode, which
its subclasses should override instead of
GeglOperationPointComposer3's process() functions. Reinstate the
subclasses (by returning the correct op in
gimp_layer_mode_get_oepration()), and have them override this
function.
Improve the way gimp_operation_layer_mode_process() dispatches to
the actual process function, to slightly lower its overhead and
fix some thread-safety issues.
Remove the "function" field of the layer-mode info array, and have
gimp_layer_mode_get_function() return the
GimpOperationLayerMode::process() function of the corresponding
op's class (caching the result, to keep it cheap.) This reduces
redundancy, allows us to make the ops' process() functions private,
and simplifies SSE dispatching (only used by NORMAL mode,
currently.)
Move the blend and composite functions of the non-specialized
layer modes to gimpoperationlayermode-{blend,composite}.[hc],
respectively, to improve code organization.
Move the SSE2 composite functions to a separate file, so that they
can be built as part of libapplayermodes_sse2, allowing
libapplayermodes to be built without SSE2 compiler flags. This
allows building GIMP with SSE acceleration enabled, while running
the resulting binary on a target with no SSE accelration.
Add a "blend_function" field to the layer-mode info array, and use
it to specify the blend function for the non-specialized modes.
This replaces the separate switch() statement that we used
previously.
Remove the "affected_region" field of the layer-mode info array.
We don't need it anymore, since we can go back to using
GimpOperationLayerMode's virtual get_affected_region() function.
Last but not least, a bunch of code cleanups and consistency
adjustments.
2017-08-17 10:26:49 -04:00
|
|
|
.blend_function = gimp_operation_layer_mode_blend_burn,
|
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",
|
app: layer mode code shuffling
Commit 3635cf04ab69bafb76d7583da804f580f2d5fbf3 moved the special
handling of bottom-layer compositing to GimpOperationLayerMode.
This required giving the op more control over the process()
function of its subclasses. As a temporary workaround, the commit
bypassed the subclasses entirely, using "gimp:layer-mode" for all
modes. This is the reckoning :)
Add a process() virtual function to GimpOperationLayerMode, which
its subclasses should override instead of
GeglOperationPointComposer3's process() functions. Reinstate the
subclasses (by returning the correct op in
gimp_layer_mode_get_oepration()), and have them override this
function.
Improve the way gimp_operation_layer_mode_process() dispatches to
the actual process function, to slightly lower its overhead and
fix some thread-safety issues.
Remove the "function" field of the layer-mode info array, and have
gimp_layer_mode_get_function() return the
GimpOperationLayerMode::process() function of the corresponding
op's class (caching the result, to keep it cheap.) This reduces
redundancy, allows us to make the ops' process() functions private,
and simplifies SSE dispatching (only used by NORMAL mode,
currently.)
Move the blend and composite functions of the non-specialized
layer modes to gimpoperationlayermode-{blend,composite}.[hc],
respectively, to improve code organization.
Move the SSE2 composite functions to a separate file, so that they
can be built as part of libapplayermodes_sse2, allowing
libapplayermodes to be built without SSE2 compiler flags. This
allows building GIMP with SSE acceleration enabled, while running
the resulting binary on a target with no SSE accelration.
Add a "blend_function" field to the layer-mode info array, and use
it to specify the blend function for the non-specialized modes.
This replaces the separate switch() statement that we used
previously.
Remove the "affected_region" field of the layer-mode info array.
We don't need it anymore, since we can go back to using
GimpOperationLayerMode's virtual get_affected_region() function.
Last but not least, a bunch of code cleanups and consistency
adjustments.
2017-08-17 10:26:49 -04:00
|
|
|
.blend_function = gimp_operation_layer_mode_blend_hardlight,
|
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",
|
app: layer mode code shuffling
Commit 3635cf04ab69bafb76d7583da804f580f2d5fbf3 moved the special
handling of bottom-layer compositing to GimpOperationLayerMode.
This required giving the op more control over the process()
function of its subclasses. As a temporary workaround, the commit
bypassed the subclasses entirely, using "gimp:layer-mode" for all
modes. This is the reckoning :)
Add a process() virtual function to GimpOperationLayerMode, which
its subclasses should override instead of
GeglOperationPointComposer3's process() functions. Reinstate the
subclasses (by returning the correct op in
gimp_layer_mode_get_oepration()), and have them override this
function.
Improve the way gimp_operation_layer_mode_process() dispatches to
the actual process function, to slightly lower its overhead and
fix some thread-safety issues.
Remove the "function" field of the layer-mode info array, and have
gimp_layer_mode_get_function() return the
GimpOperationLayerMode::process() function of the corresponding
op's class (caching the result, to keep it cheap.) This reduces
redundancy, allows us to make the ops' process() functions private,
and simplifies SSE dispatching (only used by NORMAL mode,
currently.)
Move the blend and composite functions of the non-specialized
layer modes to gimpoperationlayermode-{blend,composite}.[hc],
respectively, to improve code organization.
Move the SSE2 composite functions to a separate file, so that they
can be built as part of libapplayermodes_sse2, allowing
libapplayermodes to be built without SSE2 compiler flags. This
allows building GIMP with SSE acceleration enabled, while running
the resulting binary on a target with no SSE accelration.
Add a "blend_function" field to the layer-mode info array, and use
it to specify the blend function for the non-specialized modes.
This replaces the separate switch() statement that we used
previously.
Remove the "affected_region" field of the layer-mode info array.
We don't need it anymore, since we can go back to using
GimpOperationLayerMode's virtual get_affected_region() function.
Last but not least, a bunch of code cleanups and consistency
adjustments.
2017-08-17 10:26:49 -04:00
|
|
|
.blend_function = gimp_operation_layer_mode_blend_softlight,
|
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",
|
app: layer mode code shuffling
Commit 3635cf04ab69bafb76d7583da804f580f2d5fbf3 moved the special
handling of bottom-layer compositing to GimpOperationLayerMode.
This required giving the op more control over the process()
function of its subclasses. As a temporary workaround, the commit
bypassed the subclasses entirely, using "gimp:layer-mode" for all
modes. This is the reckoning :)
Add a process() virtual function to GimpOperationLayerMode, which
its subclasses should override instead of
GeglOperationPointComposer3's process() functions. Reinstate the
subclasses (by returning the correct op in
gimp_layer_mode_get_oepration()), and have them override this
function.
Improve the way gimp_operation_layer_mode_process() dispatches to
the actual process function, to slightly lower its overhead and
fix some thread-safety issues.
Remove the "function" field of the layer-mode info array, and have
gimp_layer_mode_get_function() return the
GimpOperationLayerMode::process() function of the corresponding
op's class (caching the result, to keep it cheap.) This reduces
redundancy, allows us to make the ops' process() functions private,
and simplifies SSE dispatching (only used by NORMAL mode,
currently.)
Move the blend and composite functions of the non-specialized
layer modes to gimpoperationlayermode-{blend,composite}.[hc],
respectively, to improve code organization.
Move the SSE2 composite functions to a separate file, so that they
can be built as part of libapplayermodes_sse2, allowing
libapplayermodes to be built without SSE2 compiler flags. This
allows building GIMP with SSE acceleration enabled, while running
the resulting binary on a target with no SSE accelration.
Add a "blend_function" field to the layer-mode info array, and use
it to specify the blend function for the non-specialized modes.
This replaces the separate switch() statement that we used
previously.
Remove the "affected_region" field of the layer-mode info array.
We don't need it anymore, since we can go back to using
GimpOperationLayerMode's virtual get_affected_region() function.
Last but not least, a bunch of code cleanups and consistency
adjustments.
2017-08-17 10:26:49 -04:00
|
|
|
.blend_function = gimp_operation_layer_mode_blend_grain_extract,
|
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",
|
app: layer mode code shuffling
Commit 3635cf04ab69bafb76d7583da804f580f2d5fbf3 moved the special
handling of bottom-layer compositing to GimpOperationLayerMode.
This required giving the op more control over the process()
function of its subclasses. As a temporary workaround, the commit
bypassed the subclasses entirely, using "gimp:layer-mode" for all
modes. This is the reckoning :)
Add a process() virtual function to GimpOperationLayerMode, which
its subclasses should override instead of
GeglOperationPointComposer3's process() functions. Reinstate the
subclasses (by returning the correct op in
gimp_layer_mode_get_oepration()), and have them override this
function.
Improve the way gimp_operation_layer_mode_process() dispatches to
the actual process function, to slightly lower its overhead and
fix some thread-safety issues.
Remove the "function" field of the layer-mode info array, and have
gimp_layer_mode_get_function() return the
GimpOperationLayerMode::process() function of the corresponding
op's class (caching the result, to keep it cheap.) This reduces
redundancy, allows us to make the ops' process() functions private,
and simplifies SSE dispatching (only used by NORMAL mode,
currently.)
Move the blend and composite functions of the non-specialized
layer modes to gimpoperationlayermode-{blend,composite}.[hc],
respectively, to improve code organization.
Move the SSE2 composite functions to a separate file, so that they
can be built as part of libapplayermodes_sse2, allowing
libapplayermodes to be built without SSE2 compiler flags. This
allows building GIMP with SSE acceleration enabled, while running
the resulting binary on a target with no SSE accelration.
Add a "blend_function" field to the layer-mode info array, and use
it to specify the blend function for the non-specialized modes.
This replaces the separate switch() statement that we used
previously.
Remove the "affected_region" field of the layer-mode info array.
We don't need it anymore, since we can go back to using
GimpOperationLayerMode's virtual get_affected_region() function.
Last but not least, a bunch of code cleanups and consistency
adjustments.
2017-08-17 10:26:49 -04:00
|
|
|
.blend_function = gimp_operation_layer_mode_blend_grain_merge,
|
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",
|
app: layer mode code shuffling
Commit 3635cf04ab69bafb76d7583da804f580f2d5fbf3 moved the special
handling of bottom-layer compositing to GimpOperationLayerMode.
This required giving the op more control over the process()
function of its subclasses. As a temporary workaround, the commit
bypassed the subclasses entirely, using "gimp:layer-mode" for all
modes. This is the reckoning :)
Add a process() virtual function to GimpOperationLayerMode, which
its subclasses should override instead of
GeglOperationPointComposer3's process() functions. Reinstate the
subclasses (by returning the correct op in
gimp_layer_mode_get_oepration()), and have them override this
function.
Improve the way gimp_operation_layer_mode_process() dispatches to
the actual process function, to slightly lower its overhead and
fix some thread-safety issues.
Remove the "function" field of the layer-mode info array, and have
gimp_layer_mode_get_function() return the
GimpOperationLayerMode::process() function of the corresponding
op's class (caching the result, to keep it cheap.) This reduces
redundancy, allows us to make the ops' process() functions private,
and simplifies SSE dispatching (only used by NORMAL mode,
currently.)
Move the blend and composite functions of the non-specialized
layer modes to gimpoperationlayermode-{blend,composite}.[hc],
respectively, to improve code organization.
Move the SSE2 composite functions to a separate file, so that they
can be built as part of libapplayermodes_sse2, allowing
libapplayermodes to be built without SSE2 compiler flags. This
allows building GIMP with SSE acceleration enabled, while running
the resulting binary on a target with no SSE accelration.
Add a "blend_function" field to the layer-mode info array, and use
it to specify the blend function for the non-specialized modes.
This replaces the separate switch() statement that we used
previously.
Remove the "affected_region" field of the layer-mode info array.
We don't need it anymore, since we can go back to using
GimpOperationLayerMode's virtual get_affected_region() function.
Last but not least, a bunch of code cleanups and consistency
adjustments.
2017-08-17 10:26:49 -04:00
|
|
|
.blend_function = gimp_operation_layer_mode_blend_vivid_light,
|
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",
|
app: layer mode code shuffling
Commit 3635cf04ab69bafb76d7583da804f580f2d5fbf3 moved the special
handling of bottom-layer compositing to GimpOperationLayerMode.
This required giving the op more control over the process()
function of its subclasses. As a temporary workaround, the commit
bypassed the subclasses entirely, using "gimp:layer-mode" for all
modes. This is the reckoning :)
Add a process() virtual function to GimpOperationLayerMode, which
its subclasses should override instead of
GeglOperationPointComposer3's process() functions. Reinstate the
subclasses (by returning the correct op in
gimp_layer_mode_get_oepration()), and have them override this
function.
Improve the way gimp_operation_layer_mode_process() dispatches to
the actual process function, to slightly lower its overhead and
fix some thread-safety issues.
Remove the "function" field of the layer-mode info array, and have
gimp_layer_mode_get_function() return the
GimpOperationLayerMode::process() function of the corresponding
op's class (caching the result, to keep it cheap.) This reduces
redundancy, allows us to make the ops' process() functions private,
and simplifies SSE dispatching (only used by NORMAL mode,
currently.)
Move the blend and composite functions of the non-specialized
layer modes to gimpoperationlayermode-{blend,composite}.[hc],
respectively, to improve code organization.
Move the SSE2 composite functions to a separate file, so that they
can be built as part of libapplayermodes_sse2, allowing
libapplayermodes to be built without SSE2 compiler flags. This
allows building GIMP with SSE acceleration enabled, while running
the resulting binary on a target with no SSE accelration.
Add a "blend_function" field to the layer-mode info array, and use
it to specify the blend function for the non-specialized modes.
This replaces the separate switch() statement that we used
previously.
Remove the "affected_region" field of the layer-mode info array.
We don't need it anymore, since we can go back to using
GimpOperationLayerMode's virtual get_affected_region() function.
Last but not least, a bunch of code cleanups and consistency
adjustments.
2017-08-17 10:26:49 -04:00
|
|
|
.blend_function = gimp_operation_layer_mode_blend_pin_light,
|
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",
|
app: layer mode code shuffling
Commit 3635cf04ab69bafb76d7583da804f580f2d5fbf3 moved the special
handling of bottom-layer compositing to GimpOperationLayerMode.
This required giving the op more control over the process()
function of its subclasses. As a temporary workaround, the commit
bypassed the subclasses entirely, using "gimp:layer-mode" for all
modes. This is the reckoning :)
Add a process() virtual function to GimpOperationLayerMode, which
its subclasses should override instead of
GeglOperationPointComposer3's process() functions. Reinstate the
subclasses (by returning the correct op in
gimp_layer_mode_get_oepration()), and have them override this
function.
Improve the way gimp_operation_layer_mode_process() dispatches to
the actual process function, to slightly lower its overhead and
fix some thread-safety issues.
Remove the "function" field of the layer-mode info array, and have
gimp_layer_mode_get_function() return the
GimpOperationLayerMode::process() function of the corresponding
op's class (caching the result, to keep it cheap.) This reduces
redundancy, allows us to make the ops' process() functions private,
and simplifies SSE dispatching (only used by NORMAL mode,
currently.)
Move the blend and composite functions of the non-specialized
layer modes to gimpoperationlayermode-{blend,composite}.[hc],
respectively, to improve code organization.
Move the SSE2 composite functions to a separate file, so that they
can be built as part of libapplayermodes_sse2, allowing
libapplayermodes to be built without SSE2 compiler flags. This
allows building GIMP with SSE acceleration enabled, while running
the resulting binary on a target with no SSE accelration.
Add a "blend_function" field to the layer-mode info array, and use
it to specify the blend function for the non-specialized modes.
This replaces the separate switch() statement that we used
previously.
Remove the "affected_region" field of the layer-mode info array.
We don't need it anymore, since we can go back to using
GimpOperationLayerMode's virtual get_affected_region() function.
Last but not least, a bunch of code cleanups and consistency
adjustments.
2017-08-17 10:26:49 -04:00
|
|
|
.blend_function = gimp_operation_layer_mode_blend_linear_light,
|
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",
|
app: layer mode code shuffling
Commit 3635cf04ab69bafb76d7583da804f580f2d5fbf3 moved the special
handling of bottom-layer compositing to GimpOperationLayerMode.
This required giving the op more control over the process()
function of its subclasses. As a temporary workaround, the commit
bypassed the subclasses entirely, using "gimp:layer-mode" for all
modes. This is the reckoning :)
Add a process() virtual function to GimpOperationLayerMode, which
its subclasses should override instead of
GeglOperationPointComposer3's process() functions. Reinstate the
subclasses (by returning the correct op in
gimp_layer_mode_get_oepration()), and have them override this
function.
Improve the way gimp_operation_layer_mode_process() dispatches to
the actual process function, to slightly lower its overhead and
fix some thread-safety issues.
Remove the "function" field of the layer-mode info array, and have
gimp_layer_mode_get_function() return the
GimpOperationLayerMode::process() function of the corresponding
op's class (caching the result, to keep it cheap.) This reduces
redundancy, allows us to make the ops' process() functions private,
and simplifies SSE dispatching (only used by NORMAL mode,
currently.)
Move the blend and composite functions of the non-specialized
layer modes to gimpoperationlayermode-{blend,composite}.[hc],
respectively, to improve code organization.
Move the SSE2 composite functions to a separate file, so that they
can be built as part of libapplayermodes_sse2, allowing
libapplayermodes to be built without SSE2 compiler flags. This
allows building GIMP with SSE acceleration enabled, while running
the resulting binary on a target with no SSE accelration.
Add a "blend_function" field to the layer-mode info array, and use
it to specify the blend function for the non-specialized modes.
This replaces the separate switch() statement that we used
previously.
Remove the "affected_region" field of the layer-mode info array.
We don't need it anymore, since we can go back to using
GimpOperationLayerMode's virtual get_affected_region() function.
Last but not least, a bunch of code cleanups and consistency
adjustments.
2017-08-17 10:26:49 -04:00
|
|
|
.blend_function = gimp_operation_layer_mode_blend_hard_mix,
|
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",
|
app: layer mode code shuffling
Commit 3635cf04ab69bafb76d7583da804f580f2d5fbf3 moved the special
handling of bottom-layer compositing to GimpOperationLayerMode.
This required giving the op more control over the process()
function of its subclasses. As a temporary workaround, the commit
bypassed the subclasses entirely, using "gimp:layer-mode" for all
modes. This is the reckoning :)
Add a process() virtual function to GimpOperationLayerMode, which
its subclasses should override instead of
GeglOperationPointComposer3's process() functions. Reinstate the
subclasses (by returning the correct op in
gimp_layer_mode_get_oepration()), and have them override this
function.
Improve the way gimp_operation_layer_mode_process() dispatches to
the actual process function, to slightly lower its overhead and
fix some thread-safety issues.
Remove the "function" field of the layer-mode info array, and have
gimp_layer_mode_get_function() return the
GimpOperationLayerMode::process() function of the corresponding
op's class (caching the result, to keep it cheap.) This reduces
redundancy, allows us to make the ops' process() functions private,
and simplifies SSE dispatching (only used by NORMAL mode,
currently.)
Move the blend and composite functions of the non-specialized
layer modes to gimpoperationlayermode-{blend,composite}.[hc],
respectively, to improve code organization.
Move the SSE2 composite functions to a separate file, so that they
can be built as part of libapplayermodes_sse2, allowing
libapplayermodes to be built without SSE2 compiler flags. This
allows building GIMP with SSE acceleration enabled, while running
the resulting binary on a target with no SSE accelration.
Add a "blend_function" field to the layer-mode info array, and use
it to specify the blend function for the non-specialized modes.
This replaces the separate switch() statement that we used
previously.
Remove the "affected_region" field of the layer-mode info array.
We don't need it anymore, since we can go back to using
GimpOperationLayerMode's virtual get_affected_region() function.
Last but not least, a bunch of code cleanups and consistency
adjustments.
2017-08-17 10:26:49 -04:00
|
|
|
.blend_function = gimp_operation_layer_mode_blend_exclusion,
|
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",
|
app: layer mode code shuffling
Commit 3635cf04ab69bafb76d7583da804f580f2d5fbf3 moved the special
handling of bottom-layer compositing to GimpOperationLayerMode.
This required giving the op more control over the process()
function of its subclasses. As a temporary workaround, the commit
bypassed the subclasses entirely, using "gimp:layer-mode" for all
modes. This is the reckoning :)
Add a process() virtual function to GimpOperationLayerMode, which
its subclasses should override instead of
GeglOperationPointComposer3's process() functions. Reinstate the
subclasses (by returning the correct op in
gimp_layer_mode_get_oepration()), and have them override this
function.
Improve the way gimp_operation_layer_mode_process() dispatches to
the actual process function, to slightly lower its overhead and
fix some thread-safety issues.
Remove the "function" field of the layer-mode info array, and have
gimp_layer_mode_get_function() return the
GimpOperationLayerMode::process() function of the corresponding
op's class (caching the result, to keep it cheap.) This reduces
redundancy, allows us to make the ops' process() functions private,
and simplifies SSE dispatching (only used by NORMAL mode,
currently.)
Move the blend and composite functions of the non-specialized
layer modes to gimpoperationlayermode-{blend,composite}.[hc],
respectively, to improve code organization.
Move the SSE2 composite functions to a separate file, so that they
can be built as part of libapplayermodes_sse2, allowing
libapplayermodes to be built without SSE2 compiler flags. This
allows building GIMP with SSE acceleration enabled, while running
the resulting binary on a target with no SSE accelration.
Add a "blend_function" field to the layer-mode info array, and use
it to specify the blend function for the non-specialized modes.
This replaces the separate switch() statement that we used
previously.
Remove the "affected_region" field of the layer-mode info array.
We don't need it anymore, since we can go back to using
GimpOperationLayerMode's virtual get_affected_region() function.
Last but not least, a bunch of code cleanups and consistency
adjustments.
2017-08-17 10:26:49 -04:00
|
|
|
.blend_function = gimp_operation_layer_mode_blend_linear_burn,
|
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",
|
app: layer mode code shuffling
Commit 3635cf04ab69bafb76d7583da804f580f2d5fbf3 moved the special
handling of bottom-layer compositing to GimpOperationLayerMode.
This required giving the op more control over the process()
function of its subclasses. As a temporary workaround, the commit
bypassed the subclasses entirely, using "gimp:layer-mode" for all
modes. This is the reckoning :)
Add a process() virtual function to GimpOperationLayerMode, which
its subclasses should override instead of
GeglOperationPointComposer3's process() functions. Reinstate the
subclasses (by returning the correct op in
gimp_layer_mode_get_oepration()), and have them override this
function.
Improve the way gimp_operation_layer_mode_process() dispatches to
the actual process function, to slightly lower its overhead and
fix some thread-safety issues.
Remove the "function" field of the layer-mode info array, and have
gimp_layer_mode_get_function() return the
GimpOperationLayerMode::process() function of the corresponding
op's class (caching the result, to keep it cheap.) This reduces
redundancy, allows us to make the ops' process() functions private,
and simplifies SSE dispatching (only used by NORMAL mode,
currently.)
Move the blend and composite functions of the non-specialized
layer modes to gimpoperationlayermode-{blend,composite}.[hc],
respectively, to improve code organization.
Move the SSE2 composite functions to a separate file, so that they
can be built as part of libapplayermodes_sse2, allowing
libapplayermodes to be built without SSE2 compiler flags. This
allows building GIMP with SSE acceleration enabled, while running
the resulting binary on a target with no SSE accelration.
Add a "blend_function" field to the layer-mode info array, and use
it to specify the blend function for the non-specialized modes.
This replaces the separate switch() statement that we used
previously.
Remove the "affected_region" field of the layer-mode info array.
We don't need it anymore, since we can go back to using
GimpOperationLayerMode's virtual get_affected_region() function.
Last but not least, a bunch of code cleanups and consistency
adjustments.
2017-08-17 10:26:49 -04:00
|
|
|
.blend_function = gimp_operation_layer_mode_blend_luma_darken_only,
|
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",
|
app: layer mode code shuffling
Commit 3635cf04ab69bafb76d7583da804f580f2d5fbf3 moved the special
handling of bottom-layer compositing to GimpOperationLayerMode.
This required giving the op more control over the process()
function of its subclasses. As a temporary workaround, the commit
bypassed the subclasses entirely, using "gimp:layer-mode" for all
modes. This is the reckoning :)
Add a process() virtual function to GimpOperationLayerMode, which
its subclasses should override instead of
GeglOperationPointComposer3's process() functions. Reinstate the
subclasses (by returning the correct op in
gimp_layer_mode_get_oepration()), and have them override this
function.
Improve the way gimp_operation_layer_mode_process() dispatches to
the actual process function, to slightly lower its overhead and
fix some thread-safety issues.
Remove the "function" field of the layer-mode info array, and have
gimp_layer_mode_get_function() return the
GimpOperationLayerMode::process() function of the corresponding
op's class (caching the result, to keep it cheap.) This reduces
redundancy, allows us to make the ops' process() functions private,
and simplifies SSE dispatching (only used by NORMAL mode,
currently.)
Move the blend and composite functions of the non-specialized
layer modes to gimpoperationlayermode-{blend,composite}.[hc],
respectively, to improve code organization.
Move the SSE2 composite functions to a separate file, so that they
can be built as part of libapplayermodes_sse2, allowing
libapplayermodes to be built without SSE2 compiler flags. This
allows building GIMP with SSE acceleration enabled, while running
the resulting binary on a target with no SSE accelration.
Add a "blend_function" field to the layer-mode info array, and use
it to specify the blend function for the non-specialized modes.
This replaces the separate switch() statement that we used
previously.
Remove the "affected_region" field of the layer-mode info array.
We don't need it anymore, since we can go back to using
GimpOperationLayerMode's virtual get_affected_region() function.
Last but not least, a bunch of code cleanups and consistency
adjustments.
2017-08-17 10:26:49 -04:00
|
|
|
.blend_function = gimp_operation_layer_mode_blend_luma_lighten_only,
|
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",
|
app: layer mode code shuffling
Commit 3635cf04ab69bafb76d7583da804f580f2d5fbf3 moved the special
handling of bottom-layer compositing to GimpOperationLayerMode.
This required giving the op more control over the process()
function of its subclasses. As a temporary workaround, the commit
bypassed the subclasses entirely, using "gimp:layer-mode" for all
modes. This is the reckoning :)
Add a process() virtual function to GimpOperationLayerMode, which
its subclasses should override instead of
GeglOperationPointComposer3's process() functions. Reinstate the
subclasses (by returning the correct op in
gimp_layer_mode_get_oepration()), and have them override this
function.
Improve the way gimp_operation_layer_mode_process() dispatches to
the actual process function, to slightly lower its overhead and
fix some thread-safety issues.
Remove the "function" field of the layer-mode info array, and have
gimp_layer_mode_get_function() return the
GimpOperationLayerMode::process() function of the corresponding
op's class (caching the result, to keep it cheap.) This reduces
redundancy, allows us to make the ops' process() functions private,
and simplifies SSE dispatching (only used by NORMAL mode,
currently.)
Move the blend and composite functions of the non-specialized
layer modes to gimpoperationlayermode-{blend,composite}.[hc],
respectively, to improve code organization.
Move the SSE2 composite functions to a separate file, so that they
can be built as part of libapplayermodes_sse2, allowing
libapplayermodes to be built without SSE2 compiler flags. This
allows building GIMP with SSE acceleration enabled, while running
the resulting binary on a target with no SSE accelration.
Add a "blend_function" field to the layer-mode info array, and use
it to specify the blend function for the non-specialized modes.
This replaces the separate switch() statement that we used
previously.
Remove the "affected_region" field of the layer-mode info array.
We don't need it anymore, since we can go back to using
GimpOperationLayerMode's virtual get_affected_region() function.
Last but not least, a bunch of code cleanups and consistency
adjustments.
2017-08-17 10:26:49 -04:00
|
|
|
.blend_function = gimp_operation_layer_mode_blend_luminance,
|
2017-02-20 18:21:12 +01:00
|
|
|
.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",
|
app: layer mode code shuffling
Commit 3635cf04ab69bafb76d7583da804f580f2d5fbf3 moved the special
handling of bottom-layer compositing to GimpOperationLayerMode.
This required giving the op more control over the process()
function of its subclasses. As a temporary workaround, the commit
bypassed the subclasses entirely, using "gimp:layer-mode" for all
modes. This is the reckoning :)
Add a process() virtual function to GimpOperationLayerMode, which
its subclasses should override instead of
GeglOperationPointComposer3's process() functions. Reinstate the
subclasses (by returning the correct op in
gimp_layer_mode_get_oepration()), and have them override this
function.
Improve the way gimp_operation_layer_mode_process() dispatches to
the actual process function, to slightly lower its overhead and
fix some thread-safety issues.
Remove the "function" field of the layer-mode info array, and have
gimp_layer_mode_get_function() return the
GimpOperationLayerMode::process() function of the corresponding
op's class (caching the result, to keep it cheap.) This reduces
redundancy, allows us to make the ops' process() functions private,
and simplifies SSE dispatching (only used by NORMAL mode,
currently.)
Move the blend and composite functions of the non-specialized
layer modes to gimpoperationlayermode-{blend,composite}.[hc],
respectively, to improve code organization.
Move the SSE2 composite functions to a separate file, so that they
can be built as part of libapplayermodes_sse2, allowing
libapplayermodes to be built without SSE2 compiler flags. This
allows building GIMP with SSE acceleration enabled, while running
the resulting binary on a target with no SSE accelration.
Add a "blend_function" field to the layer-mode info array, and use
it to specify the blend function for the non-specialized modes.
This replaces the separate switch() statement that we used
previously.
Remove the "affected_region" field of the layer-mode info array.
We don't need it anymore, since we can go back to using
GimpOperationLayerMode's virtual get_affected_region() function.
Last but not least, a bunch of code cleanups and consistency
adjustments.
2017-08-17 10:26:49 -04:00
|
|
|
.blend_function = gimp_operation_layer_mode_blend_color_erase,
|
2017-03-08 13:06:46 -05:00
|
|
|
.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",
|
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",
|
|
|
|
.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",
|
|
|
|
.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",
|
|
|
|
.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",
|
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: layer mode code shuffling
Commit 3635cf04ab69bafb76d7583da804f580f2d5fbf3 moved the special
handling of bottom-layer compositing to GimpOperationLayerMode.
This required giving the op more control over the process()
function of its subclasses. As a temporary workaround, the commit
bypassed the subclasses entirely, using "gimp:layer-mode" for all
modes. This is the reckoning :)
Add a process() virtual function to GimpOperationLayerMode, which
its subclasses should override instead of
GeglOperationPointComposer3's process() functions. Reinstate the
subclasses (by returning the correct op in
gimp_layer_mode_get_oepration()), and have them override this
function.
Improve the way gimp_operation_layer_mode_process() dispatches to
the actual process function, to slightly lower its overhead and
fix some thread-safety issues.
Remove the "function" field of the layer-mode info array, and have
gimp_layer_mode_get_function() return the
GimpOperationLayerMode::process() function of the corresponding
op's class (caching the result, to keep it cheap.) This reduces
redundancy, allows us to make the ops' process() functions private,
and simplifies SSE dispatching (only used by NORMAL mode,
currently.)
Move the blend and composite functions of the non-specialized
layer modes to gimpoperationlayermode-{blend,composite}.[hc],
respectively, to improve code organization.
Move the SSE2 composite functions to a separate file, so that they
can be built as part of libapplayermodes_sse2, allowing
libapplayermodes to be built without SSE2 compiler flags. This
allows building GIMP with SSE acceleration enabled, while running
the resulting binary on a target with no SSE accelration.
Add a "blend_function" field to the layer-mode info array, and use
it to specify the blend function for the non-specialized modes.
This replaces the separate switch() statement that we used
previously.
Remove the "affected_region" field of the layer-mode info array.
We don't need it anymore, since we can go back to using
GimpOperationLayerMode's virtual get_affected_region() function.
Last but not least, a bunch of code cleanups and consistency
adjustments.
2017-08-17 10:26:49 -04:00
|
|
|
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_LINEAR
|
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",
|
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: layer mode code shuffling
Commit 3635cf04ab69bafb76d7583da804f580f2d5fbf3 moved the special
handling of bottom-layer compositing to GimpOperationLayerMode.
This required giving the op more control over the process()
function of its subclasses. As a temporary workaround, the commit
bypassed the subclasses entirely, using "gimp:layer-mode" for all
modes. This is the reckoning :)
Add a process() virtual function to GimpOperationLayerMode, which
its subclasses should override instead of
GeglOperationPointComposer3's process() functions. Reinstate the
subclasses (by returning the correct op in
gimp_layer_mode_get_oepration()), and have them override this
function.
Improve the way gimp_operation_layer_mode_process() dispatches to
the actual process function, to slightly lower its overhead and
fix some thread-safety issues.
Remove the "function" field of the layer-mode info array, and have
gimp_layer_mode_get_function() return the
GimpOperationLayerMode::process() function of the corresponding
op's class (caching the result, to keep it cheap.) This reduces
redundancy, allows us to make the ops' process() functions private,
and simplifies SSE dispatching (only used by NORMAL mode,
currently.)
Move the blend and composite functions of the non-specialized
layer modes to gimpoperationlayermode-{blend,composite}.[hc],
respectively, to improve code organization.
Move the SSE2 composite functions to a separate file, so that they
can be built as part of libapplayermodes_sse2, allowing
libapplayermodes to be built without SSE2 compiler flags. This
allows building GIMP with SSE acceleration enabled, while running
the resulting binary on a target with no SSE accelration.
Add a "blend_function" field to the layer-mode info array, and use
it to specify the blend function for the non-specialized modes.
This replaces the separate switch() statement that we used
previously.
Remove the "affected_region" field of the layer-mode info array.
We don't need it anymore, since we can go back to using
GimpOperationLayerMode's virtual get_affected_region() function.
Last but not least, a bunch of code cleanups and consistency
adjustments.
2017-08-17 10:26:49 -04:00
|
|
|
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_OVER
|
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)
|
|
|
|
{
|
app: layer mode code shuffling
Commit 3635cf04ab69bafb76d7583da804f580f2d5fbf3 moved the special
handling of bottom-layer compositing to GimpOperationLayerMode.
This required giving the op more control over the process()
function of its subclasses. As a temporary workaround, the commit
bypassed the subclasses entirely, using "gimp:layer-mode" for all
modes. This is the reckoning :)
Add a process() virtual function to GimpOperationLayerMode, which
its subclasses should override instead of
GeglOperationPointComposer3's process() functions. Reinstate the
subclasses (by returning the correct op in
gimp_layer_mode_get_oepration()), and have them override this
function.
Improve the way gimp_operation_layer_mode_process() dispatches to
the actual process function, to slightly lower its overhead and
fix some thread-safety issues.
Remove the "function" field of the layer-mode info array, and have
gimp_layer_mode_get_function() return the
GimpOperationLayerMode::process() function of the corresponding
op's class (caching the result, to keep it cheap.) This reduces
redundancy, allows us to make the ops' process() functions private,
and simplifies SSE dispatching (only used by NORMAL mode,
currently.)
Move the blend and composite functions of the non-specialized
layer modes to gimpoperationlayermode-{blend,composite}.[hc],
respectively, to improve code organization.
Move the SSE2 composite functions to a separate file, so that they
can be built as part of libapplayermodes_sse2, allowing
libapplayermodes to be built without SSE2 compiler flags. This
allows building GIMP with SSE acceleration enabled, while running
the resulting binary on a target with no SSE accelration.
Add a "blend_function" field to the layer-mode info array, and use
it to specify the blend function for the non-specialized modes.
This replaces the separate switch() statement that we used
previously.
Remove the "affected_region" field of the layer-mode info array.
We don't need it anymore, since we can go back to using
GimpOperationLayerMode's virtual get_affected_region() function.
Last but not least, a bunch of code cleanups and consistency
adjustments.
2017-08-17 10:26:49 -04:00
|
|
|
g_return_val_if_fail (mode >= 0 && mode < G_N_ELEMENTS (layer_mode_infos),
|
2017-02-05 15:59:29 +01:00
|
|
|
&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: layer mode code shuffling
Commit 3635cf04ab69bafb76d7583da804f580f2d5fbf3 moved the special
handling of bottom-layer compositing to GimpOperationLayerMode.
This required giving the op more control over the process()
function of its subclasses. As a temporary workaround, the commit
bypassed the subclasses entirely, using "gimp:layer-mode" for all
modes. This is the reckoning :)
Add a process() virtual function to GimpOperationLayerMode, which
its subclasses should override instead of
GeglOperationPointComposer3's process() functions. Reinstate the
subclasses (by returning the correct op in
gimp_layer_mode_get_oepration()), and have them override this
function.
Improve the way gimp_operation_layer_mode_process() dispatches to
the actual process function, to slightly lower its overhead and
fix some thread-safety issues.
Remove the "function" field of the layer-mode info array, and have
gimp_layer_mode_get_function() return the
GimpOperationLayerMode::process() function of the corresponding
op's class (caching the result, to keep it cheap.) This reduces
redundancy, allows us to make the ops' process() functions private,
and simplifies SSE dispatching (only used by NORMAL mode,
currently.)
Move the blend and composite functions of the non-specialized
layer modes to gimpoperationlayermode-{blend,composite}.[hc],
respectively, to improve code organization.
Move the SSE2 composite functions to a separate file, so that they
can be built as part of libapplayermodes_sse2, allowing
libapplayermodes to be built without SSE2 compiler flags. This
allows building GIMP with SSE acceleration enabled, while running
the resulting binary on a target with no SSE accelration.
Add a "blend_function" field to the layer-mode info array, and use
it to specify the blend function for the non-specialized modes.
This replaces the separate switch() statement that we used
previously.
Remove the "affected_region" field of the layer-mode info array.
We don't need it anymore, since we can go back to using
GimpOperationLayerMode's virtual get_affected_region() function.
Last but not least, a bunch of code cleanups and consistency
adjustments.
2017-08-17 10:26:49 -04:00
|
|
|
const GimpLayerModeInfo *info = gimp_layer_mode_info (mode);
|
|
|
|
|
|
|
|
if (! info)
|
|
|
|
return "gimp:layer-mode";
|
|
|
|
|
|
|
|
return info->op_name;
|
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)
|
app: layer mode code shuffling
Commit 3635cf04ab69bafb76d7583da804f580f2d5fbf3 moved the special
handling of bottom-layer compositing to GimpOperationLayerMode.
This required giving the op more control over the process()
function of its subclasses. As a temporary workaround, the commit
bypassed the subclasses entirely, using "gimp:layer-mode" for all
modes. This is the reckoning :)
Add a process() virtual function to GimpOperationLayerMode, which
its subclasses should override instead of
GeglOperationPointComposer3's process() functions. Reinstate the
subclasses (by returning the correct op in
gimp_layer_mode_get_oepration()), and have them override this
function.
Improve the way gimp_operation_layer_mode_process() dispatches to
the actual process function, to slightly lower its overhead and
fix some thread-safety issues.
Remove the "function" field of the layer-mode info array, and have
gimp_layer_mode_get_function() return the
GimpOperationLayerMode::process() function of the corresponding
op's class (caching the result, to keep it cheap.) This reduces
redundancy, allows us to make the ops' process() functions private,
and simplifies SSE dispatching (only used by NORMAL mode,
currently.)
Move the blend and composite functions of the non-specialized
layer modes to gimpoperationlayermode-{blend,composite}.[hc],
respectively, to improve code organization.
Move the SSE2 composite functions to a separate file, so that they
can be built as part of libapplayermodes_sse2, allowing
libapplayermodes to be built without SSE2 compiler flags. This
allows building GIMP with SSE acceleration enabled, while running
the resulting binary on a target with no SSE accelration.
Add a "blend_function" field to the layer-mode info array, and use
it to specify the blend function for the non-specialized modes.
This replaces the separate switch() statement that we used
previously.
Remove the "affected_region" field of the layer-mode info array.
We don't need it anymore, since we can go back to using
GimpOperationLayerMode's virtual get_affected_region() function.
Last but not least, a bunch of code cleanups and consistency
adjustments.
2017-08-17 10:26:49 -04:00
|
|
|
{
|
|
|
|
const GimpLayerModeInfo *info = gimp_layer_mode_info (mode);
|
|
|
|
static GimpLayerModeFunc funcs[G_N_ELEMENTS (layer_mode_infos)];
|
|
|
|
|
|
|
|
if (! info)
|
|
|
|
info = layer_mode_infos;
|
|
|
|
|
|
|
|
mode = info - layer_mode_infos;
|
|
|
|
|
|
|
|
if (! funcs[mode])
|
|
|
|
{
|
|
|
|
GeglNode *node;
|
|
|
|
GeglOperation *operation;
|
|
|
|
|
|
|
|
node = gegl_node_new_child (NULL,
|
|
|
|
"operation", info->op_name,
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
operation = gegl_node_get_gegl_operation (node);
|
|
|
|
|
|
|
|
funcs[mode] = GIMP_OPERATION_LAYER_MODE_GET_CLASS (operation)->process;
|
|
|
|
|
|
|
|
g_object_unref (node);
|
|
|
|
}
|
|
|
|
|
|
|
|
return funcs[mode];
|
|
|
|
}
|
|
|
|
|
|
|
|
GimpLayerModeBlendFunc
|
|
|
|
gimp_layer_mode_get_blend_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)
|
app: layer mode code shuffling
Commit 3635cf04ab69bafb76d7583da804f580f2d5fbf3 moved the special
handling of bottom-layer compositing to GimpOperationLayerMode.
This required giving the op more control over the process()
function of its subclasses. As a temporary workaround, the commit
bypassed the subclasses entirely, using "gimp:layer-mode" for all
modes. This is the reckoning :)
Add a process() virtual function to GimpOperationLayerMode, which
its subclasses should override instead of
GeglOperationPointComposer3's process() functions. Reinstate the
subclasses (by returning the correct op in
gimp_layer_mode_get_oepration()), and have them override this
function.
Improve the way gimp_operation_layer_mode_process() dispatches to
the actual process function, to slightly lower its overhead and
fix some thread-safety issues.
Remove the "function" field of the layer-mode info array, and have
gimp_layer_mode_get_function() return the
GimpOperationLayerMode::process() function of the corresponding
op's class (caching the result, to keep it cheap.) This reduces
redundancy, allows us to make the ops' process() functions private,
and simplifies SSE dispatching (only used by NORMAL mode,
currently.)
Move the blend and composite functions of the non-specialized
layer modes to gimpoperationlayermode-{blend,composite}.[hc],
respectively, to improve code organization.
Move the SSE2 composite functions to a separate file, so that they
can be built as part of libapplayermodes_sse2, allowing
libapplayermodes to be built without SSE2 compiler flags. This
allows building GIMP with SSE acceleration enabled, while running
the resulting binary on a target with no SSE accelration.
Add a "blend_function" field to the layer-mode info array, and use
it to specify the blend function for the non-specialized modes.
This replaces the separate switch() statement that we used
previously.
Remove the "affected_region" field of the layer-mode info array.
We don't need it anymore, since we can go back to using
GimpOperationLayerMode's virtual get_affected_region() function.
Last but not least, a bunch of code cleanups and consistency
adjustments.
2017-08-17 10:26:49 -04:00
|
|
|
return NULL;
|
2017-02-20 14:20:39 -05:00
|
|
|
|
app: layer mode code shuffling
Commit 3635cf04ab69bafb76d7583da804f580f2d5fbf3 moved the special
handling of bottom-layer compositing to GimpOperationLayerMode.
This required giving the op more control over the process()
function of its subclasses. As a temporary workaround, the commit
bypassed the subclasses entirely, using "gimp:layer-mode" for all
modes. This is the reckoning :)
Add a process() virtual function to GimpOperationLayerMode, which
its subclasses should override instead of
GeglOperationPointComposer3's process() functions. Reinstate the
subclasses (by returning the correct op in
gimp_layer_mode_get_oepration()), and have them override this
function.
Improve the way gimp_operation_layer_mode_process() dispatches to
the actual process function, to slightly lower its overhead and
fix some thread-safety issues.
Remove the "function" field of the layer-mode info array, and have
gimp_layer_mode_get_function() return the
GimpOperationLayerMode::process() function of the corresponding
op's class (caching the result, to keep it cheap.) This reduces
redundancy, allows us to make the ops' process() functions private,
and simplifies SSE dispatching (only used by NORMAL mode,
currently.)
Move the blend and composite functions of the non-specialized
layer modes to gimpoperationlayermode-{blend,composite}.[hc],
respectively, to improve code organization.
Move the SSE2 composite functions to a separate file, so that they
can be built as part of libapplayermodes_sse2, allowing
libapplayermodes to be built without SSE2 compiler flags. This
allows building GIMP with SSE acceleration enabled, while running
the resulting binary on a target with no SSE accelration.
Add a "blend_function" field to the layer-mode info array, and use
it to specify the blend function for the non-specialized modes.
This replaces the separate switch() statement that we used
previously.
Remove the "affected_region" field of the layer-mode info array.
We don't need it anymore, since we can go back to using
GimpOperationLayerMode's virtual get_affected_region() function.
Last but not least, a bunch of code cleanups and consistency
adjustments.
2017-08-17 10:26:49 -04:00
|
|
|
return info->blend_function;
|
2017-02-15 02:25:44 +01:00
|
|
|
}
|
|
|
|
|
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
|
|
|
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|