|
From: Maxim S. <mcs...@ya...> - 2006-07-26 17:19:36
|
> 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 __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |