I often use ImageIO (i.e., CGImageSource) as a JPEG/PNG loader, but TIL that with a little coaxing, it will load OpenEXR and Radiance (.hdr) images too! https://stackoverflow.com/questions/48872043/how-to-load-16-bit-images-into-metal-textures … (note that the conversion code could probably be made faster with vImage and/or MPS).
Ha, true! I think UIImage’s support derives from ImageIO, but I still think the caveat I mentioned here applies: https://stackoverflow.com/questions/48872043/how-to-load-16-bit-images-into-metal-textures/48894668 … (which I see you’ve now seen). Anyway, thanks for the interesting questions!
-
-
Thanks for the great answers! I guess I'll never figure out why did CGContext.draw() gave crazy Float values, but I actually really prefer your method of not doing any .draw() based conversion at all, but just copying pure data.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.