Re: Sub-pixel area computations

Keith Packard <[email protected]>
Newsgroups gmane.comp.xfree86.render
Message-ID <E173K05-00088o-00@localhost>
We can't snap coordinates to the top and bottom of the trapezoid -- we 
could snap them to the top and bottom of the pixel.  Here's why:

                        E
                         \
                +---------J----+
                |          \   |
                |    A      \ B|
           ==================I |
                |             \|
                |    C         K
                |              |\
                +--------------+ \

I'm tesselating a figure and I've got three trapezoids meeting here in 
this pixel.  The sum of A, B and C must be exactly 1.  The area to the 
left of 'E' is going to be compute three times, the whole area when 
drawing 'B', and part of the area when drawing 'A' and 'C'.  The sub-area 
computations needed for 'A' and 'C' must sum to the same value as the area 
computation needed for 'B'.  

Hence the x coordinate at the intersection 'I' cannot be snapped for the
computation of either A or C -- the location of 'I' is unknown during the 
computation of 'B'.  If snapping 'J' and 'K' would be useful, we can do 
that -- those locations are known during all of the computations.

-keith
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.