Commit 886aff77 authored by Shlomi Fish's avatar Shlomi Fish
Browse files

app/paint-funcs/paint-funcs.c fix bug #143315. When the visibility of the

* app/paint-funcs/paint-funcs.c
* app/paint-funcs/paint-funcs-generic.h: fix bug #143315. When the
visibility of the Alpha channel is turned off, it should make alpha=255.
parent 70203b1a
2005-03-14 Shlomi Fish <shlomif@iglu.org.il>
* app/paint-funcs/paint-funcs.c
* app/paint-funcs/paint-funcs-generic.h: fix bug #143315. When the
visibility of the Alpha channel is turned off, it should make alpha=255.
2005-03-13 Manish Singh <yosh@gimp.org>
* app/composite/gimp-composite-altivec.[ch]: More accelerated functions
......
......@@ -1568,6 +1568,9 @@ initial_inten_pixels (const guchar *src,
const guchar *srcp;
const gint dest_bytes = bytes + 1;
if (!affect[bytes])
opacity = 255;
if (mask)
{
m = mask;
......@@ -1578,8 +1581,6 @@ initial_inten_pixels (const guchar *src,
if (bytes == 3 && affect[0] && affect[1] && affect[2])
{
if (!affect[bytes])
opacity = 0;
destp = dest + bytes;
......@@ -1629,8 +1630,6 @@ initial_inten_pixels (const guchar *src,
}
/* fill the alpha channel */
if (!affect[bytes])
opacity = 0;
destp = dest + bytes;
......@@ -1656,9 +1655,6 @@ initial_inten_pixels (const guchar *src,
if (bytes == 3 && affect[0] && affect[1] && affect[2])
{
if (!affect[bytes])
opacity = 0;
destp = dest + bytes;
while(length--)
......@@ -1695,8 +1691,6 @@ initial_inten_pixels (const guchar *src,
}
/* fill the alpha channel */
if (!affect[bytes])
opacity = 0;
destp = dest + bytes;
......@@ -1733,7 +1727,7 @@ initial_inten_a_pixels (const guchar *src,
/* Set the alpha channel */
dest[alpha] = affect [alpha] ? INT_MULT3(opacity, src[alpha], *m, tmp)
: 0;
: 255;
m++;
......@@ -1749,7 +1743,7 @@ initial_inten_a_pixels (const guchar *src,
dest[b] = src[b] * affect[b];
/* Set the alpha channel */
dest[alpha] = affect [alpha] ? INT_MULT(opacity , src[alpha], tmp) : 0;
dest[alpha] = affect [alpha] ? INT_MULT(opacity , src[alpha], tmp) : 255;
dest += bytes;
src += bytes;
......
......@@ -832,7 +832,12 @@ combine_inten_and_inten_a_pixels (const guchar *src1,
}*/
#define alphify(src2_alpha,new_alpha) \
if (src2_alpha != 0 && new_alpha != 0) \
if (! affect[alpha]) \
{ \
b = alpha; \
do { b--; dest[b] = src2[b]; } while(b); \
} \
else if (src2_alpha != 0 && new_alpha != 0) \
{ \
b = alpha; \
if (src2_alpha == new_alpha){ \
......@@ -966,6 +971,24 @@ combine_inten_a_and_inten_pixels (const guchar *src1,
}
}
#define copy_bytes1() \
j = bytes * sizeof(int); \
if (affect[alpha]) \
{ \
src2 += j; \
while (j--) \
{ \
*(dest++) = *(src1++); \
} \
} \
else \
{ \
src1 += j; \
while (j--) \
{ \
*(dest++) = *(src2++); \
} \
}
void
combine_inten_a_and_inten_a_pixels (const guchar *src1,
......@@ -1067,12 +1090,7 @@ combine_inten_a_and_inten_a_pixels (const guchar *src1,
}
else
{
j = bytes * sizeof(int);
src2 += j;
while (j--)
{
*(dest++) = *(src1++);
}
copy_bytes1();
}
mask_ip++;
}
......@@ -1185,12 +1203,7 @@ combine_inten_a_and_inten_a_pixels (const guchar *src1,
}
else
{
j = bytes * sizeof(int);
src2 += j;
while (j--)
{
*(dest++) = *(src1++);
}
copy_bytes1();
}
mask_ip++;
}
......@@ -1280,6 +1293,7 @@ combine_inten_a_and_inten_a_pixels (const guchar *src1,
}
}
}
#undef copy_bytes1
#undef alphify
void
......
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