5 ms·
I've been using the PFM format (http://netpbm.sourceforge.net/doc/pfm.html http://netpbm.sourceforge.net/doc/pfm.html) for a project recently. It's the most ob
by phorese 11y ago
I've been using the PFM format (http://netpbm.sourceforge.net/doc/pfm.html http://netpbm.sourceforge.net/doc/pfm.html) for a project recently.
It's the most obscure member of the Netpbm family. Almost no image viewer understands it, and no image editor can read or write it. Luckily there's the incredible CImg (http://www.cimg.eu/ http://www.cimg.eu/) lib.
PFM is stored in left to right, bottom to top order pixel. It has exactly one or three channels. One pixel is four bytes. There's an obscure "scale/endianness" parameter to tell you the byte order.
I love it, and I hate it.
- techdragon 11y agoWhich makes it impossible for me not to ask... Why are you using it for the project? Is it for interoperability with some other component? If so, what sort of thing is using such a format, I'm intrigued.
- phorese 11y agoGood question :) I needed a quick way to hack the output of 2D float data (pixel annotations to complement some image) into some legacy C without adding dependencies. Thanks to CImg, I can read and display the PFM files in 10 lines of my own C++. I thought about just writing a width/height-annotated binary blob instead, but then realized that's really what PFM already is. I have no idea if anything is really using PFM. I certainly have not found any "big" compatible programs.