Когда я начинаю настраивать первый ползунок, настройки второго теряются. Можно ли синхронизировать c все параметры?
@ IBAction fun c amountSliderValueChanged (_ sender: UISlider) {
let sliderValue = amountSlider.value
filter = CIFilter(name: "CIColorControls")
filter.setValue(beginImage, forKey: kCIInputImageKey)
filter.setValue(sliderValue, forKey: kCIInputBrightnessKey)
context = CIContext(options:nil)
let cgimg = context.createCGImage(filter.outputImage!, from: filter.outputImage!.extent)
let newImage = UIImage(cgImage: cgimg!)
self.imageView.image = newImage
}
@ IBAction fun c ExpositionSlider (_ sender : UISlider) {
let sliderValue = exposureSlider.value
filter = CIFilter(name:"CIVignette")!
filter.setValue(beginImage, forKey:kCIInputImageKey)
filter.setValue(sliderValue * 2, forKey:"inputIntensity")
filter.setValue(sliderValue * 30, forKey:"inputRadius")
context = CIContext(options:nil)
let cgimg = context.createCGImage(filter.outputImage!, from: filter.outputImage!.extent)
let newImage = UIImage(cgImage: cgimg!)
self.imageView.image = newImage }