When creating a raw image with CIFilter, I need to provide and identifier hint for the raw image decoder. How do I do this?
The following code does not populate the dictionary and CIFilter returns nil.
How would I do this correctly? I am completely stuck.
The following code does not populate the dictionary and CIFilter returns nil.
How would I do this correctly? I am completely stuck.
Code Block let rfo = [ String(kCGImageSourceTypeIdentifierHint) : "com.sony.raw-image" ] as! [CIRAWFilterOption:Any] let cii = CIFilter(imageData: data , options: rfo).outputImage
Are you sure kCGImageSourceTypeIdentifierHint is the right key for your purpose?
The doc of kCGImageSourceTypeIdentifierHint says This key can be provided in the options dictionary when you create a CGImageSource object, no mention about CIFilter.
At least, the key needs to be of type CIRAWFilterOption, not String.
The doc of kCGImageSourceTypeIdentifierHint says This key can be provided in the options dictionary when you create a CGImageSource object, no mention about CIFilter.
At least, the key needs to be of type CIRAWFilterOption, not String.
Code Block let sourceTypeIdentifierHint = CIRAWFilterOption(rawValue: kCGImageSourceTypeIdentifierHint as String) let rfo: [CIRAWFilterOption: Any] = [ sourceTypeIdentifierHint : "com.sony.raw-image" ]