From: Vinnie <th...@ya...> - 2009-04-27 17:45:54
|
Dear Group: I'm drawing a ton of cool-looking controls, sliders, and knobs with agg. Unfortunately all the gradient fills and anti-aliasing comes at the price of some speed. I want to cache certain un-changing elements into an offscreen bitmap. However, these elements have transparency information associated with them....so... I would first like to get an idea if what I need to do is possible with agg before I go delving in. Specifically, I want to create a new renderer (I think thats the component I need to modify) that instead of blending color values into the destination map using the coverage information, writes the color as a solid into the destination map, and stores the coverage information in a separate channel. In other words, produce the equivalent of a Photoshop Layer (red, green, and blue color planes plus one alpha channel for transparency) based on drawing output. For example if I draw an anti-aliased circle, I would want as my output to be a pure black circle in the RGB channels, with the coverage information going into the fourth channel (value=255 on the interior, and intermediate values 1-254 along the edge holding the coverage information). Would I do this by providing my own version of renderer_scanline_aa_solid? Is that the right class? Or does agg perhaps already have the ability to do this by some magic combination of nesting templates? Thanks! |