GNOME GIT source code repository

summaryrefslogtreecommitdiff
authorMartin Nordholts <martinn@src.gnome.org>2009-08-02 19:35:10 (GMT)
committer Martin Nordholts <martinn@src.gnome.org>2009-08-02 19:36:00 (GMT)
commit18603ac192493296b191197a3e2b62c710398afd (patch) (side-by-side diff)
treeeeb973a8d192568b6ae6bbe19c0b848b14d770a7
parent87d463aed093139672d41f468e45522f9b2ce1b6 (diff)
Bug 401754 – Port Hue, Saturation, Value to CIE LCH
When using GEGL for the projection, use CIE LCH for the Hue, Saturation and Value layer modes, just as we already do for the Color layer mode. The Value layer mode will later be renamed to Lightness since that is the semantics it has now.
-rw-r--r--app/gegl/gimpoperationpointlayermode.c63
1 files changed, 1 insertions, 62 deletions
diff --git a/app/gegl/gimpoperationpointlayermode.c b/app/gegl/gimpoperationpointlayermode.c
index 8b2f5be..276956f 100644
--- a/app/gegl/gimpoperationpointlayermode.c
+++ b/app/gegl/gimpoperationpointlayermode.c
@@ -197,55 +197,6 @@ gimp_operation_point_layer_mode_prepare (GeglOperation *operation)
}
static void
-gimp_operation_point_layer_mode_get_new_color_hsv (GimpLayerModeEffects blend_mode,
- const gfloat *in,
- const gfloat *lay,
- gfloat *new)
-{
- GimpRGB inRGB;
- GimpHSV inHSV;
- GimpRGB layRGB;
- GimpHSV layHSV;
- GimpRGB newRGB;
- GimpHSV newHSV;
-
- gimp_rgb_set (&inRGB, in[R], in[G], in[B]);
- gimp_rgb_set (&layRGB, lay[R], lay[G], lay[B]);
-
- gimp_rgb_to_hsv (&inRGB, &inHSV);
- gimp_rgb_to_hsv (&layRGB, &layHSV);
-
- switch (blend_mode)
- {
- case GIMP_HUE_MODE:
- gimp_hsv_set (&newHSV, layHSV.h, inHSV.s, inHSV.v);
- break;
-
- case GIMP_SATURATION_MODE:
- gimp_hsv_set (&newHSV, inHSV.h, layHSV.s, inHSV.v);
- break;
-
- case GIMP_COLOR_MODE:
- gimp_hsv_set (&newHSV, layHSV.h, layHSV.s, inHSV.v);
- break;
-
- case GIMP_VALUE_MODE:
- gimp_hsv_set (&newHSV, inHSV.h, inHSV.s, layHSV.v);
- break;
-
- default:
- g_assert_not_reached ();
- break;
- }
-
- gimp_hsv_to_rgb (&newHSV, &newRGB);
-
- new[R] = newRGB.r;
- new[G] = newRGB.g;
- new[B] = newRGB.b;
-}
-
-static void
gimp_operation_point_layer_mode_get_new_color_lchab (GimpLayerModeEffects blend_mode,
const gfloat *in,
const gfloat *lay,
@@ -588,20 +539,8 @@ gimp_operation_point_layer_mode_process (GeglOperation *operation,
case GIMP_HUE_MODE:
case GIMP_SATURATION_MODE:
- case GIMP_VALUE_MODE:
- /* Custom SVG 1.2:
- *
- * f(Sc, Dc) = New color depending on mode
- */
- gimp_operation_point_layer_mode_get_new_color_hsv (blend_mode,
- in,
- lay,
- new);
- EACH_CHANNEL (
- outCa = newCa * layA * inA + layCa * (1 - inA) + inCa * (1 - layA));
- break;
-
case GIMP_COLOR_MODE:
+ case GIMP_VALUE_MODE: /* GIMP_LIGHTNESS_MODE */
/* Custom SVG 1.2:
*
* f(Sc, Dc) = New color