What source code is worth studying?
dtf: 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.