[Webkit-unassigned] [Bug 42273] Convolution computation causes bad alpha channel values
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Jul 15 01:30:01 PDT 2010
https://bugs.webkit.org/show_bug.cgi?id=42273
--- Comment #23 from Nikolas Zimmermann <zimmermann at kde.org> 2010-07-15 01:30:00 PST ---
(In reply to comment #22)
> unsigned char maxAlpha = 255;
> if (!preserveAlphaValues)
> maxAlpha = clampRGBAValue(totals[3]);
>
> Maybe:
>
> unsigned char maxAlpha = preserveAlphaValues ? 255 : clampRGBAValue(totals[3]);
>
> Not sure this is preferred.
Definately, good suggestion.
(In reply to comment #21)
> > image->set(pixel + 1, preserveAlphaValues ? src->get(pixel) : alpha);
> > ++pixel;
>
> Are you sure it is "pixel + 1"? Isn't it just "pixel"? And "pixel++" even shorter.
I think both versions are wrong, this should be correct (please correct me if I'm wrong):
if (preserveAlphaValues) {
image->set(pixel, src->get(pixel));
++pixel;
} else
image->set(pixel++, alpha);
I find "image->set(pixel++, src->get(pixel));" hard to read, that's why I was suggesting the change.
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list