Re: Sub-pixel area computations

Carl Worth <[email protected]>
Newsgroups gmane.comp.xfree86.render
Message-ID <[email protected]>
On May 2, Keith Packard wrote:
 > Around 11 o'clock on May 2, Carl Worth wrote:
 > 
 > > This is what had been thinking to do originally. Do you see any
 > > problem with this approach?
 > 
 > Yes.  Which coordinates get snapped determines the result of the 
 > computation; this essentially codifies one implementation as the standard 
 > rather than building a spec which can be matched with multiple different 
 > implementations.  In particular, I doubt very much that we'd ever see 
 > hardware match this exactly.

What if the implementation corrected for the snapping by adjusting the
area calculation by adding/subtracting thin rectangles whose height
was determined by the error left from the bresenham snapping?

The inaccuracy from that would come from the fact that one end of the
error rectangle should actually be clipped by the angle of the
line. That should give a maximum inaccuracy of 1/2 of one sub-pixel
per error rectangle.

And, each pixel would need two error rectangles, so we have a maximum
error of one sub-pixel.

Good enough?

-Carl
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.