4 ms·
One project I found fascinating reading a while back when I was working on graphics, is AGG. It's a vector graphics toolkit, a bit like Cairo, Quartz 2D or Java
by dtf 17y ago
One project I found fascinating reading a while back when I was working on graphics, is AGG. It's a vector graphics toolkit, a bit like Cairo, Quartz 2D or Java 2D. It uses a particular style of C++ - a mixture of template programming together with regular polymorphism - to build up a collection of rendering components. The components are almost Unix-like - you plug them together to build your customized rendering pipeline, and the C++ compiler's template logic takes care of making everything hardwired (or dynamic, if you choose to use the polymorphic components):
http://www.antigrain.com/
The end result is a toolkit which is at a lower level than Quartz 2D et al, but could easily be used to build such an API. It can also be adapted for embedded, or high precision uses.
- tmsh 17y agohttp://www.haiku-os.org/documents/dev/painter_and_how_agg_works http://www.haiku-os.org/documents/dev/painter_and_how_agg_wo... http://bit.ly/131cxL http://bit.ly/131cxL (.doc file) those help. if you can figure out the source code without the documentation at the agg site + those files, more power to you. but basically you are nuts.
- dtf 17y agoThanks for the links, I've never seen those before. I read the agg code without the docs, but it would have been difficult without the example programs. The docs definitely help when looking at some of the algorithms though. I remember spending a good day or two staring at the anti-aliasing code, together with the freetype rasterizer (on which it was based), trying to figure out what the hell was going on. Then in just clicked.