[cairo] Avoiding seams (again)

Mike Emmel mike.emmel at gmail.com
Fri Apr 7 19:10:47 PDT 2006

On 4/7/06, MenTaLguY <mental at rydia.net> wrote:
> On Thu, 6 Apr 2006 15:36:53 -0700, "Mike Emmel" <mike.emmel at gmail.com> wrote:
> > In this case you would rasterize only the alpha plane and maintain the
> > flattened paths in the firt pass you could even use and extended concept
> > of alpha say a 16-32 but number that used the extra bits to say record
> > how many times the pixel was colored or in this case alpha was set. That
> > may be enough information itself. Saving the flattened paths is simply
> > to not rasterize them agian but the extended alpha format would/could
> > have enough info so you don't need the paths.
> For accurate coverage, within each pixel you need to know not only "how many",
> and "how much", but "where".  Coverage implies geometric knowledge.  This is
> trivial if you are supersampling (or not antialiasing edges at all, which is
> a degenerate case of that), but once you've converted coverage to alpha you've
> already thrown away the most important information.
> Alpha and coverage are separate concepts; the artifacts are a result of trying
> to combine them.
> That said, you may get a better handle on the issue if you implement some
> simple code to demonstrate your idea.  A rasterizer for polygons is not hard to
> write; I can give you some pointers if you like.
> -mental

Right I think you need to keep alpha how many times and as you say the
geometric pixel location or basically the abstract coordinates that
resulted in this pixel getting painted.

So in fat 2D pixel would need alpha value 8 bits count 8 bits x,y 16
and 16 bit lets say
if you do that then its 32+16 bits for 48 bits you just as well do
32+32 which is 64 bit and
still small enough to be reasonably handled so in this case the super
fat pixel is just twice as large as a  32bit argb pixel not horribly
big IMHO the extra bits could be used say in the coordinates or to
make the count bits larger.

Now what would I have to detect to determine artificats if this is
enough information.

1.) Unpainted pixels right.
2.) Multi painted ( then what would I do )
3.) Maybe close edges ?

I'd be happy to right a simple rasteriser  I've actually done one
before but if you have some good references I'd be happy to look at
them. Right now I'm not yet sure what the alogrithm is just that I
think this fat pixel contains enough data to solve the problem.

So given the above what would I need to do to detect and fix artifacts
I'm assuming suport sampling then scaling down fixes by drawing enough
pixels that when you scale down the chances of artifact pixels is
lower this suggests the main fix is to look for unpainted pixels and
assign them the same alpha as the geometric closest pixel ??

If you can give me a bit more info on whcat you think I would do with
this information then I'd write the code.


More information about the cairo mailing list