|
From: Salman K. <sk...@ta...> - 2003-11-26 02:31:48
|
Can someone tell me which kinds of shading does AGG support from the PDF specification? The list from version 1.3 of PDF reference is: 1. Function-based shading 2 Axial shading 3. Radial shading 4 Free Form Gouraud 5. Lattice-from Gouraud 6 Coons patch mesh 7 Tensor product patch mesh Also from the PDF specification, one can use character glyphs as clipping paths. One can also apply patterns and shadings to character glyphs. I was thinking about using freetype for all font rendering. If one uses freetype, then this would not be possible. Will it be enough if I can somehow convert the outline of the character glyph from freetype into a path that AGG can understand? Then instead of having freetype do the rendering and blending it on top the agg graphics, one can let AGG render the outlines? Am I making any sense? BTW, I would like to start a project that can create PDF using C++. One should be able to do the drawings in user-space coords using AGG and then export the result as a PDF file. Right now, I am not interested in supporting all the color specifications that PDF specifies....just device dependent RGB is enough for me. Anyone already got a similar C++ based project that I might contribute to? Salman |
|
From: eric j. <er...@en...> - 2003-11-26 03:56:17
|
Hey Salman, The kiva project provides a DisplayPDF drawing API for Python. It is the inverse of what you describe (uses a PDF-like API which uses agg under the covers to do the actual drawing). Still, I'll describe it here. A few more details about it can be found here: http://www.scipy.org/site_content/chaco/project_info One of the backends supported by kiva is agg. Kiva also has various levels of support for PDF, SVG, PS, OpenGL, and wxPython. The agg backend code is all encapsulated in a few header files that don't have any python dependencies. It might take a little restructuring (moving some code to .cxx files), but it shouldn't be hard to make the code appropriate for C++ applications. Currently, text drawing is supported by passing in an alpha mask rendered by freetype (or I guess anything else). The shading stuff, multi-box clipping, patterns, and much of the other stuff you mention hasn't made it into the code yet (I just can't keep up with McSeem...). Also, the code uses an agg codebase circa 2-3 weeks ago (ancient history around here :-). Still, it works fairly well for line paths, filled polygons, and images which covers most (but not all) of the needs for rendering plots (currently its primary function). We've recently moved the repository to svn, and you can view the code here: http://www.enthought.com/cgi-bin/enthoughtsvn.cgi/trunk/kiva/agg/src/ Take a look at: kiva_graphics_context_base.h as it pretty much defines the entire API (and most of the implementation). I think it is a good idea for this become a C++ DisplayPDF engine as well as supporting Python. The only caveat is that developers must test the Python frontend before committing since it is the critical part of the project from our standpoint. eric Salman Khilji wrote: >Can someone tell me which kinds of shading does AGG support from the PDF >specification? The list from version 1.3 of PDF reference is: > >1. Function-based shading >2 Axial shading >3. Radial shading >4 Free Form Gouraud >5. Lattice-from Gouraud >6 Coons patch mesh >7 Tensor product patch mesh > > >Also from the PDF specification, one can use character glyphs as clipping >paths. One can also apply patterns and shadings to character glyphs. I was >thinking about using freetype for all font rendering. If one uses freetype, >then this would not be possible. > >Will it be enough if I can somehow convert the outline of the character glyph >from freetype into a path that AGG can understand? Then instead of having >freetype do the rendering and blending it on top the agg graphics, one can >let AGG render the outlines? Am I making any sense? > >BTW, I would like to start a project that can create PDF using C++. One >should be able to do the drawings in user-space coords using AGG and then >export the result as a PDF file. Right now, I am not interested in >supporting all the color specifications that PDF specifies....just device >dependent RGB is enough for me. Anyone already got a similar C++ based >project that I might contribute to? > >Salman > > > >------------------------------------------------------- >This SF.net email is sponsored by: SF.net Giveback Program. >Does SourceForge.net help you be more productive? Does it >help you create better code? SHARE THE LOVE, and help us help >YOU! Click Here: http://sourceforge.net/donate/ >_______________________________________________ >Vector-agg-general mailing list >Vec...@li... >https://lists.sourceforge.net/lists/listinfo/vector-agg-general > > |
|
From: Maxim S. <mcs...@ya...> - 2003-11-26 04:31:34
|
> Can someone tell me which kinds of shading does AGG support from the PDF > specification? The list from version 1.3 of PDF reference is: > > 1. Function-based shading > 2 Axial shading > 3. Radial shading > 4 Free Form Gouraud > 5. Lattice-from Gouraud > 6 Coons patch mesh > 7 Tensor product patch mesh For now there're only gradients with use an arbitrary C++ functor and Gouraud shading of triangles (linear color interpolation between triangle vertices). The standards usually have gigantomania, they try to describe the whole known Universe, whatever it takes. Take SVG, for example. It's almost impossible to implement all its features in reasonable time and budget. The only more or less full implementation I know is Adobe SVG viewer. But when you try to use some non-trivial possibilities of SVG, it starts crashing, leaking, etc. I try to concentrate on primary needs keeping the implementation efficient and reliable. > Will it be enough if I can somehow convert the outline of the character glyph > > from freetype into a path that AGG can understand? Then instead of having > freetype do the rendering and blending it on top the agg graphics, one can > let AGG render the outlines? Am I making any sense? Yes. There're two ways of using FreeType. Fist is just rendering the rasterized glyps, and secong, to use FreeType as a path source. In the last case you can apply any available transformations, like stroke, contour, etc. Particulary, you can use it as a clipping path (which is not implemented yet). McSeem __________________________________ Do you Yahoo!? Free Pop-Up Blocker - Get it now http://companion.yahoo.com/ |
|
From: Klaas H. <kho...@xs...> - 2003-11-26 15:13:45
|
Salman Khilji wrote: > Anyone already got a similar C++ based >project that I might contribute to? > > I think the following: http://wxart2d.sourceforge.net/ will give you a solid base for this. It uses the concept of filling internal documents ( on of the being a wxCanavsDocument ). And drawing those document (parts/level) on view, called wxDrawer. The wxDrawer uses an abstract drawing context wxDrawer2D, which is either wxDC based (wxWindows) or Agg based, or whatever (e.g. pdf). Next to that one can load and save a document (containing a drawing) to files using wxDocumentIoHandler. I have currenlty GDSII SVG CVG, pdf would be nice to have too ;-). I use an old version of Agg, and as soon as Agg is documented and/or less changing, will rewrite it. It is based on wxWindows, so platform independent. ( Linux and Windows, and MAC also seems to work) Regards, Klaas |