On May 2, Keith Packard wrote:
 > Ok, I spent the afternoon drawing figures on a whiteboard and getting help
 > from the PSU CS department here in Portland.  I have the kernel of a
 > solution, which I'll explore here to see if it solves the general case.

Keith,

This looks very good. The specified functions are correct and should
not be hairy at all for an implementation. And I can't complain about
only needing 32 bits rather than 64. :-)

 > I suggest that
 >
 >      round (alpha * a / b)
 >
 > be computed as
 >
 >      round (alpha * (a/b))
 >
 > This clearly ensures the ordering constraint for sub-region areas.  The
 > alternate:
 >
 >      ((alpha * (a >> depth)) / b + (1 << (30 - depth))) >> (31 - depth)
 >
 > is slightly more accurate; it appears to also obey the constraint, but I'd
 > have to think harder to convince myself.

For these implementation suggestions, I'll have to think about them a
bit more.

Meanwhile, I don't think it will be hard to plug in the new alpha
calculations to the implementation shell I have so far. The only
outstanding implementation issue I'm still dealing with is in coming up
with the rounded-off sub-pixel vertex coordinates:

+-------+-------+-------+-------+
|       |       |       |       |
A       |       |       |       |
| \     |       |       |       |
|   \   |       |       |       |
|     \ |       |       |       |
|       B       |       |       |
|       | \     |       |       |
+-------+---P---+-------+-------+
|       |     \ |       |       |
|       |       C       |       |
|       |       | \     |       |
|       |       |   \   |       |
|       |       |     \ |       |
|       |       |       D       |
|       |       |       | \     |
+-------+-------+-------+---\---+

Here I've drawn an X-major line passing through 5 pixels.
A bresenham-like walk can take me through each of the points A, B, C,
and D. At each of these points it gives me an exact X coordinate
within the RENDER sub-pixel grid. It also provides a rounded-off Y
coordinate along with a rational term for the error in the Y
coordinate so that I can compensate for that error as necessary while
walking.

My difficulty is in coming up with the correct coordinates for the
point P. What is needed is a way to go from point B which has an exact
X coordinate and a Y with an error term to the intersection point P
which is defined by the intersection of the line with an exact Y
coordinate. I'm not sure if it would be easy to do something like
multiply the Y-error term by the slope to come up with the X-error
term at point P. I'll have to think about this more.

So, that's what I'm fiddling with today. If anyone has any
suggestions, I would appreciate it.

-Carl

--
Carl Worth
USC Information Sciences Institute                 [EMAIL PROTECTED]
3811 N. Fairfax Dr. #200, Arlington VA 22203              703-812-3725
_______________________________________________
Render mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/render

Reply via email to