Oscar Papel's Web Log

Thursday, November 11, 2004

Obsidian, meet Damocles.

As started in the previous post, Damocles was born out of the need to get native performance in my C# classes. Damocles is implemented in portable ANSI C. It is a collection of very low level functions to do imaging. It is not optimized to favour one CPU or another although I did do a lot of work to minimize the working set and instruction count. It is fast but not hand-tuned assembly fast. It does NOT use the Altivec instructions on the PPC or the MMX/SSE instructions on the PC. These will be addressed later. Damocles was designed to be a well performing PORTABLE base.

Considering the lack of niceties in plain C, it is amazing that elegant code can be written using it. Granted, when you are writing 18 versions of Boolean XOR, programming niceties aren't what gets the job done. It's small, efficient, tight code that does.

I mentioned 18 because that's how many different pixel formats that Damocles currently supports. That does NOT count paletteized versions. Due to the need to support higher than 8 bits per channel images as efficiently as possible, there is direct support for 8,10,12,14 & 16 bits per channel as well as single precision floating point support. Since there can be Gray, RGB, and RGBA colorspaces, that makes 6 choices for channel depth x 3 colorspaces = 18 pixel formats.

0 Comments:

Post a Comment

<< Home