nothings/stb — pull request #41 by baldurk (2014-09-09 19:57:01+00:00)
Title: Add .hdr file writing support

I've added .hdr radiance RGBE support to stb_image_write.h since it could be useful for dumping an hdr screenshot which photoshop or other editors could open, and the encoding isn't too onerous.

I tried to match the code style and follow stb guidelines, I've tested it such as I can (I can't seem to find an image viewer that will open >32768 width files to test that case but inspecting the data loaded by stb_image.h by hand looks fine), and it compiles on what I have available - gcc, clang on linux and VS2010.

If one really wanted to it'd be possible to avoid the malloc() for a scanline but it would make the RLE much more complex I suspect, so I didn't consider it worthwhile.