I’m writing a Python-module which should provide an easy OOP interface to low-level GUI platforms. To achieve this, a wrapper class needs to be created that is used by the classes in the module.
This is the (yet) class-diagram for the basic implementation.

This question is actually not about the design of the package, but if you have questions to it or have an idea what might be better, I won’t mind any comments/critics.
The DrawArea class is the glue between the low-level platform and the classes in the package. Events usually start here, as the wrapper should recognize mouse-/keyboard-events and inform it’s children about it.
Now, as you can see, the DrawArea class needs to implement some functions to render basic elements onto the GUI. Now, I’d like to get to know about the magic behind rendering circles, rounded rectangles, lines (with a thickness) and about anti-aliasing. One reason for it is that I’m simply interested into that topic, the other is that I’d like to deliver an implementation with the package. (Will be written in C/C++, I’m pretty sure Python would be tot slow for such rendering operations, isn’t it?)
Now my questions:
- Are there any good references for how to render circles, ellipses, rounded rectangles, or lines (with a thickness, the one-pixel-line is easy..)?
- Are there any good references for how to implement anti-aliasing?
- E.g., is anti-aliasing done while rendering an element or applied after all rendering-operations have been done?
- Would it be better to use something like a
Pathclass that will be rendered? I.e. a vectorized representation of the form that should be rendered. That would have the advantage to render any kind of 2-dimensional forms, but I don’t know how to implement it. Are there good references for rendering vector-graphics?
Anti-Grain Geometry – High Fidelity 2D Graphics – A High Quality Rendering Engine for C++ is a programming library, which is my favourite choice for rendering vector graphics.
You might like to make a wrapper of it (take a look at documentation ), look into sources or …
Jump to Research section where you can find a lot of information how to do : “High Fidelity 2D Graphics – A High Quality Rendering”. Brazier lines and other topics are mentioned there. My favourite section is “Texts Rasterization Exposures” about sub-pixel rendering.
If you are interested how to optimize drawing lines, polygons etc even on C+assembly level,
James D. Foley, Andries van Dam, Steven K. Feiner, John F. Hughes, Richard L. Phillips” ref1 ref2
Here as example of one of many 2D Computer Graphics algorithms: