[Poppler-bugs] [Bug 12185] Poppler does not correctly handle knockout groups

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Sep 20 14:08:20 PDT 2007


http://bugs.freedesktop.org/show_bug.cgi?id=12185





------- Comment #8 from jeff at infidigm.net  2007-09-20 14:09 PST -------
(In reply to comment #7)
> (In reply to comment #6)
> > Adding support for this to the cairo backend will require some work. Supporting
> > knockout groups requires tracking shape and opacity seperately. The cairo
> > backend currently implements transparency groups using cairo_push/pop_group,
> > but these do not help with tracking shape. However, support should be possible
> > by tracking shape with an additional CAIRO_CONTENT_ALPHA surface.
> 
> I did try an experiment to implement something very much like the
> example in plate 17 of the PDF reference, (a 2x2 matrix showing the
> effects of knockout and isolated grouups). And yes, it will be a bit
> tricky to do that completely. I think it will require two passes over
> the group in some cases, as you suggest.
> 
> But, for the limited use of knockout groups that cairo is currently
> emitting, you should be able to get by with something much
> simpler. For example, just drawing all objects within the group with
> CAIRO_OPERATOR_SOURCE should do the trick.

This falls apart as soon as you have a group inside the knock-out group. Which
is what the pdf generated by cairo has.

e.g.

cairo_set_source_arg(0.8, 0, 0, 0.5);
cairo_set_operator(SOURCE);
draw_square();

draw_circle_in_square();


has a very different result (circle inside square) than


cairo_set_source_arg(0.8, 0, 0, 0.5);
cairo_set_operator(SOURCE);
draw_square();

cairo_push_group();
draw_circle_in_square();
cairo_pop_group_to_source();
cairo_paint();

which paints a circle and clears the rest of the surface. (arguably not what
you'd expect when using push/pop_group()).

I have a very hacked up poppler tree that tries to do proper shape and opacity
tracking. The output is currently 'correct' except it looks bad (seams) because
of the lack of EXTEND_PAD.

-Jeff


-- 
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


More information about the Poppler-bugs mailing list