Create Core Image filters that expose their attributes as properties.
Core Image provides methods that create type-safe CIFilter instances. Use these filters to avoid run-time errors that can occur when relying on Core Image's string-based API.
To use the type-safe API, import CoreImage.CIFilterBuiltins:
The type-safe approach returns a non-optional filter. Because the returned filter conforms to the relevant protocol—for example, CIFalseColor in the case of falseColor()—the parameters are available as properties. The following creates and applies a false color filter:
The false color filter maps luminance to a color ramp of two colors: