Bug 527085 – Hue/Saturation (working improperly)

* app/gegl/gimpoperationhuesaturation.c
(gimp_operation_hue_saturation_process): Properly map the
secondary hue. Based on patch by Michael Deal.

svn path=/trunk/; revision=26883
This commit is contained in:
Martin Nordholts 2008-09-06 06:53:43 +00:00
parent 8af1f28489
commit cadfb1c68f
2 changed files with 33 additions and 6 deletions

View File

@ -1,3 +1,11 @@
2008-09-06 Martin Nordholts <martinn@svn.gnome.org>
Bug 527085 Hue/Saturation (working improperly)
* app/gegl/gimpoperationhuesaturation.c
(gimp_operation_hue_saturation_process): Properly map the
secondary hue. Based on patch by Michael Deal.
2008-09-05 Sven Neumann <sven@gimp.org>
* app/tools/gimpgegltool.c: blacklist "color-convert" and all GIMP

View File

@ -207,14 +207,33 @@ gimp_operation_hue_saturation_process (GeglOperation *operation,
if (use_secondary_hue)
{
hsl.h = (map_hue (config, hue, hsl.h) * primary_intensity +
map_hue (config, secondary_hue, hsl.h) * secondary_intensity);
gdouble mapped_primary;
gdouble mapped_secondary;
gdouble diff;
hsl.s = (map_saturation (config, hue, hsl.s) * primary_intensity +
map_saturation (config, secondary_hue, hsl.s) * secondary_intensity);
mapped_primary = map_hue (config, hue, hsl.h);
mapped_secondary = map_hue (config, secondary_hue, hsl.h);
hsl.l = (map_lightness (config, hue, hsl.l) * primary_intensity +
map_lightness (config, secondary_hue, hsl.l) * secondary_intensity);
// Find nearest hue on the circle between primary and
// secondary hue
diff = mapped_primary - mapped_secondary;
if (diff < -0.5)
{
mapped_secondary -= 1.0;
}
else if (diff >= 0.5)
{
mapped_secondary += 1.0;
}
hsl.h = mapped_primary * primary_intensity +
mapped_secondary * secondary_intensity;
hsl.s = map_saturation (config, hue, hsl.s) * primary_intensity +
map_saturation (config, secondary_hue, hsl.s) * secondary_intensity;
hsl.l = map_lightness (config, hue, hsl.l) * primary_intensity +
map_lightness (config, secondary_hue, hsl.l) * secondary_intensity;
}
else
{