Here's another small wrinkle in the trapezoid algorithm:
Direct application of the the algorithm to all pixels can result in
non-zero alpha for pixels that are clearly "outside" the trapezoid.
Consider the following trapezoid, contained entirely within the pixel
immediately to the right of the pixel shown in this diagram, (which
should have zero alpha):
right left
` \
+-------`---\--+
| ` \ |
| ` \|
| `\
| |`
top --+--------------+-\`-----
bottom --+--------------+--\-`---
| | \ `
+--------------+ \ `
If the algorithm is applied to the pixel above, it can yield a
positive alpha value.
This problem is fairly easy to avoid by restricting application of the
algorithm to pixels that actually intersect the trapezoid. The
specification will have to say something along these lines. Computing
a pixel-aligned bounding-box for the trapezoid is fairly easy to do,
and is sufficient here.
-Carl
--
Carl Worth
USC Information Sciences Institute [EMAIL PROTECTED]
_______________________________________________
Render mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/render