Commit d4ff9921 authored by Helvetix Victorinox's avatar Helvetix Victorinox
Browse files

Repaired an oversight on the application of hue/color/saturation/value on

* app/composite/gimp-composite-generic.c: Repaired an oversight on
  the application of hue/color/saturation/value on non-rgb images.
  Fixes bug #127669
parent c311694d
2003-11-24 Helvetix Victorinox <helvetix@gimp.org>
* app/composite/gimp-composite-generic.c: Repaired an oversight on
the application of hue/color/saturation/value on non-rgb images.
Fixes bug #127669
2003-11-24 Sven Neumann <sven@gimp.org>
 
* configure.in: (hopefully) fixed the check for the symbol prefix.
......@@ -377,36 +377,40 @@ gimp_composite_hue_any_any_any_generic (GimpCompositeContext * ctx)
guint r1, g1, b1;
guint r2, g2, b2;
/* assumes inputs are only 4 byte RGBA pixels */
while (length--)
{
r1 = src1[0];
g1 = src1[1];
b1 = src1[2];
r2 = src2[0];
g2 = src2[1];
b2 = src2[2];
gimp_rgb_to_hsv_int(&r1, &g1, &b1);
gimp_rgb_to_hsv_int(&r2, &g2, &b2);
if (bytes1 > 2) {
/* assumes inputs are only 4 byte RGBA pixels */
while (length--)
{
r1 = src1[0];
g1 = src1[1];
b1 = src1[2];
r2 = src2[0];
g2 = src2[1];
b2 = src2[2];
gimp_rgb_to_hsv_int(&r1, &g1, &b1);
gimp_rgb_to_hsv_int(&r2, &g2, &b2);
r1 = r2;
r1 = r2;
/* set the destination */
gimp_hsv_to_rgb_int(&r1, &g1, &b1);
/* set the destination */
gimp_hsv_to_rgb_int(&r1, &g1, &b1);
dest[0] = r1;
dest[1] = g1;
dest[2] = b1;
dest[0] = r1;
dest[1] = g1;
dest[2] = b1;
if (has_alpha1 && has_alpha2)
dest[3] = MIN(src1[3], src2[3]);
else if (has_alpha2)
dest[3] = src2[3];
if (has_alpha1 && has_alpha2)
dest[3] = MIN(src1[3], src2[3]);
else if (has_alpha2)
dest[3] = src2[3];
src1 += bytes1;
src2 += bytes2;
dest += bytes2;
}
src1 += bytes1;
src2 += bytes2;
dest += bytes2;
}
} else {
ctx->D = ctx->B;
}
}
......@@ -432,36 +436,40 @@ gimp_composite_saturation_any_any_any_generic (GimpCompositeContext * ctx)
guint r1, g1, b1;
guint r2, g2, b2;
/* assumes inputs are only 4 byte RGBA pixels */
while (length--)
{
r1 = src1[0];
g1 = src1[1];
b1 = src1[2];
r2 = src2[0];
g2 = src2[1];
b2 = src2[2];
gimp_rgb_to_hsv_int(&r1, &g1, &b1);
gimp_rgb_to_hsv_int(&r2, &g2, &b2);
if (bytes1 > 2) {
/* assumes inputs are only 4 byte RGBA pixels */
while (length--)
{
r1 = src1[0];
g1 = src1[1];
b1 = src1[2];
r2 = src2[0];
g2 = src2[1];
b2 = src2[2];
gimp_rgb_to_hsv_int(&r1, &g1, &b1);
gimp_rgb_to_hsv_int(&r2, &g2, &b2);
g1 = g2;
g1 = g2;
/* set the destination */
gimp_hsv_to_rgb_int(&r1, &g1, &b1);
/* set the destination */
gimp_hsv_to_rgb_int(&r1, &g1, &b1);
dest[0] = r1;
dest[1] = g1;
dest[2] = b1;
dest[0] = r1;
dest[1] = g1;
dest[2] = b1;
if (has_alpha1 && has_alpha2)
dest[3] = MIN(src1[3], src2[3]);
else if (has_alpha2)
dest[3] = src2[3];
if (has_alpha1 && has_alpha2)
dest[3] = MIN(src1[3], src2[3]);
else if (has_alpha2)
dest[3] = src2[3];
src1 += bytes1;
src2 += bytes2;
dest += bytes2;
}
src1 += bytes1;
src2 += bytes2;
dest += bytes2;
}
} else {
ctx->D = ctx->B;
}
}
......@@ -487,36 +495,41 @@ gimp_composite_value_any_any_any_generic (GimpCompositeContext * ctx)
guint r1, g1, b1;
guint r2, g2, b2;
/* assumes inputs are only 4 byte RGBA pixels */
while (length--)
{
r1 = src1[0];
g1 = src1[1];
b1 = src1[2];
r2 = src2[0];
g2 = src2[1];
b2 = src2[2];
gimp_rgb_to_hsv_int(&r1, &g1, &b1);
gimp_rgb_to_hsv_int(&r2, &g2, &b2);
if (bytes1 > 2) {
/* assumes inputs are only 4 byte RGBA pixels */
/* assumes inputs are only 4 byte RGBA pixels */
while (length--)
{
r1 = src1[0];
g1 = src1[1];
b1 = src1[2];
r2 = src2[0];
g2 = src2[1];
b2 = src2[2];
gimp_rgb_to_hsv_int(&r1, &g1, &b1);
gimp_rgb_to_hsv_int(&r2, &g2, &b2);
b1 = b2;
b1 = b2;
/* set the destination */
gimp_hsv_to_rgb_int(&r1, &g1, &b1);
/* set the destination */
gimp_hsv_to_rgb_int(&r1, &g1, &b1);
dest[0] = r1;
dest[1] = g1;
dest[2] = b1;
dest[0] = r1;
dest[1] = g1;
dest[2] = b1;
if (has_alpha1 && has_alpha2)
dest[3] = MIN(src1[3], src2[3]);
else if (has_alpha2)
dest[3] = src2[3];
if (has_alpha1 && has_alpha2)
dest[3] = MIN(src1[3], src2[3]);
else if (has_alpha2)
dest[3] = src2[3];
src1 += bytes1;
src2 += bytes2;
dest += bytes2;
}
src1 += bytes1;
src2 += bytes2;
dest += bytes2;
}
} else {
ctx->D = ctx->B;
}
}
......@@ -542,38 +555,42 @@ gimp_composite_color_only_any_any_any_generic (GimpCompositeContext * ctx)
guint r1, g1, b1;
guint r2, g2, b2;
/* assumes inputs are only 4 byte RGBA pixels */
while (length--)
{
r1 = src1[0];
g1 = src1[1];
b1 = src1[2];
r2 = src2[0];
g2 = src2[1];
b2 = src2[2];
gimp_rgb_to_hsl_int(&r1, &g1, &b1);
gimp_rgb_to_hsl_int(&r2, &g2, &b2);
/* transfer hue and saturation to the source pixel */
r1 = r2;
g1 = g2;
/* set the destination */
gimp_hsl_to_rgb_int(&r1, &g1, &b1);
dest[0] = r1;
dest[1] = g1;
dest[2] = b1;
if (has_alpha1 && has_alpha2)
dest[3] = MIN(src1[3], src2[3]);
else if (has_alpha2)
dest[3] = src2[3];
if (bytes1 > 2) {
/* assumes inputs are only 4 byte RGBA pixels */
while (length--)
{
r1 = src1[0];
g1 = src1[1];
b1 = src1[2];
r2 = src2[0];
g2 = src2[1];
b2 = src2[2];
gimp_rgb_to_hsl_int(&r1, &g1, &b1);
gimp_rgb_to_hsl_int(&r2, &g2, &b2);
/* transfer hue and saturation to the source pixel */
r1 = r2;
g1 = g2;
/* set the destination */
gimp_hsl_to_rgb_int(&r1, &g1, &b1);
dest[0] = r1;
dest[1] = g1;
dest[2] = b1;
if (has_alpha1 && has_alpha2)
dest[3] = MIN(src1[3], src2[3]);
else if (has_alpha2)
dest[3] = src2[3];
src1 += bytes1;
src2 += bytes2;
dest += bytes2;
}
src1 += bytes1;
src2 += bytes2;
dest += bytes2;
}
} else {
ctx->D = ctx->B;
}
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment