I believe native reading of OpenEXR format is (unofficially) supported both on recent macOS and iOS versions: Is OpenEXR supported on iOS / macOS?
I'd like to load an OpenEXR image to a Metal texture, probably via MTKTextureLoader.newTexture()
.
My problem is that XCode doesn't recognise OpenEXR files as texture assets, but as data asset.
This means I cannot use MTKTextureLoader.newTexture(name: textureName, ...)
.
What cross platform (recent macOS / iOS) options are there to read an image from a data asset?
Since .newTexture
supports CGImage, I'd guess that the natural way would be to load into CGImage, but I don't quite understand how.
Or should I simply make an URL out of the data asset's file and try to load that one?