I've found some code for reading an old image format, and I'm trying to figure out what format it is. Attributes of the file format I've deduced from reading the code:
- The image file begins with a two-byte header. The first byte is one-eighth the image width, and the second byte is one-sixth the image height.
- It's a black-and-white format, one bit per pixel.
- Pixel data is run-length encoded: if the high bit of a byte is set, the low seven bits are a count of the number of times the next byte in the file should be repeated. If the high bit is clear, the byte is interpreted literally. Encoded pixel runs don't extend across rows of data.
- Possibly the most telling aspect of this format: each decoded byte represents six vertical pixels with the low bit being the topmost pixel, while successive bytes represent horizontally-adjacent stacks. Essentially, it's a vertical "mini-raster-scan" superimposed on top of the traditional horizontal raster scan.
Other, possibly relevant facts:
- The format is called "OO" or "OOFormat" internally.
- Given the dates in the code comments, the format probably pre-dates 1996.
- The programmer who wrote the image-reading code considered an image more than 640 pixels wide or 600 pixels high to be "unreasonable", and attempting to read larger images returns an error.
- Function names hint that this might be some sort of screen-dump format.