|
From: Ivan N. <in...@pd...> - 2006-07-27 19:30:57
|
Maxim, What I am suggesting is to allow for some kind of integration of the compound rasterizer with other AGG pieces (e.g. other span rasterizers, scan-bool clipping, etc). For example, since compound rasterizer generates scanlines, it may be a good idea to wrap the compound rasterizer in a new SpanGenerator? Then the compound rasterizer could be used to fill spans generated using rasterizer_aa, rasterizer_aa_solid, or 'scan-bool' shapes (e.g. by caching the current scanline to fill all the spans generated by the span generator, then moving to the next scanline, etc). This way it would be possible to use compound rasterizer together with other rasterizers, clippers, SpanGenerators, etc. What do you think? Ivan -----Original Message----- Message: 7 Date: Wed, 26 Jul 2006 10:19:28 -0700 (PDT) From: Maxim Shemanarev <mcs...@ya...> Subject: Re: [AGG] SpanGenerators To: Anti-Grain Geometry <vec...@li...> Message-ID: <200...@we...> Content-Type: text/plain; charset=iso-8859-1 > I am doing some tests with the new layered compound rasterizer. Would it be > possible to use this rasterizer in conjunction with other AGG pieces? In > particular, I am not completely clear on how to clip the rendered output > against a 'scan-bool' region. sbool_combine_shapes_aa expects the last > parameter to be a 'renderer', but currently there is no compound renderer > (analogous to renderer_scanline_aa) and I am not sure how to write one (e.g. > render_scanlines_compound_layered accepts rasterizer). Well, it's more complex. The problem is that a scanline is in general multi-color. So, render_scanlines_compound_layered pulls scanlines that correspond to certain styles and composes a combined multi-color span. A single span may consist of may scanlines, one per style. So, there's no way to collect them in a scanline storage. It's technically possible to apply some boolean operation after "if(ras.sweep_scanline(sl_aa, i))" in this function, but I'm afraid the design may become too complex. Besides, scanline boolean operates with scanline shapes, not separate scanlines, so, it also requires some redesign and it's not that obvious how to do that. As an alternative for the existing version you can use alpha-masking; agg_pixfmt_amask_adaptor.h will work, but it's restricted. BTW, there's an idea. It's technically possible to perform any boolean and/or arithmetic compositing operations directly in render_scanlines_compound_layered. Now I use only rgba8::add(), which performs "geometry flattening", or just "multicolor union" operation. What we need is: 1. A possibility to substitute the logical/compositing operation. 2. A possibility to specify the operation for each layer. That would provide all the Constructive Solid Geometry functionality (and even more) done in the rasterizer, but it requires serious redesign of some parts, like color compositing. McSeem |