app: refer to (color) space instead of trc for blend/composite

Since CIE Lab is one of the supported color spaces for doing the blending -
this enum is not only about transfer functions/curves or gamma. This finishes
already started cleanups.
This commit is contained in:
Øyvind Kolås 2017-01-22 16:04:46 +01:00
parent b10fc58802
commit 2537d3d0e9
4 changed files with 35 additions and 35 deletions

View file

@ -213,8 +213,8 @@ gimp_composite_blend (gpointer op,
{
GimpOperationLayerMode *layer_mode = op;
gfloat opacity = layer_mode->opacity;
GimpLayerColorSpace blend_trc = layer_mode->blend_trc;
GimpLayerColorSpace composite_trc = layer_mode->composite_trc;
GimpLayerColorSpace blend_space = layer_mode->blend_space;
GimpLayerColorSpace composite_space= layer_mode->composite_space;
GimpLayerCompositeMode composite_mode = layer_mode->composite_mode;
gfloat *blend_in = in;
@ -235,12 +235,12 @@ gimp_composite_blend (gpointer op,
const Babl *fish_to_composite = NULL;
const Babl *fish_from_composite = NULL;
switch (blend_trc)
switch (blend_space)
{
default:
case GIMP_LAYER_COLOR_SPACE_RGB_LINEAR:
fish_to_blend = NULL;
switch (composite_trc)
switch (composite_space)
{
case GIMP_LAYER_COLOR_SPACE_LAB:
fish_to_composite = _gimp_fish_rgba_to_laba;
@ -260,7 +260,7 @@ gimp_composite_blend (gpointer op,
case GIMP_LAYER_COLOR_SPACE_LAB:
fish_to_blend = _gimp_fish_rgba_to_laba;
switch (composite_trc)
switch (composite_space)
{
case GIMP_LAYER_COLOR_SPACE_LAB:
default:
@ -280,7 +280,7 @@ gimp_composite_blend (gpointer op,
case GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL:
fish_to_blend = _gimp_fish_rgba_to_perceptual;
switch (composite_trc)
switch (composite_space)
{
case GIMP_LAYER_COLOR_SPACE_LAB:
default:
@ -306,7 +306,7 @@ gimp_composite_blend (gpointer op,
if (fish_to_blend)
{
if (in != out || (composite_needs_in_color &&
composite_trc == GIMP_LAYER_COLOR_SPACE_RGB_LINEAR))
composite_space == GIMP_LAYER_COLOR_SPACE_RGB_LINEAR))
{
/* don't convert input in-place if we're not doing in-place output,
* or if we're going to need the original input for compositing.
@ -326,7 +326,7 @@ gimp_composite_blend (gpointer op,
if (fish_to_composite)
{
if (composite_trc == GIMP_LAYER_COLOR_SPACE_RGB_LINEAR)
if (composite_space == GIMP_LAYER_COLOR_SPACE_RGB_LINEAR)
{
composite_in = in;
composite_layer = layer;

View file

@ -38,8 +38,8 @@ enum
PROP_LAYER_MODE,
PROP_LINEAR,
PROP_OPACITY,
PROP_BLEND_TRC,
PROP_COMPOSITE_TRC,
PROP_BLEND_SPACE,
PROP_COMPOSITE_SPACE,
PROP_COMPOSITE_MODE
};
@ -109,7 +109,7 @@ gimp_operation_layer_mode_class_init (GimpOperationLayerModeClass *klass)
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT));
g_object_class_install_property (object_class, PROP_BLEND_TRC,
g_object_class_install_property (object_class, PROP_BLEND_SPACE,
g_param_spec_enum ("blend-trc",
NULL, NULL,
GIMP_TYPE_LAYER_COLOR_SPACE,
@ -118,7 +118,7 @@ gimp_operation_layer_mode_class_init (GimpOperationLayerModeClass *klass)
G_PARAM_CONSTRUCT));
g_object_class_install_property (object_class, PROP_COMPOSITE_TRC,
g_object_class_install_property (object_class, PROP_COMPOSITE_SPACE,
g_param_spec_enum ("composite-trc",
NULL, NULL,
GIMP_TYPE_LAYER_COLOR_SPACE,
@ -170,12 +170,12 @@ gimp_operation_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);
case PROP_BLEND_SPACE:
self->blend_space = g_value_get_enum (value);
break;
case PROP_COMPOSITE_TRC:
self->composite_trc = g_value_get_enum (value);
case PROP_COMPOSITE_SPACE:
self->composite_space = g_value_get_enum (value);
break;
case PROP_COMPOSITE_MODE:
@ -210,12 +210,12 @@ gimp_operation_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);
case PROP_BLEND_SPACE:
g_value_set_enum (value, self->blend_space);
break;
case PROP_COMPOSITE_TRC:
g_value_set_enum (value, self->composite_trc);
case PROP_COMPOSITE_SPACE:
g_value_set_enum (value, self->composite_space);
break;
case PROP_COMPOSITE_MODE:

View file

@ -47,8 +47,8 @@ struct _GimpOperationLayerMode
GimpLayerMode layer_mode;
gboolean linear;
gdouble opacity;
GimpLayerColorSpace blend_trc;
GimpLayerColorSpace composite_trc;
GimpLayerColorSpace blend_space;
GimpLayerColorSpace composite_space;
GimpLayerCompositeMode composite_mode;
GimpBlendFunc blend_func;
};

View file

@ -307,18 +307,18 @@ do_layer_blend (GeglBuffer *src_buffer,
gfloat *paint_data;
gboolean linear;
GimpLayerModeFunc apply_func;
GimpLayerColorSpace blend_trc;
GimpLayerColorSpace composite_trc;
GimpLayerColorSpace blend_space;
GimpLayerColorSpace composite_space;
GimpLayerCompositeMode composite_mode;
paint_stride = gimp_temp_buf_get_width (paint_buf);
paint_data = (gfloat *) gimp_temp_buf_get_data (paint_buf);
linear = gimp_layer_mode_is_linear (paint_mode);
apply_func = gimp_get_layer_mode_function (paint_mode);
blend_trc = gimp_layer_mode_get_blend_space (paint_mode);
composite_trc = gimp_layer_mode_get_composite_space (paint_mode);
composite_mode = gimp_layer_mode_get_composite_mode (paint_mode);
linear = gimp_layer_mode_is_linear (paint_mode);
apply_func = gimp_get_layer_mode_function (paint_mode);
blend_space = gimp_layer_mode_get_blend_space (paint_mode);
composite_space = gimp_layer_mode_get_composite_space (paint_mode);
composite_mode = gimp_layer_mode_get_composite_mode (paint_mode);
if (linear)
iterator_format = babl_format ("RGBA float");
@ -363,12 +363,12 @@ do_layer_blend (GeglBuffer *src_buffer,
paint_pixel = paint_data + ((iter->roi[0].y - roi.y) * paint_stride + iter->roi[0].x - roi.x) * 4;
layer_data.layer_mode = paint_mode;
layer_data.linear = linear;
layer_data.opacity = opacity;
layer_data.blend_trc = blend_trc;
layer_data.composite_trc = composite_trc;
layer_data.composite_mode = composite_mode;
layer_data.layer_mode = paint_mode;
layer_data.linear = linear;
layer_data.opacity = opacity;
layer_data.blend_space = blend_space;
layer_data.composite_space = composite_space;
layer_data.composite_mode = composite_mode;
if (mask_buffer)
mask_pixel = (gfloat *)iter->data[2];