Thursday, September 16, 2010

Yet another version of the Cognitive Profile

It seems like ten years ago that the first version of the CPI was launched on a JavaScript server named Rhinojetty. And then the second version of the CPI was launched on a prototype of the Syntelos SX server.

Tonight the latest iteration of this venerable educational app is launched in Googleland, with the server on Google App Engine, the website on Google Sites, and the engineering on Google Code.

In the service of this latest production I put together a graphics renderer now found at Pisces Graphics. The GAE platform doesn't include the usual "headless" graphics packages found in most Java server side environments, and I couldn't find a reasonable replacement. One possibility was PulpCore, which is a software renderer, however this package doesn't support the breadth of graphics operations needed for the CPI result image.

Reworking Pisces required sorting its S15.16 fixed point math into a floating point user space package. The current result, in version 1.0.1, has some notable omissions in its API. The pisces.Graphics API exposes the path operators moveTo, lineTo, cubicTo and friends but missed the close operator and the beginRendering and endRendering methods.

The good part is the Path, available as

public class Graphics {

public Graphics draw(Path p)

public Graphics fill(Path p)

I think this at least the third time I've done Font unpacking and rendering. In this case there's yet another approach, foresaking the usual abstraction in the choice to simply name the font for its file.

Font font = new Font("sun12x22.psfu");

I like it. Results in a simple and effective package.

Here's the CPI code that uses Pisces, Profile Image. It's in a state between having been disassembled from the previous version, and possibly opening up to scaling the image.

Many thanks to Google and Sun and David Eisenberg for lots of fun and interesting code to use in this project.

No comments: