[gimp] app: add blend-trc and composite-mode properties to GimpOperationPointLayerMode
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: add blend-trc and composite-mode properties to GimpOperationPointLayerMode
- Date: Tue, 17 Jan 2017 14:10:37 +0000 (UTC)
commit 6e72d3eddfd413ffe7138483c5d994dbceb3c5b8
Author: Michael Natterer <mitch gimp org>
Date: Tue Jan 17 15:09:17 2017 +0100
app: add blend-trc and composite-mode properties to GimpOperationPointLayerMode
and set them to unused default values.
app/core/gimp-layer-modes.c | 18 ++++++
app/core/gimp-layer-modes.h | 10 +++-
app/gegl/gimp-gegl-nodes.c | 9 ++-
.../layer-modes/gimpoperationpointlayermode.c | 57 +++++++++++++++++++-
.../layer-modes/gimpoperationpointlayermode.h | 3 +
5 files changed, 89 insertions(+), 8 deletions(-)
---
diff --git a/app/core/gimp-layer-modes.c b/app/core/gimp-layer-modes.c
index eb31aa9..b513de6 100644
--- a/app/core/gimp-layer-modes.c
+++ b/app/core/gimp-layer-modes.c
@@ -158,6 +158,24 @@ gimp_layer_mode_is_linear (GimpLayerMode mode)
return FALSE;
}
+GimpLayerBlendTRC
+gimp_layer_mode_get_blend_trc (GimpLayerMode mode)
+{
+ return GIMP_LAYER_BLEND_RGB_LINEAR;
+}
+
+GimpLayerBlendTRC
+gimp_layer_mode_get_composite_trc (GimpLayerMode mode)
+{
+ return GIMP_LAYER_BLEND_RGB_LINEAR;
+}
+
+GimpLayerCompositeMode
+gimp_layer_mode_get_composite_mode (GimpLayerMode mode)
+{
+ return GIMP_LAYER_COMPOSITE_OVER;
+}
+
const gchar *
gimp_layer_mode_get_operation (GimpLayerMode mode)
{
diff --git a/app/core/gimp-layer-modes.h b/app/core/gimp-layer-modes.h
index 9c09628..783248f 100644
--- a/app/core/gimp-layer-modes.h
+++ b/app/core/gimp-layer-modes.h
@@ -23,10 +23,14 @@
#define __GIMP_LAYER_MODES_H__
-gboolean gimp_layer_mode_is_legacy (GimpLayerMode mode);
-gboolean gimp_layer_mode_is_linear (GimpLayerMode mode);
+gboolean gimp_layer_mode_is_legacy (GimpLayerMode mode);
+gboolean gimp_layer_mode_is_linear (GimpLayerMode mode);
-const gchar * gimp_layer_mode_get_operation (GimpLayerMode mode);
+GimpLayerBlendTRC gimp_layer_mode_get_blend_trc (GimpLayerMode mode);
+GimpLayerBlendTRC gimp_layer_mode_get_composite_trc (GimpLayerMode mode);
+GimpLayerCompositeMode gimp_layer_mode_get_composite_mode (GimpLayerMode mode);
+
+const gchar * gimp_layer_mode_get_operation (GimpLayerMode mode);
#endif /* __GIMP_LAYER_MODES_H__ */
diff --git a/app/gegl/gimp-gegl-nodes.c b/app/gegl/gimp-gegl-nodes.c
index 87fc1ba..9341c2e 100644
--- a/app/gegl/gimp-gegl-nodes.c
+++ b/app/gegl/gimp-gegl-nodes.c
@@ -157,9 +157,12 @@ gimp_gegl_mode_node_set_mode (GeglNode *node,
* all its properties
*/
gegl_node_set (node,
- "operation", gimp_layer_mode_get_operation (mode),
- "opacity", opacity,
- "linear", gimp_layer_mode_is_linear (mode),
+ "operation", gimp_layer_mode_get_operation (mode),
+ "opacity", opacity,
+ "linear", gimp_layer_mode_is_linear (mode),
+ "blend-trc", gimp_layer_mode_get_blend_trc (mode),
+ "composite-trc", gimp_layer_mode_get_composite_trc (mode),
+ "composite-mode", gimp_layer_mode_get_composite_mode (mode),
NULL);
}
diff --git a/app/operations/layer-modes/gimpoperationpointlayermode.c
b/app/operations/layer-modes/gimpoperationpointlayermode.c
index 3b19cc8..419f1c1 100644
--- a/app/operations/layer-modes/gimpoperationpointlayermode.c
+++ b/app/operations/layer-modes/gimpoperationpointlayermode.c
@@ -36,7 +36,10 @@ enum
{
PROP_0,
PROP_LINEAR,
- PROP_OPACITY
+ PROP_OPACITY,
+ PROP_BLEND_TRC,
+ PROP_COMPOSITE_TRC,
+ PROP_COMPOSITE_MODE
};
@@ -88,6 +91,32 @@ gimp_operation_point_layer_mode_class_init (GimpOperationPointLayerModeClass *kl
0.0, 1.0, 1.0,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT));
+
+ g_object_class_install_property (object_class, PROP_BLEND_TRC,
+ g_param_spec_enum ("blend-trc",
+ NULL, NULL,
+ GIMP_TYPE_LAYER_BLEND_TRC,
+ GIMP_LAYER_BLEND_RGB_LINEAR,
+ GIMP_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT));
+
+
+ g_object_class_install_property (object_class, PROP_COMPOSITE_TRC,
+ g_param_spec_enum ("composite-trc",
+ NULL, NULL,
+ GIMP_TYPE_LAYER_BLEND_TRC,
+ GIMP_LAYER_BLEND_RGB_LINEAR,
+ GIMP_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT));
+
+ g_object_class_install_property (object_class, PROP_COMPOSITE_MODE,
+ g_param_spec_enum ("composite-mode",
+ NULL, NULL,
+ GIMP_TYPE_LAYER_COMPOSITE_MODE,
+ GIMP_LAYER_COMPOSITE_SRC_OVER,
+ GIMP_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT));
+
}
static void
@@ -113,6 +142,18 @@ gimp_operation_point_layer_mode_set_property (GObject *object,
self->opacity = g_value_get_double (value);
break;
+ case PROP_BLEND_TRC:
+ self->blend_trc = g_value_get_enum (value);
+ break;
+
+ case PROP_COMPOSITE_TRC:
+ self->composite_trc = g_value_get_enum (value);
+ break;
+
+ case PROP_COMPOSITE_MODE:
+ self->composite_mode = g_value_get_enum (value);
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
@@ -137,6 +178,18 @@ gimp_operation_point_layer_mode_get_property (GObject *object,
g_value_set_double (value, self->opacity);
break;
+ case PROP_BLEND_TRC:
+ g_value_set_enum (value, self->blend_trc);
+ break;
+
+ case PROP_COMPOSITE_TRC:
+ g_value_set_enum (value, self->composite_trc);
+ break;
+
+ case PROP_COMPOSITE_MODE:
+ g_value_set_enum (value, self->composite_mode);
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
@@ -176,7 +229,7 @@ gimp_operation_point_layer_mode_process (GeglOperation *operation,
{
GObject *input;
- /* get the raw values this does not increase the reference count */
+ /* get the raw values, this does not increase the reference count */
input = gegl_operation_context_get_object (context, "input");
if (input)
diff --git a/app/operations/layer-modes/gimpoperationpointlayermode.h
b/app/operations/layer-modes/gimpoperationpointlayermode.h
index af0a6e0..630e060 100644
--- a/app/operations/layer-modes/gimpoperationpointlayermode.h
+++ b/app/operations/layer-modes/gimpoperationpointlayermode.h
@@ -46,6 +46,9 @@ struct _GimpOperationPointLayerMode
gboolean linear;
gdouble opacity;
+ GimpLayerBlendTRC blend_trc;
+ GimpLayerBlendTRC composite_trc;
+ GimpLayerCompositeMode composite_mode;
};
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]