picture home | pixelblog | qt_tools

omino code blog

We need code. Lots of code.
David Van Brink // Tue 2007.03.20 01:06 // {c code}

Always with the Printf()

So here’s an interesting problem. Suppose that you’re writing an After Effects plugin, and trying to debug some of the graphics renderings and primitive routines.

Sure, modulating a handful of tinted rectangles which alter their dimensions based on the red and green components of the color they’re drawn over looked right when I tried it…

And then doing a spherical projection looks more than right, it starts to look kind-of cool…

But at some point I got paranoid that my antialiased rectangle routine, at the core of everything, hadn’t been rigorously exercised.

And so, short of pixel-sniffing (which I’m just not studly enough for today) how best to check a whole lot of different cases? Niftily, the application in normal use lends itself to the problem. Since it’s an animation program, and highly parameterizable and scriptable, it’s possible to animate any and all parameters and render the sequence over time. It’s a gosh-darned parameter sweeping test system built into a… gosh-darned keyframed animation system.

This still requires visual inspection of a lot of frames, but at least it’s pixels, and therefore fun.

But how to match up each rendered frame with the parameters that created it? One way might be to create a log file, pipe it to the line printer, get the 400 pages together in one of those nifty binders, and squint at it and the screen… But then again: rendered frames. A tidier approach is to printf to the rendered frame itself.

They say in cinematography to strive to have “Every frame a masterpiece,” but I’ll settle for “Every frame a self-explanatory test-case.”

Here in the future, you can find anything you want, and Googling for “8×8 font” delivered some hits right off. (I wanted to have my own font to reduce involvement with the OS, to maintain portability.)

It’s so technical looking. It has that marvelous anti-aesthetic that comes only naturally from a non-artist… so functional, so 1970’s NASA. But it’s there, and I used it, thanks to a generous soul at http://overcode.yak.net/12.

Here’s the whole font, for your viewing pleasure.

And here’s the C data file I generated using a Perl script to parse the .bmp on the link above. Note the festive ascii-grid representation of each character… Every file, a self contained thingum.

Feel free to use this 8×8 C data file for your retrovideo 8×8 font needs. And such.

Edit: reading further on http://overcode.yak.net/1 I see that the font author, John Reeves Hall, passed away in 2005. Interesting. The ultimate goal of technology, I believe, is to demolish all boundaries of time and space, allowing intantaneous communication with any person, living or dead. Thanks for the font, John.
oh, i dont know. what do you think?



(c) 2003-2011 omino.com / contact poly@omino.com