mirror of https://github.com/GNOME/gimp.git
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:
parent
8af1f28489
commit
cadfb1c68f
|
@ -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
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue