temperatureAndTint()
Alters an image’s temperature and tint.
Declaration
class func temperatureAndTint() -> any CIFilter & CITemperatureAndTintReturn Value
The modified image.
Discussion
This method applies the image temperature and tint filter to an image. The effect adjusts the white balance of the input image to match the targetNeutral property, resulting in a cooler or warmer tone image.
The temperature and tint filter uses the following properties:
neutralA
vectorcontaining the source white point as a CIVector.targetNeutralA vector containing the desired white point as a CIVector.
inputImageAn image with the type CIImage.
The following code creates a filter that adds an orange hue to the input image:
func tempatureAndTint(inputImage: CIImage) -> CIImage {
let tempatureAndTintFilter = CIFilter.temperatureAndTint()
tempatureAndTintFilter.inputImage = inputImage
tempatureAndTintFilter.neutral = CIVector(x: 11500, y: 10)
tempatureAndTintFilter.targetNeutral = CIVector(x: 4000, y: 0)
return tempatureAndTintFilter.outputImage!
}[Image]