Reputation: 5234
I'm using the CIFilter CIColorControls in Swift to alter camera input, but I can't find any setting to leave the image unaffected. I'm attempting to calibrate the saturation, brightness and contrast parameters in CIColorControls by adjusting UISliders.
The documentation states that inputSaturation and inputContrast's default values are 1.0. inputBrightness does not state an input value, but upon adjusting these values, I can't find a setting to start from that displays the image unaffected by all 3 of these settings, which makes me suspect there is something fundamentally wrong with this filter.
I'm passing my unaltered CIImage with applyingFilter:
image = image
.applyingFilter("CIColorControls", parameters: [kCIInputImageKey: image,
kCIInputSaturationKey:debugSatVal,
kCIInputBrightnessKey:debugBrightVal,
kCIInputContrastKey:debugConVal])
debugSatVal, debugBrightVal and debugConVal are controlled by UISliders and I can observe the values of them in LLDB.
Upvotes: 4
Views: 2116
Reputation: 13296
These are the values that should return the original image
kCIInputSaturationKey: 1.0
kCIInputBrightnessKey: 0.0
kCIInputContrastKey: 1.0
Upvotes: 10