Thanks everyone for posting your experiences.
I'm building a photo filter app (hobby project) from scratch for macOS. and got here when researching why my sliders started to become too slow to use and what to do about it.
So I added the example by Graphics and Games Engineer to my project to replace my "ImageView" and display my CI / CG images directly without converting them to NSImage.
So far I got a working view, which shows a green background, but I am unable to figure out how to display my image on this, what to pass as context to view as it wants an NSViewRepresentableContext and the only thing I have is a CIContext...
I think I want to be able to display filter.outputImage... here's an example of how I make this:
func ciExposure (inputImage: CIImage, inputEV: Double) -> CIImage {
let filter = CIFilter(name: "CIExposureAdjust")!
filter.setValue(inputImage, forKey: kCIInputImageKey)
filter.setValue(inputEV, forKey: kCIInputEVKey)
return filter.outputImage!
}
Can someone give me a hint about how to do this? I don't mind doing research but it starts to feel like I've hit a wall here...
Thanks in advance!
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: