Tuesday, 05 July, 2022
Song of the Day: Tom Sawyer - Rush
Had a covid scare, and I wasn’t feeling well today, so I spent it working from home. Of course, requesting VPN access ended up being a whole process and all of my work is currently being stored on a server on-site, so I ended up starting on a new project.
As it stands, the OpNav codebase only allows the use of TIFF files. This is fine for now, as .TIFF files are uncompressed and easily accessed. As the program expands however, it has been decided that expanding functionality to include JPEG and PNG files would be beneficial, as future partners may prefer to use alternative filetypes.
So, I’ve set to work writing up a C++ file to read-in jpeg and png files and populate a 2-dimensional integer array with pixel values. I decided to start with jpegs, and have not been disappointed. They are COMPLICATED. Especially compared to tiff and pngs. There are quantization and huffman tables to be extracted, the incoming byte stream has to be decoded by those huffman tables, and then the image needs to be constructed from 8x8 pixel grids that have been quantized and had a discrete cosine transform performed on them.
By the end of the day, I managed to start to wrap my head around what exactly I needed to parse from the binary stream and start splitting the sections up.